function themerex_options_load_scripts() { // WP Color Picker themerex_enqueue_style('wp-color-picker', false, array(), null); // ThemeREX options styles themerex_enqueue_style('themerex-options-style', themerex_get_file_url('/admin/css/theme-options.css'), array(), null); themerex_enqueue_style('themerex-options-style-datepicker', themerex_get_file_url('/admin/css/theme-options-datepicker.css'), array(), null); // ThemeREX messages script themerex_enqueue_style('themerex-messages-style', themerex_get_file_url('/js/messages/_messages.css'), array(), null); // WP core scripts wp_enqueue_media(); themerex_enqueue_script('wp-color-picker', false, array('jquery'), null, true); // jQuery scripts themerex_enqueue_script('jquery-ui-core', false, array('jquery'), null, true); themerex_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true); themerex_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true); themerex_enqueue_script('jquery-ui-sortable', false, array('jquery', 'jquery-ui-core'), null, true); themerex_enqueue_script('jquery-ui-draggable', false, array('jquery', 'jquery-ui-core'), null, true); themerex_enqueue_script('jquery-ui-datepicker', false, array('jquery', 'jquery-ui-core'), null, true); themerex_enqueue_script('jquery-input-mask', themerex_get_file_url('/admin/js/jquery.maskedinput.1.3.1.js'), array('jquery'), null, true); // ThemeREX options scripts themerex_enqueue_script('themerex-options-script', themerex_get_file_url('/admin/js/theme-options.js'), array('jquery'), null, true); // ThemeREX messages script themerex_enqueue_script('themerex-messages', themerex_get_file_url('/js/messages/_messages.js'), array('jquery'), null, true); }
function load_scripts() { if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'trx_emailer') { themerex_enqueue_style('trx-emailer-style', themerex_get_file_url('/admin/tools/emailer/emailer.css'), array(), null); } if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'trx_emailer') { themerex_enqueue_script('jquery-ui-core', false, array('jquery'), null, true); themerex_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true); themerex_enqueue_script('trx-emailer-script', themerex_get_file_url('/admin/tools/emailer/emailer.js'), array('jquery'), null, true); } }
function sc_zoom($atts, $content = null) { if (in_shortcode_blogger()) { return ''; } extract(shortcode_atts(array("id" => "", "class" => "", "src" => "", "url" => "", "over" => "", "border" => "none", "align" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts)); $s = getStyleString('!' . $top, '!' . $right, '!' . $bottom, '!' . $left, $width, $height); $width = getStyleValue($width); $height = getStyleValue($height); if (empty($id)) { $id = 'sc_zoom_' . str_replace('.', '', mt_rand()); } themerex_enqueue_script('elevate-zoom', themerex_get_file_url('/js/jquery.elevateZoom-3.0.4.min.js'), array(), null, true); $src = $src != '' ? $src : $url; if ($src > 0) { $attach = wp_get_attachment_image_src($src, 'full'); if (isset($attach[0]) && $attach[0] != '') { $src = $attach[0]; } } if ($over > 0) { $attach = wp_get_attachment_image_src($over, 'full'); if (isset($attach[0]) && $attach[0] != '') { $over = $attach[0]; } } return empty($src) ? '' : (!sc_param_is_off($border) ? '<div class="sc_border sc_border_' . $border . '">' : '') . '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_zoom' . (!empty($class) ? ' ' . $class : '') . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>' . '<img src="' . $src . '"' . ($height != '' ? ' style="height:' . $height . ';"' : '') . ' data-zoom-image="' . $over . '" alt="" />' . '</div>' . (!sc_param_is_off($border) ? '</div>' : ''); }
<?php $show_all = !isset($postinfo_buttons) || !is_array($postinfo_buttons); // Social share buttons if (is_singular() && get_theme_option('show_share') == 'yes') { themerex_enqueue_script('social-share', themerex_get_file_url('/js/social/social-share.js'), array(), null, true); } ?> <ul> <?php if ($show_all || in_array('more', $postinfo_buttons)) { ?> <li class="squareButton light ico"><a class="icon-link" title="<?php _e('More', 'themerex'); ?> " href="<?php echo esc_url($post_data['post_link']); ?> "><?php _e('More', 'themerex'); ?> </a></li> <?php } if ($show_all || in_array('likes', $postinfo_buttons)) { ?> <?php $likes = isset($_COOKIE['themerex_likes']) ? $_COOKIE['themerex_likes'] : ''; $allow = themerex_strpos($likes, ',' . $post_data['post_id'] . ',') === false; ?> <li class="likeButton like<?php
$THEMEREX_options[] = array("title" => __('User menu text color', 'themerex'), "desc" => __('Select user menu foreground color."', 'themerex'), "id" => "user_menu_fore_color", "override" => "category,post,page", "std" => "", "type" => "color"); $THEMEREX_options[] = array("title" => __('Show Theme customizer', 'themerex'), "desc" => __('Do you want to show theme customizer in the right panel? Your website visitors will be able to customise it yourself.', 'themerex'), "id" => "show_theme_customizer", "override" => "category,post,page", "std" => "no", "options" => $yes_no, "type" => "switch"); $THEMEREX_options[] = array("title" => __('Remember visitor\'s settings', 'themerex'), "desc" => __('To remember the settings that were made by the visitor, when navigating to other pages or to limit their effect only within the current page', 'themerex'), "id" => "remember_visitors_settings", "std" => "yes", "options" => $yes_no, "type" => "switch"); $THEMEREX_options[] = array("title" => __('Responsive Layouts', 'themerex'), "desc" => __('Do you want use responsive layouts on small screen or still use main layout?', 'themerex'), "id" => "responsive_layouts", "std" => "yes", "options" => $yes_no, "type" => "switch"); $THEMEREX_options[] = array("title" => __('Favicon', 'themerex'), "desc" => __('Upload a 16px x 16px image that will represent your website\'s favicon.<br /><em>To ensure cross-browser compatibility, we recommend converting the favicon into .ico format before uploading. (<a href="http://www.favicon.cc/">www.favicon.cc</a>)</em>', 'themerex'), "id" => "favicon", "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Additional CSS and HTML/JS code', 'themerex'), "desc" => __('Put here your custom CSS and JS code', 'themerex'), "override" => "category,page,post", "type" => "info"); $THEMEREX_options[] = array("title" => __('Your CSS code', 'themerex'), "desc" => __('Put here your css code to correct main theme styles', 'themerex'), "id" => "custom_css", "override" => "category,post,page", "divider" => false, "cols" => 80, "rows" => 20, "std" => "", "type" => "textarea"); $THEMEREX_options[] = array("title" => __('Your HTML/JS code', 'themerex'), "desc" => __('Put here your invisible html/js code: Google analitics, counters, etc', 'themerex'), "id" => "custom_code", "override" => "category,post,page", "cols" => 80, "rows" => 20, "std" => "", "type" => "textarea"); $THEMEREX_options[] = array("title" => __('Body style', 'themerex'), "id" => 'customization_body', "override" => "category,post,page", "icon" => 'iconadmin-picture-1', "type" => "tab"); $THEMEREX_options[] = array("title" => __('Body parameters', 'themerex'), "desc" => __('Background color, pattern and image used only for fixed body style.', 'themerex'), "override" => "category,post,page", "type" => "info"); $THEMEREX_options[] = array("title" => __('Body style', 'themerex'), "desc" => __('Select body style:<br><b>boxed</b> - if you want use background color and/or image,<br><b>wide</b> - page fill whole window with centered content,<br><b>fullwide</b> - page content stretched on the full width of the window (with few left and right paddings),<br><b>fullscreen</b> - page content fill whole window without any paddings', 'themerex'), "id" => "body_style", "divider" => false, "override" => "category,post,page", "std" => "wide", "options" => $body_styles, "dir" => "horizontal", "type" => "radio"); $THEMEREX_options[] = array("title" => __('Load background image', 'themerex'), "desc" => __('Always load background images or only for boxed body style', 'themerex'), "id" => "load_bg_image", "override" => "category,post,page", "std" => "boxed", "size" => "medium", "options" => array('boxed' => __('Boxed', 'themerex'), 'always' => __('Always', 'themerex')), "type" => "switch"); $THEMEREX_options[] = array("title" => __('Background color', 'themerex'), "desc" => __('Body background color', 'themerex'), "id" => "bg_color", "override" => "category,post,page", "std" => "#bfbfbf", "type" => "color"); $THEMEREX_options[] = array("title" => __('Background predefined pattern', 'themerex'), "desc" => __('Select theme background pattern (first case - without pattern)', 'themerex'), "id" => "bg_pattern", "override" => "category,post,page", "std" => "", "options" => array(0 => themerex_get_file_url('/images/spacer.png'), 1 => themerex_get_file_url('/images/bg/pattern_1.png'), 2 => themerex_get_file_url('/images/bg/pattern_2.png'), 3 => themerex_get_file_url('/images/bg/pattern_3.png'), 4 => themerex_get_file_url('/images/bg/pattern_4.png'), 5 => themerex_get_file_url('/images/bg/pattern_5.png'), 6 => themerex_get_file_url('/images/bg/pattern_6.png'), 7 => themerex_get_file_url('/images/bg/pattern_7.png'), 8 => themerex_get_file_url('/images/bg/pattern_8.png'), 9 => themerex_get_file_url('/images/bg/pattern_9.png')), "style" => "list", "type" => "images"); $THEMEREX_options[] = array("title" => __('Background custom pattern', 'themerex'), "desc" => __('Select or upload background custom pattern. If selected - use it instead the theme predefined pattern (selected in the field above)', 'themerex'), "id" => "bg_custom_pattern", "override" => "category,post,page", "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Background predefined image', 'themerex'), "desc" => __('Select theme background image (first case - without image)', 'themerex'), "id" => "bg_image", "override" => "category,post,page", "std" => "", "options" => array(0 => themerex_get_file_url('/images/spacer.png'), 1 => themerex_get_file_url('/images/bg/image_1_thumb.jpg'), 2 => themerex_get_file_url('/images/bg/image_2_thumb.jpg'), 3 => themerex_get_file_url('/images/bg/image_3_thumb.jpg'), 4 => themerex_get_file_url('/images/bg/image_4_thumb.jpg'), 5 => themerex_get_file_url('/images/bg/image_5_thumb.jpg'), 6 => themerex_get_file_url('/images/bg/image_6_thumb.jpg')), "style" => "list", "type" => "images"); $THEMEREX_options[] = array("title" => __('Background custom image', 'themerex'), "desc" => __('Select or upload background custom image. If selected - use it instead the theme predefined image (selected in the field above)', 'themerex'), "id" => "bg_custom_image", "override" => "category,post,page", "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Background custom image position', 'themerex'), "desc" => __('Select custom image position', 'themerex'), "id" => "bg_custom_image_position", "override" => "category,post,page", "std" => "left_top", "options" => array('left_top' => "Left Top", 'center_top' => "Center Top", 'right_top' => "Right Top", 'left_center' => "Left Center", 'center_center' => "Center Center", 'right_center' => "Right Center", 'left_bottom' => "Left Bottom", 'center_bottom' => "Center Bottom", 'right_bottom' => "Right Bottom"), "type" => "select"); $THEMEREX_options[] = array("title" => __('Show video background', 'themerex'), "desc" => __("Show video on the site background (only for Fullscreen body style)", 'themerex'), "id" => "show_video_bg", "override" => "category,post,page", "std" => "no", "options" => $yes_no, "type" => "switch"); $THEMEREX_options[] = array("title" => __('Youtube code for video bg', 'themerex'), "desc" => __("Youtube code of video", 'themerex'), "id" => "video_bg_youtube_code", "override" => "category,post,page", "std" => "", "type" => "text"); $THEMEREX_options[] = array("title" => __('Local video for video bg', 'themerex'), "desc" => __("URL to video-file (uploaded on your site)", 'themerex'), "id" => "video_bg_url", "readonly" => false, "override" => "category,post,page", "before" => array('title' => __('Choose video', 'themerex'), 'action' => 'media_upload', 'multiple' => false, 'linked_field' => '', 'type' => 'video', 'captions' => array('choose' => __('Choose Video', 'themerex'), 'update' => __('Select Video', 'themerex'))), "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Use overlay for video bg', 'themerex'), "desc" => __('Use overlay texture for the video background', 'themerex'), "id" => "video_bg_overlay", "override" => "category,post,page", "std" => "no", "options" => $yes_no, "type" => "switch"); $THEMEREX_options[] = array("title" => __('Logo', 'themerex'), "id" => 'customization_logo', "override" => "category,post,page", "icon" => 'iconadmin-heart-1', "type" => "tab"); $THEMEREX_options[] = array("title" => __('Main logo', 'themerex'), "desc" => __('Select or upload logos for the site\'s header and select it position', 'themerex'), "override" => "category,post,page", "type" => "info"); $THEMEREX_options[] = array("title" => __('Logo image (main)', 'themerex'), "desc" => __('Main logo image for the header (if logo in the same line with menu)', 'themerex'), "id" => "logo_image", "override" => "category,post,page", "divider" => false, "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Logo image (above)', 'themerex'), "desc" => __('Logo image for the header (if logo above the menu)', 'themerex'), "id" => "logo_top", "override" => "category,post,page", "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Logo image (fixed)', 'themerex'), "desc" => __('Logo image for the header (if menu is fixed after the page is scrolled)', 'themerex'), "id" => "logo_fixed", "override" => "category,post,page", "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Logo image (side)', 'themerex'), "desc" => __('Logo image for the side menu', 'themerex'), "id" => "logo_side", "override" => "category,post,page", "std" => "", "type" => "media"); $THEMEREX_options[] = array("title" => __('Logo text', 'themerex'), "desc" => __('Logo text - display it after logo image', 'themerex'), "id" => "logo_text", "override" => "category,post,page", "std" => __('Kindergarten', 'themerex'), "type" => "text"); $THEMEREX_options[] = array("title" => __('Logo slogan', 'themerex'), "desc" => __('Logo slogan - display it under logo image (instead the site slogan)', 'themerex'), "id" => "logo_slogan", "override" => "category,post,page", "std" => '', "type" => "text"); $THEMEREX_options[] = array("title" => __('Logo height', 'themerex'), "desc" => __('Height for the logo in the header area', 'themerex'), "id" => "logo_height", "override" => "category,post,page", "increment" => 1, "std" => '', "min" => 10, "max" => 300, "mask" => "?999", "type" => "spinner");
function update_notifier() { $xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL); // Get the latest remote XML file on our server $theme_data = wp_get_theme(); ?> <style> .update-nag { display: none; } #theme_update_instructions {max-width: 670px;} .theme_update_changelog_title {margin: 30px 0 0 0; padding: 30px 0 0 0; border-top: 1px solid #ddd;} .theme_update_changelog ul { list-style-type:disc; margin-left:20px;} </style> <div class="wrap"> <div id="icon-tools" class="icon32"></div> <h2><?php echo NOTIFIER_THEME_NAME; ?> <?php _e('Theme Updates', 'themerex'); ?> </h2> <div id="message" class="updated below-h2"><p><strong><?php echo sprintf(__('There is a new version of the %s theme available.', 'themerex'), NOTIFIER_THEME_NAME); ?> </strong> <?php echo sprintf(__('You have version %s installed. Update to version %s.', 'themerex'), $theme_data->get('Version'), $xml->latest); ?> </p></div> <div><img alt="" style="margin: 0 0 20px 0; border: 1px solid #ddd;" src="<?php echo themerex_get_file_url('/screenshot.png'); ?> " /></div> <div id="theme_update_instructions"> <h3><?php _e('Update Download and Instructions', 'themerex'); ?> </h3> <p><?php echo sprintf(__('<strong>Please note:</strong> make a backup of the Theme inside your WordPress installation folder <strong>/wp-content/themes/%s/</strong>', 'themerex'), NOTIFIER_THEME_FOLDER_NAME); ?> </p> <p><?php _e('To update the Theme, login to <a href="' . esc_url('http://www.themeforest.net/') . '">ThemeForest</a>, head over to your <strong>downloads</strong> section and re-download the theme like you did when you bought it.', 'themerex'); ?> </p> <p><?php echo sprintf(__("Extract the zip's contents, look for the extracted theme folder, and after you have all the new files upload them using FTP to the <strong>/wp-content/themes/%s/</strong> folder overwriting the old ones (this is why it's important to backup any changes you've made to the theme files).", 'themerex'), NOTIFIER_THEME_FOLDER_NAME); ?> </p> <p><?php _e("If you didn't make any changes to the theme files, you are free to overwrite them with the new ones without the risk of losing theme settings, pages, posts, etc, and backwards compatibility is guaranteed.", 'themerex'); ?> </p> </div> <h3 class="theme_update_changelog_title"><?php _e('Changelog', 'themerex'); ?> </h3> <div class="theme_update_changelog"><?php echo esc_html($xml->changelog); ?> </div> </div> <?php }
<?php } // todo: magnific & pretty // magnific & pretty themerex_enqueue_style('magnific-style', themerex_get_file_url('/js/magnific-popup/magnific-popup.css'), array(), null); themerex_enqueue_script('magnific', themerex_get_file_url('/js/magnific-popup/jquery.magnific-popup.min.js'), array('jquery'), null, true); // Load PrettyPhoto if it selected in Theme Options if (get_theme_option('popup_engine') == 'pretty') { themerex_enqueue_style('prettyphoto-style', themerex_get_file_url('/js/prettyphoto/css/prettyPhoto.css'), array(), null); themerex_enqueue_script('prettyphoto', themerex_get_file_url('/js/prettyphoto/jquery.prettyPhoto.min.js'), array('jquery'), 'no-compose', true); } // todo: Media elements library if (get_theme_option('use_mediaelement') == 'yes') { if (floatval(get_bloginfo('version')) < "3.6") { themerex_enqueue_style('mediaplayer-style', themerex_get_file_url('/js/mediaplayer/mediaplayer.css'), array(), null); themerex_enqueue_script('mediaplayer', themerex_get_file_url('/js/mediaplayer/mediaelement.min.js'), array(), null, true); } else { wp_enqueue_style('mediaelement'); wp_enqueue_style('wp-mediaelement'); wp_enqueue_script('mediaelement'); wp_enqueue_script('wp-mediaelement'); } } else { global $wp_scripts, $wp_styles; $wp_scripts->done[] = 'mediaelement'; $wp_scripts->done[] = 'wp-mediaelement'; $wp_styles->done[] = 'mediaelement'; $wp_styles->done[] = 'wp-mediaelement'; } if ($post_number > 0) { // Pagination
function themerex_init_template() { // AJAX Queries settings global $THEMEREX_ajax_nonce, $THEMEREX_ajax_url; $THEMEREX_ajax_nonce = wp_create_nonce('ajax_nonce'); $THEMEREX_ajax_url = admin_url('admin-ajax.php'); // Set theme params from GET if (isset($_GET['set']) && $_GET['set'] == 1) { foreach ($_GET as $k => $v) { if (get_theme_option($k, null) !== null) { setcookie($k, $v, 0, '/'); $_COOKIE[$k] = $v; } } } // Get custom options from current category / page / post / shop load_custom_options(); // Reject old browsers support global $THEMEREX_jreject; $THEMEREX_jreject = false; if (!isset($_COOKIE['jreject'])) { themerex_enqueue_style('jquery_reject-style', themerex_get_file_url('/js/jreject/css/jquery.reject.css'), array(), null); themerex_enqueue_script('jquery_reject', themerex_get_file_url('/js/jreject/jquery.reject.js'), array('jquery'), null, true); setcookie('jreject', 1, 0, '/'); $THEMEREX_jreject = true; } // Main menu global $THEMEREX_mainmenu; if (get_custom_option('show_top_panel') != 'hide') { $menu_slug = get_custom_option('menu_main'); $args = array('menu' => empty($menu_slug) || $menu_slug == 'default' || is_inherit_option($menu_slug) ? '' : $menu_slug, 'container' => '', 'container_class' => '', 'container_id' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'menu_class' => '', 'menu_id' => 'mainmenu', 'echo' => false, 'fallback_cb' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 11, 'theme_location' => 'mainmenu'); if (get_theme_option('custom_menu') == 'yes' && class_exists('themerex_walker')) { $args['walker'] = new themerex_walker(); } $THEMEREX_mainmenu = wp_nav_menu($args); } else { $THEMEREX_mainmenu = ''; } // User menu global $THEMEREX_usermenu; if (get_custom_option('show_top_panel') != 'hide' && get_custom_option('show_user_menu') == 'yes') { $menu_slug = get_custom_option('menu_user'); $THEMEREX_usermenu = wp_nav_menu(array('menu' => empty($menu_slug) || $menu_slug == 'default' || is_inherit_option($menu_slug) ? '' : $menu_slug, 'container' => '', 'container_class' => '', 'container_id' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'menu_class' => '', 'menu_id' => 'usermenu', 'echo' => false, 'fallback_cb' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 11, 'theme_location' => 'usermenu')); } else { $THEMEREX_usermenu = ''; } // Side menu global $THEMEREX_sidemenu; if (get_custom_option('show_left_panel') == 'yes') { $menu_slug = get_custom_option('menu_side'); $THEMEREX_sidemenu = wp_nav_menu(array('menu' => empty($menu_slug) || $menu_slug == 'default' || is_inherit_option($menu_slug) ? '' : $menu_slug, 'container' => '', 'container_class' => '', 'container_id' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'menu_class' => '', 'menu_id' => 'sidemenu', 'echo' => false, 'fallback_cb' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 11, 'theme_location' => 'sidemenu')); } else { $THEMEREX_sidemenu = ''; } // Panel menu global $THEMEREX_panelmenu; if (get_custom_option('show_right_panel') == 'yes') { $menu_slug = get_custom_option('menu_right'); $THEMEREX_panelmenu = wp_nav_menu(array('menu' => empty($menu_slug) || $menu_slug == 'default' || is_inherit_option($menu_slug) ? '' : $menu_slug, 'container' => '', 'container_class' => '', 'container_id' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'menu_class' => '', 'menu_id' => 'panelmenu', 'echo' => false, 'fallback_cb' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 11, 'theme_location' => 'panelmenu')); } else { $THEMEREX_panelmenu = ''; } // Include current skin $skin = themerex_escape_shell_cmd(get_custom_option('theme_skin')); if (file_exists(themerex_get_file_dir('/skins/' . $skin . '/' . $skin . '.php'))) { require_once themerex_get_file_dir('/skins/' . $skin . '/' . $skin . '.php'); } // Logo image and icon from skin global $logo_text, $logo_slogan, $logo_icon, $logo_image, $logo_side, $logo_fixed, $logo_footer; $logo_text = get_custom_option('logo_text'); $logo_slogan = get_custom_option('logo_slogan'); $menu_align = get_custom_option('menu_align'); if ($logo_slogan == '') { $logo_slogan = get_bloginfo('description'); } $logo_icon = $logo_image = $logo_side = $logo_fixed = $logo_footer = ''; if (($logo_icon = get_custom_option('logo_icon')) == '' && file_exists(themerex_get_file_dir('/skins/' . $skin . '/images/logo-icon.png'))) { $logo_icon = themerex_get_file_url('/skins/' . $skin . '/images/logo-icon.png'); } if ($menu_align == 'left' || $menu_align == 'center') { if (($logo_image = get_custom_option('logo_top')) == '' && file_exists(themerex_get_file_dir('/skins/' . $skin . '/images/logo-top.png'))) { $logo_image = themerex_get_file_url('/skins/' . $skin . '/images/logo-top.png'); } } if ($logo_image == '' && ($logo_image = get_custom_option('logo_image')) == '' && file_exists(themerex_get_file_dir('/skins/' . $skin . '/images/logo.png'))) { $logo_image = themerex_get_file_url('/skins/' . $skin . '/images/logo.png'); } if (($logo_side = get_custom_option('logo_side')) == '' && file_exists(themerex_get_file_dir('/skins/' . $skin . '/images/logo-side.png'))) { $logo_side = themerex_get_file_url('/skins/' . $skin . '/images/logo-side.png'); } if ($logo_side == '') { $logo_side = $logo_image; } if (($logo_fixed = get_custom_option('logo_fixed')) == '' && file_exists(themerex_get_file_dir('/skins/' . $skin . '/images/logo-fixed.png'))) { $logo_fixed = themerex_get_file_url('/skins/' . $skin . '/images/logo-fixed.png'); } if ($logo_fixed == '') { $logo_fixed = $logo_image; } if (($logo_footer = get_custom_option('logo_image_footer')) == '' && file_exists(themerex_get_file_dir('/skins/' . $skin . '/images/logo-footer.png'))) { $logo_footer = themerex_get_file_url('/skins/' . $skin . '/images/logo-footer.png'); } if ($logo_footer == '') { $logo_footer = $logo_image; } global $THEMEREX_shop_mode; $THEMEREX_shop_mode = getValueGPC('themerex_shop_mode'); if (empty($THEMEREX_shop_mode)) { $THEMEREX_shop_mode = get_custom_option('shop_mode', ''); } if (empty($THEMEREX_shop_mode) || !is_archive()) { $THEMEREX_shop_mode = 'thumbs'; } }
</span> <div id="co_bg_images_list"> <?php for ($i = 1; $i <= 6; $i++) { ?> <a href="#" id="image_<?php echo esc_attr($i); ?> " class="<?php echo $i == 3 || $i == 6 ? 'no_margin ' : ''; ?> co_image_wrapper<?php echo $bg_image == $i ? ' current' : ''; ?> "><img src="<?php echo themerex_get_file_url('/images/bg/image_' . esc_attr($i) . '_thumb2.jpg'); ?> " alt="" /></a> <?php } ?> </div> <div id="co_bg_images"></div> </div> </form> <script type="text/javascript"> jQuery(document).ready(function(){ // Theme & Background color jQuery('#co_theme_color').css('backgroundColor', '<?php echo esc_attr($theme_color); ?>
<?php if (!is_user_logged_in() && get_theme_option('show_login') == 'yes') { // todo: Login form themerex_enqueue_script('form-login', themerex_get_file_url('/js/_form_login.js'), array(), null, true); ?> <div id="user-popUp" class="user-popUp mfp-with-anim mfp-hide"> <div class="sc_tabs"> <ul class="loginHeadTab"> <li><a href="#loginForm" class="loginFormTab icon"><?php _e('Log In', 'themerex'); ?> </a></li> <li><a href="#registerForm" class="registerFormTab icon"><?php _e('Create an Account', 'themerex'); ?> </a></li> </ul> <div id="loginForm" class="formItems loginFormBody"> <div class="itemformLeft"> <form action="<?php echo esc_url(wp_login_url()); ?> " method="post" name="login_form" class="formValid"> <input type="hidden" name="redirect_to" value="<?php echo esc_url(home_url()); ?> " /> <ul class="formList"> <li class="icon formLogin"><input type="text" id="login" name="log" value="" placeholder="<?php
/** * Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function * when creating your form elements. This handles the confusing stuff. */ function form($instance) { /* Widget admin side css */ themerex_enqueue_style('widget-qrcode-style', themerex_get_file_url('/widgets/qrcode/widget-qrcode-admin.css'), array(), null); themerex_enqueue_script('qrcode', themerex_get_file_url('/widgets/qrcode/jquery.qrcode-0.6.0.min.js'), array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'), null, false); //themerex_enqueue_style('color-picker', themerex_get_file_url('/js/colorpicker/colorpicker.css'), array(), null); //themerex_enqueue_script('color-picker', themerex_get_file_url('/js/colorpicker/colorpicker.js'), array('jquery'),null,true); /* Set up some default widget settings. */ $address = explode(',', get_theme_option('user_address')); $defaults = array('title' => '', 'description' => __('QR Code Generator (for your vcard)', 'themerex'), 'ulname' => '', 'ufname' => '', 'ucompany' => '', 'uaddr' => '', 'ucity' => '', 'upostcode' => '', 'ucountry' => '', 'uemail' => '', 'usite' => '', 'uphone' => '', 'uid' => md5(microtime()), 'urev' => date('Y-m-d'), 'image' => '', 'show_personal' => 0, 'show_what' => 1, 'auto_draw' => 0, 'width' => 160, 'text' => '', 'color' => '#000000', 'bg' => ''); $instance = wp_parse_args((array) $instance, $defaults); ?> <div class="widget_qrcode"> <div class="qrcode_tabs"> <ul class="tabs"> <li class="first"><a href="#tab_settings"><?php _e('Settings', 'themerex'); ?> </a></li> <li><a href="#tab_fields" onmousedown="initQRCode()"><?php _e('Personal Data', 'themerex'); ?> </a></li> <li><a href="#tab_text" onmousedown="initQRCode()"><?php _e('Any Text', 'themerex'); ?> </a></li> </ul> <div id="tab_settings" class="tab_content tab_settings"> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'themerex'); ?> </label> <input class="fld_title" onfocus="initQRCode()" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " style="width:100%;" /> </p> <p> <label><?php _e('Show as QR Code:', 'themerex'); ?> </label><br /> <input class="fld_show_what" onfocus="initQRCode()" id="<?php echo $this->get_field_id('show_what'); ?> _1" name="<?php echo $this->get_field_name('show_what'); ?> " value="1" type="radio" <?php echo $instance['show_what'] == 1 ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $this->get_field_id('show_what'); ?> _1"> <?php _e('Personal VCard', 'themerex'); ?> </label> <input class="fld_show_what" onfocus="initQRCode()" id="<?php echo $this->get_field_id('show_what'); ?> _0" name="<?php echo $this->get_field_name('show_what'); ?> " value="0" type="radio" <?php echo $instance['show_what'] == 0 ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $this->get_field_id('show_what'); ?> _0"> <?php _e('Any text', 'themerex'); ?> </label> </p> <p> <input class="fld_show_personal" onfocus="initQRCode()" id="<?php echo $this->get_field_id('show_personal'); ?> " name="<?php echo $this->get_field_name('show_personal'); ?> " value="1" type="checkbox" <?php echo $instance['show_personal'] == 1 ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $this->get_field_id('show_personal'); ?> "><?php _e('Show data under QR Code:', 'themerex'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('width'); ?> "><?php _e('Width:', 'themerex'); ?> </label> <input onmousedown="initQRCode()" onfocus="initQRCode()" id="<?php echo $this->get_field_id('width'); ?> " name="<?php echo $this->get_field_name('width'); ?> " value="<?php echo esc_attr($instance['width']); ?> " style="width:100%;" class="fld_width" /> </p> <p> <label for="<?php echo $this->get_field_id('color'); ?> "><?php _e('Color:', 'themerex'); ?> </label> <input onmousedown="initQRCode()" onfocus="initQRCode()" id="<?php echo $this->get_field_id('color'); ?> " name="<?php echo $this->get_field_name('color'); ?> " value="<?php echo esc_attr($instance['color']); ?> " style="width:100%; background-color:<?php echo $instance['color']; ?> " class="iColorPicker fld_color" /> </p> <p> <label for="<?php echo $this->get_field_id('bg'); ?> "><?php _e('Bg color:', 'themerex'); ?> </label> <input onmousedown="initQRCode()" onfocus="initQRCode()" id="<?php echo $this->get_field_id('bg'); ?> " name="<?php echo $this->get_field_name('bg'); ?> " value="<?php echo esc_attr($instance['bg']); ?> " style="width:100%; background-color:<?php echo $instance['bg']; ?> " class="iColorPicker fld_bg" /> </p> </div> <div id="tab_fields" class="tab_content tab_personal"> <p> <label for="<?php echo $this->get_field_id('ulname'); ?> "><?php _e('Last name:', 'themerex'); ?> </label> <input class="fld_ulname" id="<?php echo $this->get_field_id('ulname'); ?> " name="<?php echo $this->get_field_name('ulname'); ?> " value="<?php echo esc_attr($instance['ulname']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('ufname'); ?> "><?php _e('First name:', 'themerex'); ?> </label> <input class="fld_ufname" id="<?php echo $this->get_field_id('ufname'); ?> " name="<?php echo $this->get_field_name('ufname'); ?> " value="<?php echo esc_attr($instance['ufname']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('ucompany'); ?> "><?php _e('Company:', 'themerex'); ?> </label> <input class="fld_ucompany" id="<?php echo $this->get_field_id('ucompany'); ?> " name="<?php echo $this->get_field_name('ucompany'); ?> " value="<?php echo esc_attr($instance['ucompany']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('uphone'); ?> "><?php _e('Phone:', 'themerex'); ?> </label> <input class="fld_uphone" id="<?php echo $this->get_field_id('uphone'); ?> " name="<?php echo $this->get_field_name('uphone'); ?> " value="<?php echo esc_attr($instance['uphone']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('uaddr'); ?> "><?php _e('Address:', 'themerex'); ?> </label> <input class="fld_uaddr" id="<?php echo $this->get_field_id('uaddr'); ?> " name="<?php echo $this->get_field_name('uaddr'); ?> " value="<?php echo esc_attr($instance['uaddr']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('ucity'); ?> "><?php _e('City:', 'themerex'); ?> </label> <input class="fld_ucity" id="<?php echo $this->get_field_id('ucity'); ?> " name="<?php echo $this->get_field_name('ucity'); ?> " value="<?php echo esc_attr($instance['ucity']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('upostcode'); ?> "><?php _e('Post code:', 'themerex'); ?> </label> <input class="fld_upostcode" id="<?php echo $this->get_field_id('upostcode'); ?> " name="<?php echo $this->get_field_name('upostcode'); ?> " value="<?php echo esc_attr($instance['upostcode']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('ucountry'); ?> "><?php _e('Country:', 'themerex'); ?> </label> <input class="fld_ucountry" id="<?php echo $this->get_field_id('ucountry'); ?> " name="<?php echo $this->get_field_name('ucountry'); ?> " value="<?php echo esc_attr($instance['ucountry']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('uemail'); ?> "><?php _e('E-mail:', 'themerex'); ?> </label> <input class="fld_uemail" id="<?php echo $this->get_field_id('uemail'); ?> " name="<?php echo $this->get_field_name('uemail'); ?> " value="<?php echo esc_attr($instance['uemail']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('usite'); ?> "><?php _e('Web Site URL:', 'themerex'); ?> </label> <input class="fld_usite" id="<?php echo $this->get_field_id('usite'); ?> " name="<?php echo $this->get_field_name('usite'); ?> " value="<?php echo esc_attr($instance['usite']); ?> " style="width:100%;" /> </p> </div> <div id="tab_text" class="tab_content tab_text"> <p> <label for="<?php echo $this->get_field_id('fld_text'); ?> "><?php _e('Text to show as QR Code:', 'themerex'); ?> </label> <textarea class="fld_text" id="<?php echo $this->get_field_id('text'); ?> " name="<?php echo $this->get_field_name('text'); ?> " style="width:100%;"><?php echo $instance['text']; ?> </textarea> </p> </div> </div> <input class="fld_uid" id="<?php echo $this->get_field_id('uid'); ?> " name="<?php echo $this->get_field_name('uid'); ?> " value="<?php echo esc_attr($instance['uid']); ?> " type="hidden" /> <input class="fld_urev" id="<?php echo $this->get_field_id('urev'); ?> " name="<?php echo $this->get_field_name('urev'); ?> " value="<?php echo esc_attr($instance['urev']); ?> " type="hidden" /> <p> <input class="fld_button_draw" id="<?php echo $this->get_field_id('button_draw'); ?> " name="<?php echo $this->get_field_name('button_draw'); ?> " value="<?php echo esc_attr(__('Update', 'themerex')); ?> " type="button" /> <input class="fld_auto_draw" id="<?php echo $this->get_field_id('auto_draw'); ?> " name="<?php echo $this->get_field_name('auto_draw'); ?> " value="1" type="checkbox" <?php echo $instance['auto_draw'] == 1 ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $this->get_field_id('auto_draw'); ?> "> <?php _e('Auto', 'themerex'); ?> </label> </p> <input class="fld_image" id="<?php echo $this->get_field_id('image'); ?> " name="<?php echo $this->get_field_name('image'); ?> " value="" type="hidden" /> <div id="<?php echo $this->get_field_id('qrcode_image'); ?> " class="qrcode_image"><img src="<?php echo $instance['image']; ?> " alt="" /></div> <div id="<?php echo $this->get_field_id('qrcode_data'); ?> " class="qrcode_data"> <?php if ($instance['show_personal'] == 1) { ?> <ul> <?php if ($instance['show_what'] == 1) { ?> <li class="user_name odd first"><?php echo __('Name:', 'themerex') . ' ' . $instance['ufname'] . ' ' . $instance['ulname']; ?> </li> <?php echo ($instance['ucompany'] ? '<li class="user_company even">' . __('Company:', 'themerex') . ' ' . $instance['ucompany'] . '</li>' : '') . ($instance['uphone'] ? '<li class="user_phone odd">' . __('Phone:', 'themerex') . ' ' . $instance['uphone'] . '</li>' : '') . ($instance['uemail'] ? '<li class="user_email even">' . __('E-mail:', 'themerex') . ' ' . '<a href="mailto:' . $instance['uemail'] . '">' . $instance['uemail'] . '</a></li>' : '') . ($instance['usite'] ? '<li class="user_site odd">' . __('Site:', 'themerex') . ' ' . '<a href="' . $instance['usite'] . '" target="_blank">' . $instance['usite'] . '</a></li>' : ''); ?> <?php } else { ?> <li class="text odd first"><?php echo $instance['text']; ?> </li> <?php } ?> </ul> <?php } ?> </div> </div> <script type="text/javascript"> jQuery(document).ready(function(){ initQRCode(); iColorPicker(); }); function initQRCode() { var widget = null; jQuery('#widgets-right .widget_qrcode input.iColorPicker').each(function() { var obj = jQuery(this); if (!obj.hasClass('colored') && obj.attr('id').indexOf('__i__') < 0) { widget = obj.parents('.widget_qrcode'); obj.addClass('colored'); setColorPicker(jQuery(this).attr('id')); widget.find('div.qrcode_tabs').tabs(); widget.find('.fld_button_draw').click(function() { updateQRCode(widget); }); widget.parents('form').find('.widget-control-save').click(function() { updateQRCode(widget); }); widget.find('.tab_personal input,.tab_text textarea,.fld_auto_draw,.iColorPicker').change(function () { if (widget.find('.fld_auto_draw').attr('checked')=='checked') { widget.find('.fld_button_draw').hide(); updateQRCode(widget); } else widget.find('.fld_button_draw').show(); }); } }); if (widget && widget.find('.fld_auto_draw').attr('checked')=='checked') widget.find('.fld_button_draw').hide(); } function updateQRCode(widget) { showQRCode(widget, { ufname: widget.find('.fld_ufname').val(), ulname: widget.find('.fld_ulname').val(), ucompany: widget.find('.fld_ucompany').val(), usite: widget.find('.fld_usite').val(), uemail: widget.find('.fld_uemail').val(), uphone: widget.find('.fld_uphone').val(), //ufax: widget.find('.fld_ufax').val(), uaddr: widget.find('.fld_uaddr').val(), ucity: widget.find('.fld_ucity').val(), upostcode: widget.find('.fld_upostcode').val(), ucountry: widget.find('.fld_ucountry').val(), //unote: widget.find('.fld_unote').val(), //ucats: widget.find('.fld_ucats').val(), uid: widget.find('.fld_uid').val(), urev: widget.find('.fld_urev').val(), text: widget.find('.fld_text').val() }, { qrcode: widget.find('.qrcode_image').eq(0), personal: widget.find('.qrcode_data'), show_personal: widget.find('.fld_show_personal').attr('checked')=='checked', show_what: widget.find('.fld_show_what').attr('checked')=='checked' ? 1 : 0, width: widget.find('.fld_width').val(), color: widget.find('.fld_color').val(), bg: widget.find('.fld_bg').val() } ); widget.find('.fld_image').val(widget.find('.qrcode_image canvas').get(0).toDataURL('image/png')); } function showQRCode(widget, vc, opt) { if (opt.show_what==1) { var text = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + 'FN:' + vc.ufname + ' ' + vc.ulname + '\n' + 'N:' + vc.ulname + ';' + vc.ufname + '\n' + (vc.ucompany ? 'ORG:' + vc.ucompany + '\n' : '') + (vc.uphone ? 'TEL;TYPE=cell, pref:' + vc.uphone + '\n' : '') + (vc.ufax ? 'TEL;TYPE=fax, pref:' + vc.ufax + '\n' : '') + (vc.uaddr || vc.ucity || vc.ucountry ? 'ADR;TYPE=dom, home, postal, parcel:;;' + vc.uaddr + ';' + vc.ucity + ';;' + vc.upostcode + ';' + vc.ucountry + '\n' : '') + (vc.usite ? 'URL:' + vc.usite + '\n' : '') + (vc.uemail ? 'EMAIL;TYPE=INTERNET:' + vc.uemail + '\n' : '') + (vc.ucats ? 'CATEGORIES:' + vc.ucats + '\n' : '') + (vc.unote ? 'NOTE:' + vc.unote + '\n' : '') + (vc.urev ? 'NOTE:' + vc.urev + '\n' : '') + (vc.uid ? 'UID:' + vc.uid + '\n' : '') + 'END:VCARD'; } else { var text = vc.text; } opt.qrcode .empty() .qrcode({ 'text': text, 'color': opt.color, 'bgColor': opt.bg!='' ? opt.bg : null, 'width': opt.width, 'height': opt.width, 'size': opt.width }); if (opt.show_personal == 0) opt.personal.empty().hide(); else opt.personal.html( '<ul>' + (opt.show_what==1 ? '<li class="user_name odd first">' + vc.ufname + ' ' + vc.ulname + '</li>' + (vc.ucompany ? '<li class="user_company even">' + vc.ucompany + '</li>' : '') + (vc.uphone ? '<li class="user_phone odd">' + vc.uphone + '</li>' : '') + (vc.uemail ? '<li class="user_email even"><a href="mailto:' + vc.uemail + '">' + vc.uemail + '</a></li>' : '') + (vc.usite ? '<li class="user_site odd"><a href="' + vc.usite + '" target="_blank">' + vc.usite + '</a></li>' : '') : '<li class="text odd first">' + vc.text + '</li>') + '</ul>' ).show(); } if (!window.setColorPicker) { function setColorPicker(id_picker) { jQuery('#'+id_picker).click(function (e) { "use strict"; iColorShow(null, jQuery(this), function(fld, clr) { "use strict"; fld.css('backgroundColor', clr).val(clr); }); }); /* jQuery('#'+id_picker).ColorPicker({ color: jQuery('#'+id_picker).val(), onShow: function (colpkr) { jQuery(colpkr).fadeIn(500); return false; }, onHide: function (colpkr) { jQuery(colpkr).fadeOut(500); return false; }, onChange: function (hsb, hex, rgb) { jQuery('#'+id_picker).css('backgroundColor', '#' + hex).val('#' + hex); } }); */ } } </script> <?php }
</ul><!-- .comments_list --> <?php if (!comments_open() && get_comments_number() != 0 && post_type_supports(get_post_type(), 'comments')) { ?> <p class="no_comments"><?php _e('Comments are closed.', 'themerex'); ?> </p> <?php } ?> </section><!-- .comments --> <?php } if (comments_open()) { themerex_enqueue_script('jquery-autosize', themerex_get_file_url('/js/jquery.autosize.js'), array('jquery'), null, true); ?> <section class="formValid"> <h3><?php _e('Leave a Reply', 'themerex'); ?> </h3> <div class="commForm commentsForm"> <?php $commenter = wp_get_current_commenter(); $req = get_option('require_name_email'); $aria_req = $req ? ' aria-required="true"' : ''; $comments_args = array('id_submit' => 'send_comment', 'label_submit' => __('Post Comment', 'themerex'), 'title_reply' => '', 'logged_in_as' => '', 'comment_notes_before' => '', 'comment_notes_after' => '', 'comment_field' => '<div class="message">' . '<textarea placeholder="' . __('Message', 'themerex') . '" id="comment" name="comment" class="textAreaSize" aria-required="true"></textarea>' . '</div>' . '<div class="enterBlock clr">' . '<div class="squareButton comm sc_button_size_big accent_2 big"><a class="enter" href="#">' . __('Post comment', 'themerex') . '</a></div>' . '</div>', 'fields' => apply_filters('comment_form_default_fields', array('author' => '<div class="columnsWrap"><div class="columns1_2">' . '<input placeholder="' . __('Name', 'themerex') . '" id="author" name="author" type="text" value="' . esc_attr(isset($commenter['comment_author']) ? $commenter['comment_author'] : '') . '" size="30"' . esc_attr($aria_req) . ' />' . '</div>', 'email' => '<div class="columns1_2">' . '<input placeholder="' . __('Email', 'themerex') . '" id="email" name="email" type="text" value="' . esc_attr(isset($commenter['comment_author_email']) ? $commenter['comment_author_email'] : '') . '" size="30"' . esc_attr($aria_req) . ' />' . '</div></div>'))); comment_form($comments_args);
if (!$favicon && file_exists(themerex_get_file_dir('favicon.ico'))) { $favicon = themerex_get_file_url('favicon.ico'); } } if ($favicon) { ?> <link rel="icon" type="image/x-icon" href="<?php echo esc_attr($favicon); ?> " /> <?php } ?> <!--[if lt IE 9]> <script src="<?php echo themerex_get_file_url('/js/html5.js'); ?> " type="text/javascript"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php $class = $style = ''; if ($body_style == 'boxed' || get_custom_option('load_bg_image') == 'always') { $customizer = get_theme_option('show_theme_customizer') == 'yes'; if ($customizer && ($img = (int) getValueGPC('bg_image', 0)) > 0) { $class = 'bg_image_' . $img; } else {
<?php //====================================== Editor area ======================================== if ($post_data['post_edit_enable']) { require_once themerex_get_file_dir('/admin/theme-options.php'); wp_register_script('wp-color-picker', '/wp-admin/js/color-picker.min.js', array('jquery'), '1.0', true); themerex_enqueue_style('fontello-admin', themerex_get_file_url('/admin/css/fontello/css/fontello-admin.css'), array(), null); themerex_options_load_scripts(); if (array_key_exists('post_type', $post_data)) { themerex_options_prepare_js($post_data['post_type'] == 'page' ? 'page' : 'post'); } themerex_shortcodes_load_scripts(); themerex_shortcodes_prepare_js(); ?> <div id="frontend_editor"> <div id="frontend_editor_inner"> <form method="post"> <label id="frontend_editor_post_title_label" for="frontend_editor_post_title"><?php _e('Title', 'themerex'); ?> </label> <input type="text" name="frontend_editor_post_title" id="frontend_editor_post_title" value="<?php echo esc_attr($post_data['post_title']); ?> " /> <?php $ajax_nonce = wp_create_nonce('themerex_editor_nonce'); $ajax_url = admin_url('admin-ajax.php'); wp_editor($post_data['post_content_original'], 'frontend_editor_post_content', array('wpautop' => true, 'textarea_rows' => 16)); ?>
function themerex_shortcodes_load_scripts() { themerex_enqueue_script('themerex-shortcodes-script', themerex_get_file_url('/shortcodes/shortcodes_admin.js'), array('jquery'), null, true); themerex_enqueue_script('themerex-selection-script', themerex_get_file_url('/js/jquery.selection.js'), array('jquery'), null, true); }
// Uncomment this section if you want filter related posts on post formats if ($post_data['post_format'] != '' && $post_data['post_format'] != 'standard') { $args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-' . $post_data['post_format'])); } $args = addSortOrderInQuery($args, get_custom_option('post_related_sort'), get_custom_option('post_related_order')); $recent_posts = wp_get_recent_posts($args, OBJECT); if (is_array($recent_posts) && count($recent_posts) > 0) { if (get_custom_option("post_related_style") == 'yes') { // todo: magnific & pretty // magnific & pretty themerex_enqueue_style('magnific-style', themerex_get_file_url('/js/magnific-popup/magnific-popup.css'), array(), null); themerex_enqueue_script('magnific', themerex_get_file_url('/js/magnific-popup/jquery.magnific-popup.min.js'), array('jquery'), null, true); // Load PrettyPhoto if it selected in Theme Options if (get_theme_option('popup_engine') == 'pretty') { themerex_enqueue_style('prettyphoto-style', themerex_get_file_url('/js/prettyphoto/css/prettyPhoto.css'), array(), null); themerex_enqueue_script('prettyphoto', themerex_get_file_url('/js/prettyphoto/jquery.prettyPhoto.min.js'), array('jquery'), 'no-compose', true); } } ?> <section class="relatedWrap<?php echo get_custom_option("show_post_comments") == 'yes' ? ' hrShadow' : ''; ?> "> <h3><?php _e('Recomended Posts', 'themerex'); ?> </h3> <div class="relatedPostWrap"> <div class="columnsWrap <?php echo get_custom_option("post_related_style") == 'no' ? ' no_indent_style columnsFloat' : ' indent_style'; ?>
<?php //====================================== Editor area ======================================== if ($post_data['post_edit_enable']) { require_once themerex_get_file_dir('/admin/theme-options.php'); wp_register_script('wp-color-picker', get_site_url() . '/wp-admin/js/color-picker.min.js', array('jquery'), '1.0', true); themerex_enqueue_style('fontello-admin', themerex_get_file_url('/admin/css/fontello/css/fontello-admin.css'), array(), null); themerex_enqueue_style('frontend-editor-style', themerex_get_file_url('/js/editor/_editor.css'), array('main-style'), null); themerex_enqueue_script('frontend-editor', themerex_get_file_url('/js/editor/_editor.js'), array(), null, true); themerex_options_load_scripts(); themerex_options_prepare_js($post_data['post_type'] == 'page' ? 'page' : 'post'); themerex_shortcodes_load_scripts(); themerex_shortcodes_prepare_js(); ?> <div id="frontend_editor"> <div id="frontend_editor_inner"> <form method="post"> <label id="frontend_editor_post_title_label" for="frontend_editor_post_title"><?php _e('Title', 'themerex'); ?> </label> <input type="text" name="frontend_editor_post_title" id="frontend_editor_post_title" value="<?php echo esc_attr($post_data['post_title']); ?> " /> <?php $ajax_nonce = wp_create_nonce('themerex_editor_nonce'); $ajax_url = admin_url('admin-ajax.php'); wp_editor($post_data['post_content_original'], 'frontend_editor_post_content', array('wpautop' => true, 'textarea_rows' => 16)); ?> <label id="frontend_editor_post_excerpt_label" for="frontend_editor_post_excerpt"><?php
function theme_skin_add_scripts_classter() { if (file_exists(themerex_get_file_dir('/skins/general/general.js'))) { themerex_enqueue_script('theme-skin-script', themerex_get_file_url('/skins/general/general.js'), array('main-style'), null); } }
<span class="co_label"><?php _e('Background image:', 'themerex'); ?> </span> <div id="co_bg_images_list"> <?php for ($i = 1; $i <= 6; $i++) { ?> <a href="#" id="image_<?php echo $i; ?> " class="co_image_wrapper<?php echo $bg_image == $i ? ' current' : ''; ?> "><img src="<?php echo themerex_get_file_url('/images/bg/image_' . $i . '_thumb2.jpg'); ?> " width="48" height="28" alt="" /></a> <?php } ?> </div> </div> </form> <script type="text/javascript"> jQuery(document).ready(function(){ // Theme & Background color jQuery('#co_theme_color').css('backgroundColor', '<?php echo $theme_color; ?> ');
function frontend_scripts() { themerex_enqueue_style('custom-menu-style', themerex_get_file_url('/admin/tools/custom_menu/custom_menu.css'), array(), null); themerex_enqueue_script('custom-menu-script', themerex_get_file_url('/admin/tools/custom_menu/custom_menu.js'), array('jquery'), null, true); }
function themerex_scripts() { global $concatenate_scripts; $concatenate_scripts = get_theme_option('compose_scripts') == 'yes'; //Enqueue styles $fonts = getThemeFontsList(false); $font = get_custom_option('theme_font'); if (isset($fonts[$font])) { $theme_font_link = !empty($fonts[$font]['link']) ? $fonts[$font]['link'] : str_replace(' ', '+', $font) . ':100,100italic,300,300italic,400,400italic,500,500italic,700,700italic,900,900italic'; } else { $theme_font_link = "Roboto:100,100italic,300,300italic,400,400italic,500,500italic,700,700italic,900,900italic"; } // Must be loaded before main stylesheet wp_enqueue_style('theme-font', 'http://fonts.googleapis.com/css?family=' . $theme_font_link . '&subset=latin,cyrillic-ext,latin-ext,cyrillic', array(), null); wp_enqueue_style('fontello', get_template_directory_uri() . '/includes/fontello/css/fontello.css', array(), null); wp_enqueue_style('animation', get_template_directory_uri() . '/includes/fontello/css/animation.css', array(), null); // Main stylesheet wp_enqueue_style('main-style', get_stylesheet_uri(), array(), null); // Shortcodes wp_enqueue_style('shortcodes', get_template_directory_uri() . '/includes/shortcodes/shortcodes.css', array('main-style'), null); // Customizer wp_add_inline_style('shortcodes', prepareThemeCustomStyles()); // Responsive if (get_theme_option('responsive_layouts') == 'yes') { wp_enqueue_style('responsive', get_template_directory_uri() . '/css/responsive.css', array('main-style'), null); } // WooCommerce customizer if (function_exists('is_woocommerce')) { wp_enqueue_style('woo-style', get_template_directory_uri() . '/css/woo-style.css', array('main-style'), null); } // BuddyPress customizer if (class_exists('BuddyPress')) { wp_enqueue_style('buddy-style', get_template_directory_uri() . '/css/buddy-style.css', array('main-style'), null); } // BB Press customizer if (class_exists('bbPress')) { wp_enqueue_style('bbpress-style', get_template_directory_uri() . '/css/bbpress-style.css', array('main-style'), null); } // Load scripts wp_enqueue_script('jquery', false, array(), null, true); wp_enqueue_script('underscore', false, array(), null, true); wp_enqueue_script('jquery-cookie', get_template_directory_uri() . '/js/jquery.cookie.js', array('jquery'), null, true); wp_enqueue_script('jquery-easing', get_template_directory_uri() . '/js/jquery.easing.js', array('jquery'), null, true); wp_enqueue_script('jquery-autosize', get_template_directory_uri() . '/js/jquery.autosize.js', array('jquery'), null, true); wp_enqueue_script('jquery-ui-core', false, array(), null, true); wp_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true); wp_enqueue_script('jquery-effects-core', false, array(), null, true); wp_enqueue_script('jquery-effects-fade', false, array('jquery', 'jquery-effects-core'), null, true); wp_enqueue_script('superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery'), null, true); wp_enqueue_script('_utils', get_template_directory_uri() . '/js/_utils.js', array(), null, true); wp_enqueue_script('_front', get_template_directory_uri() . '/js/_front.js', array(), null, true); wp_enqueue_script('shortcodes-init', get_template_directory_uri() . '/includes/shortcodes/shortcodes_init.js', array(), null, true); wp_enqueue_style('magnific-style', get_template_directory_uri() . '/js/magnific-popup/magnific-popup.css', array(), null); wp_enqueue_script('magnific', get_template_directory_uri() . '/js/magnific-popup/jquery.magnific-popup.min.js', array('jquery'), null, true); wp_enqueue_script('flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'), null, true); wp_enqueue_style('swiperslider-style', get_template_directory_uri() . '/js/swiper/idangerous.swiper.css', array(), null); wp_enqueue_script('swiperslider', get_template_directory_uri() . '/js/swiper/idangerous.swiper.js', array('jquery'), null, true); wp_enqueue_style('swiperslider-scrollbar-style', get_template_directory_uri() . '/js/swiper/idangerous.swiper.scrollbar.css', array(), null); wp_enqueue_script('swiperslider-scrollbar', get_template_directory_uri() . '/js/swiper/idangerous.swiper.scrollbar-2.1.js', array('jquery'), null, true); // wp_enqueue_style( 'swiperslider-3dflow-style', get_template_directory_uri() . '/js/swiper/idangerous.swiper.3dflow.css', array(), null ); // wp_enqueue_script( 'swiperslider-3dflow', get_template_directory_uri() . '/js/swiper/idangerous.swiper.3dflow.js', array('jquery'), null, true ); global $wp_styles; $wp_styles->done[] = 'mediaelement'; $wp_styles->done[] = 'wp-mediaelement'; wp_enqueue_style('mediaplayer-style', themerex_get_file_url('/js/mediaplayer/mediaplayer.css'), array(), null); // WP already include Media Element Library if (floatval(get_bloginfo('version')) < "3.6") { wp_enqueue_script('mediaplayer', themerex_get_file_url('/js/mediaplayer/mediaelement.min.js'), array(), null, true); } else { wp_enqueue_script('mediaelement'); } //wp_enqueue_style( 'scrollbar-style', get_template_directory_uri() . '/js/scroll/scroll.css', array(), null ); //wp_enqueue_script( 'scrollbar', get_template_directory_uri() . '/js/scroll/jquery.mCustomScrollbar.concat.min.js', array(), null, true ); wp_enqueue_script('hover-dir', get_template_directory_uri() . '/js/hover/jquery.hoverdir.js', array(), null, true); wp_enqueue_script('hover-intent', get_template_directory_uri() . '/js/hover/hoverIntent.js', array(), null, true); wp_enqueue_script('isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js', array(), null, true); // wp_enqueue_script( 'elastislide-modernizr', get_template_directory_uri() . '/js/elastislide/modernizr.custom.17475.js', array(), null, true ); // wp_enqueue_script( 'elastislide-querypp', get_template_directory_uri() . '/js/elastislide/jquerypp.custom.js', array(), null, true ); // wp_enqueue_script( 'elastislide', get_template_directory_uri() . '/js/elastislide/jquery.elastislide.js', array(), null, true ); //wp_enqueue_script( 'smooth-scroll', get_template_directory_uri() . '/js/SmoothScroll.js', array(), null, true ); wp_enqueue_script('diagram-chart', get_template_directory_uri() . '/js/diagram/chart.min.js', array(), null, true); wp_enqueue_script('diagram-raphael', get_template_directory_uri() . '/js/diagram/diagram.raphael.js', array(), null, true); if (is_singular() && get_theme_option('show_share') == 'yes') { wp_enqueue_script('social-share', get_template_directory_uri() . '/js/social/social-share.js', array(), null, true); } if (get_custom_option('show_login') == 'yes') { wp_enqueue_script('form-login', get_template_directory_uri() . '/js/_form_login.js', array(), null, true); } if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply', false, array(), null, true); wp_enqueue_script('form-comments', get_template_directory_uri() . '/js/_form_comments.js', array(), null, true); } if (get_theme_option('show_theme_customizer') == 'yes') { wp_enqueue_script('jquery-ui-draggable', false, array('jquery', 'jquery-ui-core'), null, true); wp_enqueue_script('_customizer', get_template_directory_uri() . '/js/_customizer.js', array(), null, true); } wp_enqueue_style('messages-style', get_template_directory_uri() . '/js/messages/_messages.css', array('main-style'), null); wp_enqueue_script('messages', get_template_directory_uri() . '/js/messages/_messages.js', array(), null, true); wp_enqueue_script('knob', get_template_directory_uri() . '/js/jquery.knob.js', array(), null, true); wp_enqueue_script('jquery-ui-slider'); if (function_exists('awesome_weather_wp_head')) { wp_deregister_style('awesome-weather'); } }
function shortcodes_vc_scripts() { // Include CSS themerex_enqueue_style('shortcodes_vc-style', themerex_get_file_url('/shortcodes/shortcodes_vc.css'), array(), null); // Include JS themerex_enqueue_script('shortcodes_vc', themerex_get_file_url('/shortcodes/shortcodes_vc.js'), array(), null, true); }
function buildGalleryTag($photos, $w, $h, $zoom = false, $link = '') { $engine = get_custom_option('substitute_slider_engine'); $gallery_text = ''; $gallery_items_in_bg = $engine != 'chop'; // todo: magnific & pretty // magnific & pretty themerex_enqueue_style('magnific-style', themerex_get_file_url('/js/magnific-popup/magnific-popup.css'), array(), null); themerex_enqueue_script('magnific', themerex_get_file_url('/js/magnific-popup/jquery.magnific-popup.min.js'), array('jquery'), null, true); // Load PrettyPhoto if it selected in Theme Options if (get_theme_option('popup_engine') == 'pretty') { themerex_enqueue_style('prettyphoto-style', themerex_get_file_url('/js/prettyphoto/css/prettyPhoto.css'), array(), null); themerex_enqueue_script('prettyphoto', themerex_get_file_url('/js/prettyphoto/jquery.prettyPhoto.min.js'), array('jquery'), 'no-compose', true); } // todo: sliders themerex_enqueue_style('swiperslider-style', themerex_get_file_url('/js/swiper/idangerous.swiper.css'), array(), null); themerex_enqueue_style('swiperslider-scrollbar-style', themerex_get_file_url('/js/swiper/idangerous.swiper.scrollbar.css'), array(), null); themerex_enqueue_script('swiperslider', themerex_get_file_url('/js/swiper/idangerous.swiper-2.7.js'), array('jquery'), null, true); themerex_enqueue_script('swiperslider-scrollbar', themerex_get_file_url('/js/swiper/idangerous.swiper.scrollbar-2.4.js'), array('jquery'), null, true); themerex_enqueue_script('flexslider', themerex_get_file_url('/js/jquery.flexslider.min.js'), array('jquery'), null, true); if (count($photos) > 0) { if ($engine == 'chop') { $effects2D = array("vertical", "horizontal", "half", "multi"); $effects3D = array("3DBlocks", "3DFlips"); $chop_effect = $effects2D[min(3, mt_rand(0, 3))] . '|' . $effects3D[min(1, mt_rand(0, 1))]; } $id = "sc_slider_" . str_replace('.', '', mt_rand()); $interval = mt_rand(5000, 10000); $gallery_text = ' <div id="' . $id . '" class="sc_slider sc_slider_' . $engine . ($engine == 'swiper' ? ' swiper-slider-container' : '') . ' sc_slider_controls"' . (!empty($w) && themerex_strpos($w, '%') === false ? ' data-old-width="' . $w . '"' : '') . (!empty($h) && themerex_strpos($h, '%') === false ? ' data-old-height="' . $h . '"' : '') . ($engine == 'chop' ? ' data-effect="' . $chop_effect . '"' : '') . ' data-interval="' . $interval . '"' . '> <ul class="slides' . ($engine == 'swiper' ? ' swiper-wrapper' : '') . '"' . ($engine == 'swiper' ? ' style="height:' . $h . 'px;"' : '') . '> '; $numSlide = 0; foreach ($photos as $photo) { $numSlide++; if ($gallery_items_in_bg) { $photo_min = getResizedImageURL($photo, $w, $h); $gallery_text .= '<li' . ' class="' . $engine . '-slide"' . ' style="background-image:url(' . $photo_min . ');' . (!empty($w) ? 'width:' . $w . (themerex_strpos($w, '%') !== false ? '' : 'px') . ';' : '') . (!empty($h) ? 'height:' . $h . (themerex_strpos($h, '%') !== false ? '' : 'px') . ';' : '') . '">' . ($zoom ? '<a href="' . $photo . '"></a>' : ($link ? '<a href="' . $link . '"></a>' : '')) . '</li>'; } else { $photo_min = getResizedImageTag($photo, $w, $h); $gallery_text .= '<li' . ' class="' . $engine . '-slide' . ($engine == 'chop' && $numSlide == 1 ? ' cs-activeSlide' : '') . '"' . ' style="' . ($engine == 'chop' && $numSlide == 1 ? 'display:block;' : '') . (!empty($w) ? 'width:' . $w . (themerex_strpos($w, '%') !== false ? '' : 'px') . ';' : '') . (!empty($h) ? 'height:' . $h . (themerex_strpos($h, '%') !== false ? '' : 'px') . ';' : '') . '">' . ($zoom ? '<a href="' . $photo . '">' . $photo_min . '</a>' : (!empty($link) ? '<a href="' . $link . '">' . $photo_min . '</a>' : $photo_min)) . '</li>'; } } $gallery_text .= '</ul>'; if ($engine == 'swiper' || $engine == 'chop') { $gallery_text .= ' <ul class="flex-direction-nav"> <li><a class="flex-prev" href="#"></a></li> <li><a class="flex-next" href="#"></a></li> </ul> '; } $gallery_text .= '</div>'; } return $gallery_text; }