/** * * put rev slider on the page. * the data can be slider ID or slider alias. */ function putRevSlider($data, $putIn = "") { $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $includesGlobally = RevSliderFunctions::getVal($arrValues, "includes_globally", "on"); $strPutIn = RevSliderFunctions::getVal($arrValues, "pages_for_includes"); $isPutIn = RevSliderOutput::isPutIn($strPutIn, true); if ($isPutIn == false && $includesGlobally == "off") { $output = new RevSliderOutput(); $option1Name = __("Include RevSlider libraries globally (all pages/posts)", 'revslider'); $option2Name = __("Pages to include RevSlider libraries", 'revslider'); $output->putErrorMessage(__("If you want to use the PHP function \"putRevSlider\" in your code please make sure to check \" ", 'revslider') . $option1Name . __(" \" in the backend's \"General Settings\" (top right panel). <br> <br> Or add the current page to the \"", 'revslider') . $option2Name . __("\" option box.", 'revslider')); return false; } ob_start(); $slider = RevSliderOutput::putSlider($data, $putIn); $content = ob_get_contents(); ob_clean(); ob_end_clean(); if (is_object($slider)) { $disable_on_mobile = @$slider->getParam("disable_on_mobile", "off"); // Do not output Slider if we are on mobile if ($disable_on_mobile == 'on') { $mobile = strstr($_SERVER['HTTP_USER_AGENT'], 'Android') || strstr($_SERVER['HTTP_USER_AGENT'], 'webOS') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'Windows Phone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad') || wp_is_mobile() ? true : false; if ($mobile) { return false; } } } echo $content; }
/** * * javascript output to footer */ public static function putJavascript() { $urlPlugin = RS_PLUGIN_URL . "public/assets/"; $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $js_defer = RevSliderBase::getVar($arrValues, 'js_defer', 'off'); if ($js_defer != 'off') { $js_defer = 'defer="defer"'; } else { $js_defer = ''; } ?> <script type='text/javascript' <?php echo $js_defer; ?> src='<?php echo $urlPlugin; ?> js/jquery.themepunch.tools.min.js?rev=<?php echo RevSliderGlobals::SLIDER_REVISION; ?> '></script> <script type='text/javascript' <?php echo $js_defer; ?> src='<?php echo $urlPlugin; ?> js/jquery.themepunch.revolution.min.js?rev=<?php echo RevSliderGlobals::SLIDER_REVISION; ?> '></script> <?php }
/** * add notices from ThemePunch * @since: 4.6.8 */ public function add_notices() { $operations = new RevSliderOperations(); $general_settings = $operations->getGeneralSettingsValues(); //check permissions here if (!current_user_can('administrator')) { return true; } $enable_newschannel = RevSliderBase::getVar($general_settings, 'enable_newschannel', 'on'); $enable_newschannel = apply_filters('revslider_set_notifications', $enable_newschannel); if ($enable_newschannel == 'on') { $nonce = wp_create_nonce("revslider_actions"); $notices = get_option('revslider-notices', false); if (!empty($notices) && is_array($notices)) { global $revslider_screens; $notices_discarded = get_option('revslider-notices-dc', array()); $screen = get_current_screen(); foreach ($notices as $notice) { if ($notice->is_global !== true && !in_array($screen->id, $revslider_screens)) { continue; } //check if global or just on plugin related pages if (!in_array($notice->code, $notices_discarded) && version_compare($notice->version, GlobalsRevSlider::SLIDER_REVISION, '>=')) { $text = '<div style="text-align:right;vertical-align:middle;display:table-cell; min-width:225px;border-left:1px solid #ddd; padding-left:15px;"><a href="javascript:void(0);" class="rs-notices-button rs-notice-' . esc_attr($notice->code) . '">' . __('Close & don\'t show again<b>X</b>', 'revslider') . '</a></div>'; if ($notice->disable == true) { $text = ''; } ?> <style> .rs-notices-button { color:#999; text-decoration: none !important; font-size:14px;font-weight: 400;} .rs-notices-button:hover { color:#3498DB !important;} .rs-notices-button b { font-weight:800; vertical-align:bottom;line-height:15px;font-size:10px;margin-left:10px;margin-right:10px;border:2px solid #999; display:inline-block; width:15px;height:15px; text-align: center; border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%;} .rs-notices-button:hover b { border-color:#3498DB;} </style> <div class="<?php echo $notice->color; ?> below-h2 rs-update-notice-wrap" id="message" style="clear:both;display: block;position:relative;margin:35px 20px 25px 0px"><div style="display:table;width:100%;"><div style="vertical-align:middle;display:table-cell;min-width:100%;padding-right:15px;"><?php echo $notice->text; ?> </div><?php echo $text; ?> </div></div> <?php } } ?> <script type="text/javascript"> jQuery('.rs-notices-button').click(function(){ var notice_id = jQuery(this).attr('class').replace('rs-notices-button', '').replace('rs-notice-', ''); var objData = { action:"revslider_ajax_action", client_action: 'dismiss_dynamic_notice', nonce:'<?php echo $nonce; ?> ', data:{'id':notice_id} }; jQuery.ajax({ type:"post", url:ajaxurl, dataType: 'json', data:objData }); jQuery(this).closest('.rs-update-notice-wrap').slideUp(200); }); </script> <?php } } }
/** * view the estimated speed of the Slider * @since: 5.0 */ public static function get_slider_speed($sliderID) { //$data = wp_get_attachment_metadata($cur_img_id); ob_start(); $total_size = 0; $do_ssl = is_ssl() ? 'http:' : 'https:'; $slider = new RevSliderSlider(); $slider->initByID($sliderID); $slides = $slider->getSlidesForExport(); $static_slides = $slider->getStaticSlideForExport(); if (!empty($static_slides) && is_array($static_slides)) { foreach ($static_slides as $s_slide) { $slides[] = $s_slide; } } $used_images = array(); $used_videos = array(); $used_captions = array(); $using_kenburns = false; $using_parallax = false; $using_carousel = false; $using_navigation = false; $using_videos = false; $using_actions = false; $using_layeranim = false; $img_size = 0; $video_size = 0; $slide_counter = 0; $firstslide_size = 0; $smartslide_size = 0; if ($slider->getParam("use_parallax", "off") == 'on') { $using_parallax = true; } if ($slider->getParam("slider-type", "standard") == 'carousel') { $using_carousel = true; } $enable_arrows = $slider->getParam('enable_arrows', 'off'); $enable_bullets = $slider->getParam('enable_bullets', 'off'); $enable_tabs = $slider->getParam('enable_tabs', 'off'); $enable_thumbnails = $slider->getParam('enable_thumbnails', 'off'); if ($enable_arrows == 'on' || $enable_bullets == 'on' || $enable_tabs == 'on' || $enable_thumbnails == 'on') { $using_navigation = true; } if (!empty($slides) && count($slides) > 0) { foreach ($slides as $key => $slide) { if (isset($slide['params']['state']) && $slide['params']['state'] != 'published') { continue; } if (!isset($slide['id'])) { continue; } $slide_counter++; $slide_id = $slide['id']; if (isset($slide['params']['kenburn_effect']) && $slide['params']['kenburn_effect'] == 'on') { $using_kenburns = true; } if (!isset($slide['params']['image_source_type'])) { $slide['params']['image_source_type'] = 'full'; } if (isset($slide['params']['image']) && $slide['params']['image'] != '') { //add infos of image to an array $infos = array(); $urlImage = false; switch ($slide['params']['background_type']) { case 'streamyoutube': case 'streaminstagram': case 'streamvimeo': case 'youtube': case 'vimeo': $using_videos = true; break; } if (isset($slide['params']['image_id'])) { $cur_img_id = $slide['params']['image_id']; //get image sizes by ID $urlImage = wp_get_attachment_image_src($slide['params']['image_id'], $slide['params']['image_source_type']); } if ($urlImage === false) { $cur_img_id = RevSliderFunctionsWP::get_image_id_by_url($slide['params']['image']); if ($cur_img_id !== false) { $urlImage = wp_get_attachment_image_src($cur_img_id, $slide['params']['image_source_type']); } } if ($urlImage !== false) { $infos['id'] = $cur_img_id; $file = get_attached_file($cur_img_id); $infos['info'] = pathinfo($file); if (file_exists($file)) { $infos['size'] = filesize($file); $infos['size-format'] = size_format($infos['size'], 2); $img_size += $infos['size']; if ($slide_counter == 1) { $firstslide_size += $infos['size']; } if ($slide_counter == 1 || $slide_counter == 2 || $slide_counter == count($slides)) { $smartslide_size += $infos['size']; } } else { $infos['id'] = false; } } else { $infos['id'] = 'external'; } if (strpos($slide_id, 'static_') !== false) { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=static_' . $sliderID); } else { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=' . $slide_id); } $used_images[$slide['params']['image']] = $infos; } if (isset($slide['layers']) && !empty($slide['layers']) && count($slide['layers']) > 0) { $using_layeranim = true; foreach ($slide['layers'] as $lKey => $layer) { switch ($layer['type']) { case 'image': $infos = array(); if (isset($layer['image_url']) && trim($layer['image_url']) != '') { $cur_img_id = RevSliderFunctionsWP::get_image_id_by_url($layer['image_url']); if ($cur_img_id !== false) { if (!isset($layer['layer-image-size']) || $layer['layer-image-size'] == 'auto') { $layer['layer-image-size'] = $slide['params']['image_source_type']; } $urlImage = wp_get_attachment_image_src($cur_img_id, $layer['layer-image-size']); if ($urlImage !== false) { $infos['id'] = $cur_img_id; $file = get_attached_file($cur_img_id); $infos['info'] = pathinfo($file); if (file_exists($file)) { $infos['size'] = filesize($file); $infos['size-format'] = size_format($infos['size'], 2); $img_size += $infos['size']; if ($slide_counter == 1) { $firstslide_size += $infos['size']; } if ($slide_counter == 1 || $slide_counter == 2 || $slide_counter == count($slides)) { $smartslide_size += $infos['size']; } } else { $infos['id'] = false; } } else { $infos['id'] = 'external'; } } else { $infos['id'] = 'external'; } if (strpos($slide_id, 'static_') !== false) { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=static_' . $sliderID); } else { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=' . $slide_id); } $used_images[$layer['image_url']] = $infos; //image_url if image caption } break; case 'video': $using_videos = true; //get cover image if existing $infos = array(); $poster_img = array(); if (isset($layer['video_data']) && isset($layer['video_data']->urlPoster)) { $poster_img[] = $layer['video_data']->urlPoster; } if (isset($layer['video_image_url']) && isset($layer['video_image_url'])) { $poster_img[] = $layer['video_image_url']; } if (!empty($poster_img)) { foreach ($poster_img as $img) { if (trim($img) == '') { continue; } $cur_img_id = RevSliderFunctionsWP::get_image_id_by_url($img); if ($cur_img_id !== false) { if (!isset($layer['layer-image-size']) || $layer['layer-image-size'] == 'auto') { $layer['layer-image-size'] = $slide['params']['image_source_type']; } $urlImage = wp_get_attachment_image_src($cur_img_id, $layer['layer-image-size']); if ($urlImage !== false) { $infos['id'] = $cur_img_id; $file = get_attached_file($cur_img_id); $infos['info'] = pathinfo($file); if (file_exists($file)) { $infos['size'] = filesize($file); $infos['size-format'] = size_format($infos['size'], 2); $img_size += $infos['size']; if ($slide_counter == 1) { $firstslide_size += $infos['size']; } if ($slide_counter == 1 || $slide_counter == 2 || $slide_counter == count($slides)) { $smartslide_size += $infos['size']; } } else { $infos['id'] = false; } } else { $infos['id'] = 'external'; } } else { $infos['id'] = 'external'; } if (strpos($slide_id, 'static_') !== false) { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=static_' . $sliderID); } else { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=' . $slide_id); } $used_images[$img] = $infos; //image_url if image caption } } $infos = array(); if (isset($layer['video_type'])) { //add videos and try to get video size if (isset($layer['video_data'])) { $video_arr = array(); $max_video_size = 0; if (strpos($slide_id, 'static_') !== false) { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=static_' . $sliderID); } else { $infos['url'] = RevSliderBaseAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDE, 'id=' . $slide_id); } switch ($layer['video_type']) { case 'html5': if (isset($layer['video_data']->urlMp4) && !empty($layer['video_data']->urlMp4)) { $video_arr['mp4'] = $layer['video_data']->urlMp4; } if (isset($layer['video_data']->urlWebm) && !empty($layer['video_data']->urlWebm)) { $video_arr['webm'] = $layer['video_data']->urlWebm; } if (isset($layer['video_data']->urlOgv) && !empty($layer['video_data']->urlOgv)) { $video_arr['mp4'] = $layer['video_data']->urlOgv; } if (!empty($video_arr)) { foreach ($video_arr as $type => $url) { $cur_id = RevSliderFunctionsWP::get_image_id_by_url($url); if ($cur_id !== false) { $infos['id'] = $cur_id; $file = get_attached_file($cur_id); $infos['info'] = pathinfo($file); if (file_exists($file)) { $infos['size'] = filesize($file); $infos['size-format'] = size_format($infos['size'], 2); if ($infos['size'] > $max_video_size) { $max_video_size = $infos['size']; } //add only the largest video of the three here as each browser loads only one file and we can add here the biggest } else { $infos['id'] = 'external'; } } else { $infos['id'] = 'external'; } $used_videos[$url] = $infos; } $video_size += $max_video_size; } break; case 'youtube': $infos['id'] = 'external'; if (!isset($layer['video_data']->id) || empty($layer['video_data']->id)) { continue; } $used_videos[$do_ssl . '//www.youtube.com/watch?v=' . $layer['video_data']->id] = $infos; break; case 'vimeo': if (!isset($layer['video_data']->id) || empty($layer['video_data']->id)) { continue; } $infos['id'] = 'external'; $used_videos[$do_ssl . '//vimeo.com/' . $layer['video_data']->id] = $infos; break; } } } break; } //check captions for actions if (isset($layer['layer_action']) && !empty($layer['layer_action'])) { $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($layer['layer_action'], 'action', array())); $a_link_type = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($layer['layer_action'], 'link_type', array())); if (!empty($a_action)) { foreach ($a_action as $num => $action) { if ($using_actions == true) { break; } if ($action !== 'link') { $using_actions = true; } else { //check if jQuery or a tag if ($a_link_type[$num] == 'jquery') { $using_actions = true; } } } } } if (isset($layer['style']) && $layer['style'] != '') { $used_captions[$layer['style']] = true; } } } } } $total_size += $img_size; $img_counter = 0; $issues = ""; //$total_size += $video_size; ?> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> <!-- HEADER OF MONITORING --> <span class="tp-monitor-performance-title"><?php echo __("Overall Slider Performance", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-performace-wrap"> <span id="image-performace-bar" style="width: %overall_performance%%" class="tp-monitor-performance-bar mo-%overall_color%-col"></span> <span class="tp-monitor-slow"><?php echo __("Slow", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-ok"><?php echo __("Ok", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fast"><?php echo __("Fast", REVSLIDER_TEXTDOMAIN); ?> </span> </span> <span class="tp-clearfix" style="height:50px"></span> <span class="tp-monitor-speed-table tp-monitor-single-speed"> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed UMTS:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="umts-speed">%umtsspeed-single%</span> </span> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed DSL:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="dsl-speed">%dslspeed-single%</span> </span> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed T1:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="t1-speed">%t1speed-single%</span> </span> </span> <span class="tp-monitor-speed-table tp-monitor-smart-speed"> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed UMTS:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="umts-speed">%umtsspeed-smart%</span> </span> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed DSL:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="dsl-speed">%dslspeed-smart%</span> </span> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed T1:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="t1-speed">%t1speed-smart%</span> </span> </span> <span class="tp-monitor-speed-table tp-monitor-all-speed"> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed UMTS:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="umts-speed">%umtsspeed-all%</span> </span> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed DSL:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="dsl-speed">%dslspeed-all%</span> </span> <span class="tp-monitor-speed-cell"> <span class="tp-monitor-smalllabel"><?php echo __("Load Speed T1:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-total-subsize" id="t1-speed">%t1speed-all%</span> </span> </span> <span class="tp-clearfix" style="height:25px"></span> <span style="float:left;width:165px"> <span class="tp-monitor-smalllabel"><?php echo __("Total Slider Size:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fullsize">%overall_size%</span> <a class="button-primary revblue tp-monitor-showdetails" data-target="#performance_overall_details" style="float:right; width:160px;vertical-align:top"><i class="eg-icon-chart-bar"></i>Show Full Statistics</a> </span> <span style="float:right; width:165px"> <span class="tp-monitor-smalllabel"><?php echo __("Preloaded Slides Size:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fullsize tp-monitor-single-speed">%firstslide_size%</span> <span class="tp-monitor-fullsize tp-monitor-smart-speed">%smartslide_size%</span> <span class="tp-monitor-fullsize tp-monitor-all-speed">%allslide_size%</span> <a class="button-primary revred tp-monitor-showdetails" data-target="#monitor-problems" style="float:right; width:160px;vertical-align:top;"><i class="eg-icon-info"></i>Show All Issues</a> </span> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> <!-- THE IMAGE PERFORMANCE MESSING --> <div id="monitor-problems" style="display:none"> <span class="tp-monitor-performance-title"><?php echo __("Need Some Attention", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-clearfix" style="height:25px"></span> <ul class="tp-monitor-list" id="monitor-problem-details" style="margin-bottom:15px;"> %issues% </ul> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> </div> <div id="performance_overall_details" style="display:none"> <!-- IMAGE LIST --> <?php if (!empty($used_images)) { ?> <!-- THE IMAGE PERFORMANCE MESSING --> <span class="tp-monitor-performance-title"><?php echo __("Image Performance", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-performace-wrap"> <span id="image-performace-bar" style="width: %image_performance%%" class="tp-monitor-performance-bar mo-%image_color%-col"></span> <span class="tp-monitor-slow"><?php echo __("Slow", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-ok"><?php echo __("Ok", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fast"><?php echo __("Fast", REVSLIDER_TEXTDOMAIN); ?> </span> </span> <span class="tp-clearfix" style="height:35px"></span> <!-- FULL SIZE OF SUBCATEGORY && SHOW/HIDE LIST --> <span style="float:left;width:40%"> <span class="tp-monitor-smalllabel"><?php echo __("Images Loaded:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-imageicon"></span> <span id="image_sub_size" class="tp-monitor-total-subsize"><?php echo size_format($img_size, 2); ?> </span> </span> <span style="float:left;width:60%; text-align:right;"> <span class="tp-monitor-showdetails" data-target="#monitor-image-details" data-open="</span><?php echo __("Hide Details", REVSLIDER_TEXTDOMAIN); ?> " data-close="</span><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> "><span class="tp-monitor-openclose"></span><span class="tp-show-inner-btn"><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> </span></span> </span> <span class="tp-clearfix" style="height:15px"></span> <!-- THE IMAGE LIST --> <ul class="tp-monitor-list" id="monitor-image-details" style="display:none;margin-bottom:15px;"> <?php foreach ($used_images as $path => $image) { $_li = '<li class="tp-monitor-listli">'; if (isset($image['size'])) { $img_counter++; if ($image['size'] < 200000) { $_li .= '<span class="tp-monitor-good"></span>'; } else { if ($image['size'] < 400000) { $_li .= '<span class="tp-monitor-well"></span>'; } else { $_li .= '<span class="tp-monitor-warning"></span>'; } } if ($image['size'] > 1000000) { $_li .= '<span class="tp-monitor-size">' . size_format($image['size'], 2) . '</span>'; } else { $_li .= '<span class="tp-monitor-size">' . size_format($image['size'], 0) . '</span>'; } } else { if ($image['id'] == 'external') { $_li .= '<span class="tp-monitor-neutral"></span><span class="tp-monitor-size">' . __('extern', REVSLIDER_TEXTDOMAIN) . '</span>'; } else { $_li .= '<span class="tp-monitor-warning"></span><span class="tp-monitor-size">' . __('missing', REVSLIDER_TEXTDOMAIN) . '</span>'; } } $_li .= '<span class="tp-monitor-file">'; if (!isset($image['info']['basename']) || empty($image['info']['basename'])) { $_li .= '...' . substr($path, -20); } else { $_li .= substr($image['info']['basename'], -20); } $_li .= '</span>'; if (isset($image['url'])) { //$_li .= ' <a href="'.$image['url'].'" target="_blank" class="tp-monitor-showimage"></a>'; $_li .= ' <a href="' . $image['url'] . '" target="_blank" class="tp-monitor-linktoslide"></a>'; } $_li .= '</li>'; echo $_li; if (isset($image['size']) && $image['size'] > 199999 || !isset($image['size']) && !$image['id'] == 'external') { $issues .= $_li; } } ?> </ul> <?php } ?> <!-- VIDEO LIST --> <?php if (!empty($used_videos)) { ?> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> <!-- THE VIDEO PERFORMANCE MESSING --> <span class="tp-monitor-performance-title"><?php echo __("Video Performance", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-performace-wrap"> <span id="video-performace-bar" style="width:50%" class="tp-monitor-performance-bar mo-neutral-col"></span> <span class="tp-monitor-slow"><?php echo __("Slow", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-ok"><?php echo __("Ok", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fast"><?php echo __("Fast", REVSLIDER_TEXTDOMAIN); ?> </span> </span> <span class="tp-clearfix" style="height:35px"></span> <!-- FULL SIZE OF SUBCATEGORY && SHOW/HIDE LIST --> <span style="float:left;width:40%; display:block"> <span class="tp-monitor-smalllabel"><?php echo __("Videos Loaded (max):", REVSLIDER_TEXTDOMAIN); ?> </span> <?php if ($video_size > 0) { ?> <span class="tp-monitor-imageicon"></span> <span id="video_sub_size" class="tp-monitor-total-subsize"><?php echo size_format($video_size, 2); ?> </span> <?php } else { ?> <span class="tp-monitor-imageicon"></span> <span class="tp-monitor-total-subsize"><?php echo __("Unknown", REVSLIDER_TEXTDOMAIN); ?> </span> <?php } ?> </span> <span style="float:left;width:60%; text-align:right;"> <span class="tp-monitor-showdetails" data-target="#monitor-video-details" data-open="</span><?php echo __("Hide Details", REVSLIDER_TEXTDOMAIN); ?> " data-close="</span><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> "><span class="tp-monitor-openclose"></span><span class="tp-show-inner-btn"><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> </span></span> </span> <span class="tp-clearfix" style="height:15px"></span> <ul class="tp-monitor-list" id="monitor-video-details" style="margin-bottom:15px;display:none;"> <?php foreach ($used_videos as $path => $video) { $_li = '<li class="tp-monitor-listli">'; if (isset($video['size'])) { $_li .= ' <span class="tp-monitor-neutral"></span>'; if ($video['size'] > 1000000) { $_li .= '<span class="tp-monitor-size">' . size_format($video['size'], 2) . '</span>'; } else { $_li .= '<span class="tp-monitor-size">' . size_format($video['size'], 0) . '</span>'; } } else { if ($video['id'] == 'external') { $_li .= '<span class="tp-monitor-neutral"></span><span class="tp-monitor-size">' . __('extern', REVSLIDER_TEXTDOMAIN) . '</span>'; } else { $_li .= '<span class="tp-monitor-warning"></span><span class="tp-monitor-size">' . __('missing', REVSLIDER_TEXTDOMAIN) . '</span>'; } } $_li .= '<span class="tp-monitor-file">'; if (!isset($video['info']['basename']) || empty($video['info']['basename'])) { $_li .= '...' . substr($path, -20); } else { $_li .= substr($video['info']['basename'], -20); } $_li .= '</span>'; if (isset($image['url'])) { $_li .= ' <a href="' . $video['url'] . '" target="_blank" class="tp-monitor-linktoslide"></a>'; } $_li .= '</li>'; if (!isset($video['size']) && !$video['id'] == 'external') { $issues .= $_li; } echo $_li; } ?> </ul> <?php } $css_size = 0; ?> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> <!-- THE IMAGE PERFORMANCE MESSING --> <span class="tp-monitor-performance-title"><?php echo __("CSS Performance", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-performace-wrap"> <span id="image-performace-bar" style="width:%css_performance%%" class="tp-monitor-performance-bar mo-%css_color%-col"></span> <span class="tp-monitor-slow"><?php echo __("Slow", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-ok"><?php echo __("Ok", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fast"><?php echo __("Fast", REVSLIDER_TEXTDOMAIN); ?> </span> </span> <span class="tp-clearfix" style="height:35px"></span> <!-- FULL SIZE OF SUBCATEGORY && SHOW/HIDE LIST --> <span style="float:left;width:40%"> <span class="tp-monitor-smalllabel"><?php echo __("CSS Loaded:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-cssicon"></span><span id="css_sub_size" class="tp-monitor-total-subsize">%css_size%</span> </span> <span style="float:left;width:60%; text-align:right;"> <span class="tp-monitor-showdetails" data-target="#monitor-CSS-details" data-open="</span><?php echo __("Hide Details", REVSLIDER_TEXTDOMAIN); ?> " data-close="</span><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> "><span class="tp-monitor-openclose"></span><span class="tp-show-inner-btn"><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> </span></span> </span> <span class="tp-clearfix" style="height:15px"></span> <?php //get css files echo '<ul class="tp-monitor-list" id="monitor-CSS-details" style="margin-bottom:15px;display:none;">'; if (file_exists(RS_PLUGIN_PATH . '/public/assets/css/settings.css')) { $fs = filesize(RS_PLUGIN_PATH . '/public/assets/css/settings.css'); $_li = '<li class="tp-monitor-listli">'; if ($fs < 60000) { $_li .= '<span class="tp-monitor-good"></span>'; } else { if ($fs < 100000) { $_li .= '<span class="tp-monitor-well"></span>'; } else { $_li .= '<span class="tp-monitor-warning"></span>'; } } $_li .= '<span class="tp-monitor-size">' . size_format($fs, 0) . '</span>'; $_li .= '<span class="tp-monitor-file">'; $_li .= __('css/settings.css', REVSLIDER_TEXTDOMAIN); $_li .= '</span>'; $_li .= '</li>'; if ($fs > 99999) { $issues .= $_li; } echo $_li; $total_size += $fs; $css_size += $fs; } $custom_css = RevSliderOperations::getStaticCss(); $custom_css = RevSliderCssParser::compress_css($custom_css); $_li = '<li class="tp-monitor-listli">'; if (strlen($custom_css) < 50000) { $_li .= '<span class="tp-monitor-good"></span>'; } else { if (strlen($custom_css) < 100000) { $_li .= '<span class="tp-monitor-well"></span>'; } else { $_li .= '<span class="tp-monitor-warning"></span>'; } } $_li .= '<span class="tp-monitor-size">' . size_format(strlen($custom_css), 0) . '</span>'; $_li .= '<span class="tp-monitor-file">'; $_li .= __('Static Styles', REVSLIDER_TEXTDOMAIN); $_li .= '</span>'; $_li .= '</li>'; if (strlen($custom_css) > 49999) { $issues .= $_li; } echo $_li; $total_size += strlen($custom_css); $css_size += strlen($custom_css); if (!empty($used_captions)) { $captions = array(); foreach ($used_captions as $class => $val) { $cap = RevSliderOperations::getCaptionsContentArray($class); if (!empty($cap)) { $captions[] = $cap; } } $styles = RevSliderCssParser::parseArrayToCss($captions, "\n"); $styles = RevSliderCssParser::compress_css($styles); $_li = '<li class="tp-monitor-listli">'; if (strlen($styles) < 50000) { $_li .= '<span class="tp-monitor-good"></span>'; } else { if (strlen($styles) < 100000) { $_li .= '<span class="tp-monitor-well"></span>'; } else { $_li .= '<span class="tp-monitor-warning"></span>'; } } $_li .= '<span class="tp-monitor-size">' . size_format(strlen($styles), 0) . '</span>'; $_li .= '<span class="tp-monitor-file">'; $_li .= __('Dynamic Styles', REVSLIDER_TEXTDOMAIN); $_li .= '</span>'; $_li .= '</li>'; if (strlen($styles) > 49999) { $issues .= $_li; } echo $_li; $total_size += strlen($styles); $css_size += strlen($styles); } echo '</ul>'; echo ' <span style="display:none" id="css-size-hidden">' . size_format($css_size, 2) . '</span>'; $js_size = 0; ?> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> <!-- THE jQuery PERFORMANCE MESSING --> <span class="tp-monitor-performance-title"><?php echo __("jQuery Performance", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-performace-wrap"> <span id="video-performace-bar" style="width:%js_performance%%" class="tp-monitor-performance-bar mo-%js_color%-col"></span> <span class="tp-monitor-slow"><?php echo __("Slow", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-ok"><?php echo __("Ok", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fast"><?php echo __("Fast", REVSLIDER_TEXTDOMAIN); ?> </span> </span> <span class="tp-clearfix" style="height:35px"></span> <!-- FULL SIZE OF SUBCATEGORY && SHOW/HIDE LIST --> <span style="float:left;width:40%; display:block"> <span class="tp-monitor-smalllabel"><?php echo __("jQuery Loaded:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-imageicon"></span><span id="jquery_sub_size" class="tp-monitor-total-subsize">%js_size%</span> </span> <span style="float:left;width:60%; text-align:right;"> <span class="tp-monitor-showdetails" data-target="#monitor-jquery-details" data-open="</span><?php echo __("Hide Details", REVSLIDER_TEXTDOMAIN); ?> " data-close="</span><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> "><span class="tp-monitor-openclose"></span><span class="tp-show-inner-btn"><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> </span></span> </span> <span class="tp-clearfix" style="height:15px"></span> <?php echo '<ul class="tp-monitor-list" id="monitor-jquery-details" style="margin-bottom:15px;display:none">'; $jsfiles = array('jquery.themepunch.tools.min.js' => RS_PLUGIN_PATH . '/public/assets/js/jquery.themepunch.tools.min.js', 'jquery.themepunch.revolution.min.js' => RS_PLUGIN_PATH . '/public/assets/js/jquery.themepunch.revolution.min.js'); //check which js files will be used by the Slider if ($using_kenburns == true) { $jsfiles['revolution.extension.kenburn.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.kenburn.min.js'; } if ($using_parallax == true) { $jsfiles['revolution.extension.parallax.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.parallax.js'; } if ($using_navigation == true) { $jsfiles['revolution.extension.navigation.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.navigation.min.js'; } if ($using_videos == true) { $jsfiles['revolution.extension.video.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.video.min.js'; } if ($using_actions == true) { $jsfiles['revolution.extension.actions.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.actions.min.js'; } if ($using_layeranim == true) { $jsfiles['revolution.extension.layeranimation.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.layeranimation.min.js'; } if ($using_carousel == true) { $jsfiles['revolution.extension.carousel.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.carousel.min.js'; } else { $jsfiles['revolution.extension.slideanims.min.js'] = RS_PLUGIN_PATH . '/public/assets/js/extensions/revolution.extension.slideanims.min.js'; } //get the js files foreach ($jsfiles as $name => $path) { if (file_exists($path)) { $fs = filesize($path); echo '<li class="tp-monitor-listli">'; echo '<span class="tp-monitor-good"></span>'; echo '<span class="tp-monitor-size">' . size_format($fs, 0) . '</span>'; echo '<span class="tp-monitor-file">'; echo $name; echo '</span>'; echo '</li>'; $total_size += $fs; $js_size += $fs; } } echo '</ul>'; echo ' <span style="display:none" id="css-size-hidden">' . size_format($js_size, 2) . '</span>'; $http = is_ssl() ? 'https' : 'http'; $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $set_diff_font = RevSliderFunctions::getVal($arrValues, "change_font_loading", ''); if ($set_diff_font !== '') { $font_url = $set_diff_font; } else { $font_url = $http . '://fonts.googleapis.com/css?family='; } $my_fonts = $slider->getParam('google_font', array()); ?> <span class="tp-clearfix" style="height:15px"></span> <hr> <span class="tp-clearfix" style="height:25px"></span> <!-- THE Fonts PERFORMANCE MESSING --> <span class="tp-monitor-performance-title"><?php echo __("Google Fonts Performance", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-performace-wrap"> <span id="video-performace-bar" style="width:%font_performance%%" class="tp-monitor-performance-bar mo-%font_color%-col"></span> <span class="tp-monitor-slow"><?php echo __("Slow", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-ok"><?php echo __("Ok", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-fast"><?php echo __("Fast", REVSLIDER_TEXTDOMAIN); ?> </span> </span> <span class="tp-clearfix" style="height:35px"></span> <!-- FULL SIZE OF SUBCATEGORY && SHOW/HIDE LIST --> <span style="float:left;width:40%; display:block"> <span class="tp-monitor-smalllabel"><?php echo __("Fonts Loaded:", REVSLIDER_TEXTDOMAIN); ?> </span> <span class="tp-monitor-jsicon"></span><span class="tp-monitor-total-subsize">%font_size%</span> </span> <span style="float:left;width:60%; text-align:right;"> <span class="tp-monitor-showdetails" data-target="#monitor-fonts-details" data-open="</span><?php echo __("Hide Details", REVSLIDER_TEXTDOMAIN); ?> " data-close="</span><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> "><span class="tp-monitor-openclose"></span><span class="tp-show-inner-btn"><?php echo __("Show Details", REVSLIDER_TEXTDOMAIN); ?> </span></span> </span> <span class="tp-clearfix" style="height:15px"></span> <?php //echo '<span class="tp-monitor-smalllabel">'.$font_url.'</span>'; echo '<ul class="tp-monitor-list" id="monitor-fonts-details" style="margin-bottom:15px;display:none">'; $all_font_count = 0; if (!empty($my_fonts)) { foreach ($my_fonts as $c_font) { $fcount = RevSliderBase::get_font_weight_count($c_font); $_li = '<li class="tp-monitor-listli">'; if ($fcount < 4) { $_li .= '<span class="tp-monitor-good"></span>'; } else { if ($fcount < 7) { $_li .= '<span class="tp-monitor-well"></span>'; } else { $_li .= '<span class="tp-monitor-warning"></span>'; } } $_li .= '<span class="tp-monitor-file">'; $_li .= strip_tags($c_font); $_li .= '</span>'; $_li .= '</li>'; if ($fcount > 4) { $issues .= $_li; } echo $_li; $all_font_count += $fcount; } } echo '</ul>'; ?> </div><!-- END OF OVERALL Div--> <script> jQuery(document).on("ready",function() { jQuery('body').on('click','.tp-monitor-showdetails',function() { var bt = jQuery(this); if (bt.hasClass("selected")) { bt.find('.tp-show-inner-btn').html(bt.data('close')); bt.removeClass("selected"); jQuery(bt.data('target')).slideUp(200); } else { bt.find('.tp-show-inner-btn').html(bt.data('open')); bt.addClass("selected"); jQuery(bt.data('target')).slideDown(200); } }) }) </script> <?php $content = ob_get_contents(); ob_end_clean(); if ($img_counter == 0) { $img_counter = 1; } if ($slide_counter == 0) { $slide_counter = 1; } $overall = RevSliderOperations::get_performance($total_size / $slide_counter, 0, 400000); // 400KB / Slide is ok $image = RevSliderOperations::get_performance($img_size / $img_counter, 0, 100000); // 100KB Image OK $css = RevSliderOperations::get_performance($css_size, 0, 150000); // 150KB CSS OK $js = RevSliderOperations::get_performance($js_size, 0, 250000); // 250KB Image OK $font = RevSliderOperations::get_performance($all_font_count, 0, 15); // 250KB Image OK $firstslide_size += $js_size; $firstslide_size += $css_size; $smartslide_size += $js_size; $smartslide_size += $css_size; $content = str_replace("%overall_performance%", $overall["proc"], $content); $content = str_replace("%overall_color%", $overall["col"], $content); $content = str_replace("%overall_size%", size_format($total_size, 2), $content); $content = str_replace("%image_performance%", $image["proc"], $content); $content = str_replace("%image_color%", $image["col"], $content); $content = str_replace("%css_performance%", $css["proc"], $content); $content = str_replace("%css_color%", $css["col"], $content); $content = str_replace("%css_size%", size_format($css_size, 2), $content); $content = str_replace("%js_performance%", $js["proc"], $content); $content = str_replace("%js_color%", $js["col"], $content); $content = str_replace("%js_size%", size_format($js_size, 2), $content); $content = str_replace("%font_performance%", $font["proc"], $content); $content = str_replace("%font_color%", $font["col"], $content); $content = str_replace("%font_size%", $all_font_count, $content); $content = str_replace("%issues%", $issues, $content); $content = str_replace("%firstslide_size%", size_format($firstslide_size, 2), $content); $content = str_replace("%smartslide_size%", size_format($smartslide_size, 2), $content); $content = str_replace("%allslide_size%", size_format($total_size, 2), $content); $total_size = $total_size / 1000; $content = str_replace("%umtsspeed-all%", gmdate('i:s', $total_size / 48), $content); $content = str_replace("%dslspeed-all%", gmdate('i:s', $total_size / 307), $content); $content = str_replace("%t1speed-all%", gmdate('i:s', $total_size / 1180), $content); $firstslide_size = $firstslide_size / 1000; $content = str_replace("%umtsspeed-single%", gmdate('i:s', $firstslide_size / 48), $content); $content = str_replace("%dslspeed-single%", gmdate('i:s', $firstslide_size / 307), $content); $content = str_replace("%t1speed-single%", gmdate('i:s', $firstslide_size / 1180), $content); $smartslide_size = $smartslide_size / 1000; $content = str_replace("%umtsspeed-smart%", gmdate('i:s', $smartslide_size / 48), $content); $content = str_replace("%dslspeed-smart%", gmdate('i:s', $smartslide_size / 307), $content); $content = str_replace("%t1speed-smart%", gmdate('i:s', $smartslide_size / 1180), $content); echo $content; }
<?php /** * @author ThemePunch <*****@*****.**> * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if (!defined('ABSPATH')) { exit; } $operations = new RevSliderOperations(); $rs_nav = new RevSliderNavigation(); $arrValues = $operations->getGeneralSettingsValues(); $arr_navigations = $rs_nav->get_all_navigations(); $transitions = $operations->getArrTransition(); $_width = isset($arrValues['width']) ? $arrValues['width'] : 1240; $_width_notebook = isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : 1024; $_width_tablet = isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : 778; $_width_mobile = isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : 480; if (!isset($is_edit)) { $is_edit = false; } if (!isset($linksEditSlides)) { $linksEditSlides = ''; } ?> <div class="wrap settings_wrap"> <div class="clear_both"></div> <div class="title_line" style="margin-bottom:0px !important"> <div id="icon-options-general" class="icon32"></div>
<?php if (!defined('ABSPATH')) { exit; } global $revSliderVersion; $wrapperClass = ""; if (RevSliderGlobals::$isNewVersion == false) { $wrapperClass = " oldwp"; } $nonce = wp_create_nonce("revslider_actions"); $rsop = new RevSliderOperations(); $glval = $rsop->getGeneralSettingsValues(); ?> <?php $waitstyle = ''; if (isset($_REQUEST['update_shop'])) { $waitstyle = 'display:block'; } ?> <div id="waitaminute" style="<?php echo $waitstyle; ?> "> <div class="waitaminute-message"><i class="eg-icon-emo-coffee"></i><br><?php _e("Please Wait...", REVSLIDER_TEXTDOMAIN); ?> </div> </div>
_e("Order Posts", REVSLIDER_TEXTDOMAIN); ?> </a> <?php } ?> <a class="button-primary export_slider_overview" id="export_slider_<?php echo $id; ?> " href="javascript:void(0);" ><i class="revicon-export"></i><?php _e("Export", REVSLIDER_TEXTDOMAIN); ?> </a> <?php $operations = new RevSliderOperations(); $general_settings = $operations->getGeneralSettingsValues(); $show_dev_export = RevSliderBase::getVar($general_settings, 'show_dev_export', 'off'); if ($show_dev_export == 'on') { ?> <a class="button-primary export_slider_standalone" id="export_slider_standalone_<?php echo $id; ?> " href="javascript:void(0);" ><i class="revicon-export"></i><?php _e("Export to HTML", REVSLIDER_TEXTDOMAIN); ?> </a> <?php } ?> <a class="button-primary button_delete_slider" id="button_delete_<?php echo $id;
/** * * put html slider on the html page. * @param $data - mixed, can be ID ot Alias. */ public function putSliderBase($sliderID, $gal_ids = array(), $markup_export = false, $settings = array(), $order = array()) { $this->markup_export = $markup_export; try { $slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION); self::$sliderSerial++; $this->slider = new RevSlider(); if ($sliderID !== '-99') { $this->slider->initByMixed($sliderID); } else { //do default $this->slider->initByMixed($sliderID); } //modify settings if there are any special settings given through the shortcode if (!empty($settings)) { $this->modify_settings($settings); } //modify settings for admin preview mode if ($this->previewMode == true) { $this->modifyPreviewModeSettings(); } //set slider language $isWpmlExists = RevSliderWpml::isWpmlExists(); $useWpml = $this->slider->getParam("use_wpml", "off"); if ($isWpmlExists && $useWpml == "on") { if ($this->previewMode == false) { $this->sliderLang = RevSliderFunctionsWP::getCurrentLangCode(); } } //edit html before slider $htmlBeforeSlider = ""; if ($markup_export === true) { $htmlBeforeSlider .= '<!-- FONT -->'; } if ($this->slider->getParam("load_googlefont", "false") == "true") { $googleFont = $this->slider->getParam("google_font"); if (is_array($googleFont)) { foreach ($googleFont as $key => $font) { } } else { $htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($googleFont); } } $gfonts = $this->slider->getParam("google_font", array()); if (!empty($gfonts) && is_array($gfonts)) { foreach ($gfonts as $gf) { $gf = str_replace(array('"', '+'), array('', ' '), $gf); $htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($gf); } } //add all google fonts of layers $gfsubsets = $this->slider->getParam("subsets", array()); $gf = $this->slider->getUsedFonts(false); foreach ($gf as $gfk => $gfv) { $tcf = $gfk . ':'; if (!empty($gfv['variants'])) { $mgfirst = true; foreach ($gfv['variants'] as $mgvk => $mgvv) { if (!$mgfirst) { $tcf .= ','; } $tcf .= $mgvk; $mgfirst = false; } } if (!empty($gfv['subsets'])) { $mgfirst = true; foreach ($gfv['subsets'] as $ssk => $ssv) { if (array_search(esc_attr($gfk . '+' . $ssv), $gfsubsets) !== false) { if ($mgfirst) { $tcf .= '&subset='; } if (!$mgfirst) { $tcf .= ','; } $tcf .= $ssv; $mgfirst = false; } } } $htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($tcf); } if ($markup_export === true) { $htmlBeforeSlider .= '<!-- /FONT -->'; } //pub js to body handle if ($this->slider->getParam("js_to_body", "false") == "true") { $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off'); if ($markup_export === true) { $htmlBeforeSlider .= '<!-- SCRIPTINCLUDE -->'; } if ($enable_logs == 'on') { $urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js?rev=' . $slver; $htmlBeforeSlider .= '<script type="text/javascript" src="' . $urlIncludeJS . '"></script>'; } $urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js?rev=' . $slver; $htmlBeforeSlider .= '<script type="text/javascript" src="' . $urlIncludeJS . '"></script>'; $urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.revolution.min.js?rev=' . $slver; $htmlBeforeSlider .= '<script type="text/javascript" src="' . $urlIncludeJS . '"></script>'; if ($markup_export === true) { $htmlBeforeSlider .= '<!-- /SCRIPTINCLUDE -->'; } } //the initial id can be alias $sliderID = $this->slider->getID(); $bannerWidth = $this->slider->getParam("width", null, RevSlider::VALIDATE_NUMERIC, "Slider Width"); $bannerHeight = $this->slider->getParam("height", null, RevSlider::VALIDATE_NUMERIC, "Slider Height"); $sliderType = $this->slider->getParam("slider_type"); $slider_type = $this->slider->getParam("slider-type"); //set wrapper height $wrapperHeigh = 0; $wrapperHeigh += $this->slider->getParam("height"); //add thumb height if ($this->slider->getParam('enable_thumbnails', 'off') == 'on') { $wrapperHeigh += $this->slider->getParam('thumb_height'); } $slider_id = $this->slider->getParam('slider_id', ''); if (trim($slider_id) !== '') { $this->sliderHtmlID = $slider_id; } else { $this->sliderHtmlID = 'rev_slider_' . $sliderID . '_' . self::$sliderSerial; } $this->sliderHtmlID_wrapper = $this->sliderHtmlID . '_wrapper'; $containerStyle = ""; $sliderPosition = $this->slider->getParam("position", "center"); $do_overflow = ''; //set position: if ($sliderType != "fullscreen") { switch ($sliderPosition) { case "center": default: $containerStyle .= "margin:0px auto;"; break; case "left": $containerStyle .= "float:left;"; break; case "right": $containerStyle .= "float:right;"; break; } if ($this->slider->getParam('main_overflow_hidden', 'on') == 'on') { $do_overflow = ' tp-overflow-hidden'; } } //add background color $backgroundColor = esc_attr(trim($this->slider->getParam('background_color'))); if (!empty($backgroundColor)) { $containerStyle .= 'background-color:' . $backgroundColor . ';'; } //set padding $containerStyle .= 'padding:' . esc_attr($this->slider->getParam('padding', '0')) . 'px;'; //set margin: if ($sliderType != 'fullscreen') { if ($sliderPosition != 'center') { $containerStyle .= 'margin-left:' . esc_attr($this->slider->getParam('margin_left', '0', RevSlider::FORCE_NUMERIC)) . 'px;'; $containerStyle .= 'margin-right:' . esc_attr($this->slider->getParam('margin_right', '0', RevSlider::FORCE_NUMERIC)) . 'px;'; } $containerStyle .= 'margin-top:' . esc_attr($this->slider->getParam('margin_top', '0', RevSlider::FORCE_NUMERIC)) . 'px;'; $containerStyle .= 'margin-bottom:' . esc_attr($this->slider->getParam('margin_bottom', '0', RevSlider::FORCE_NUMERIC)) . 'px;'; } //set height and width: $bannerStyle = 'display:none;'; //add background image (to banner style) $showBackgroundImage = $this->slider->getParam('show_background_image', 'off'); if ($showBackgroundImage == 'true' || $showBackgroundImage == 'on') { $backgroundImage = esc_attr($this->slider->getParam('background_image')); $backgroundFit = esc_attr($this->slider->getParam('bg_fit', $this->slider->getParam('def-background_fit', 'cover'))); $backgroundRepeat = esc_attr($this->slider->getParam('bg_repeat', $this->slider->getParam('def-bg_repeat', 'no-repeat'))); $backgroundPosition = esc_attr($this->slider->getParam('bg_position', $this->slider->getParam('def-bg_position', 'center center'))); if (!empty($backgroundImage)) { $containerStyle .= "background-image:url(" . $backgroundImage . ");background-repeat:" . $backgroundRepeat . ";background-size:" . $backgroundFit . ";background-position:" . $backgroundPosition . ";"; } } //set wrapper and slider class: $sliderWrapperClass = "rev_slider_wrapper"; $sliderClass = "rev_slider"; switch ($sliderType) { case "responsitive": //@since 5.0: obsolete now, was custom //@since 5.0: obsolete now, was custom case "fixed": //@since 5.0: obsolete now //@since 5.0: obsolete now case 'auto': case 'fullwidth': $sliderWrapperClass .= " fullwidthbanner-container"; $sliderClass .= " fullwidthabanner"; // KRISZTIAN REMOVED SOME LINE //$bannerStyle .= "max-height:".$bannerHeight."px;height:".$bannerHeight."px;"; //$containerStyle .= "max-height:".$bannerHeight."px;"; break; case 'fullscreen': $sliderWrapperClass .= " fullscreen-container"; $sliderClass .= " fullscreenbanner"; break; default: $bannerStyle .= "height:" . $bannerHeight . "px;width:" . $bannerWidth . "px;"; $containerStyle .= "height:" . $bannerHeight . "px;width:" . $bannerWidth . "px;"; break; } $maxWidth = $this->slider->getParam('max_width', '0', RevSlider::FORCE_NUMERIC); if ($maxWidth > 0 && $this->slider->getParam('slider_type') == 'auto') { $containerStyle .= 'max-width:' . $maxWidth . 'px;'; } $htmlTimerBar = ""; $enable_progressbar = $this->slider->getParam('enable_progressbar', 'on'); $timerBar = $this->slider->getParam('show_timerbar', 'top'); $progress_height = $this->slider->getParam('progress_height', '5'); $progress_opa = $this->slider->getParam('progress_opa', '15'); $progressbar_color = $this->slider->getParam('progressbar_color', '#000000'); if ($enable_progressbar !== 'on' || $slider_type == 'hero') { $timerBar = 'hide'; } $progress_style = ' style="height: ' . esc_attr($progress_height) . 'px; background-color: ' . RevSliderFunctions::hex2rgba($progressbar_color, $progress_opa) . ';"'; switch ($timerBar) { case "top": $htmlTimerBar = '<div class="tp-bannertimer"' . $progress_style . '></div>'; break; case "bottom": $htmlTimerBar = '<div class="tp-bannertimer tp-bottom"' . $progress_style . '></div>'; break; case "hide": $htmlTimerBar = '<div class="tp-bannertimer tp-bottom" style="visibility: hidden !important;"></div>'; break; } //check inner / outer border $paddingType = $this->slider->getParam("padding_type", "outer"); if ($paddingType == "inner") { $sliderWrapperClass .= " tp_inner_padding"; } global $revSliderVersion; $add_alias = ''; if (is_super_admin() || is_admin_bar_showing()) { if (current_user_can('edit_theme_options')) { $add_alias = ' data-alias="' . esc_attr($this->slider->getAlias()) . '"'; } } echo $htmlBeforeSlider . "\n"; echo '<div id="' . $this->sliderHtmlID_wrapper . '" class="' . $sliderWrapperClass . '"' . $add_alias; $show_alternate = $this->slider->getParam("show_alternative_type", "off"); if ($show_alternate !== 'off') { $show_alternate_image = $this->slider->getParam("show_alternate_image", ""); echo ' data-aimg="' . $show_alternate_image . '" '; if ($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8') { echo ' data-amobile="enabled" '; } else { echo ' data-amobile="disabled" '; } if ($show_alternate == 'mobile-ie8' || $show_alternate == 'ie8') { echo ' data-aie8="enabled" '; } else { echo ' data-aie8="disabled" '; } } echo ' style="' . $containerStyle . '">' . "\n"; echo '<!-- START REVOLUTION SLIDER ' . $revSliderVersion . ' ' . $sliderType . ' mode -->' . "\n"; echo ' <div id="' . $this->sliderHtmlID . '"'; echo ' class="' . $sliderClass . $do_overflow . '"'; echo ' style="' . $bannerStyle . '"'; echo ' data-version="' . $revSliderVersion . '">' . "\n"; echo $this->putSlides($gal_ids, $order); echo $htmlTimerBar; echo ' </div>' . "\n"; $this->putJS($markup_export); echo '</div>'; echo '<!-- END REVOLUTION SLIDER -->'; } catch (Exception $e) { $message = $e->getMessage(); $this->putErrorMessage($message); } }
public static function get_responsive_size($slider) { $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $enable_custom_size_notebook = $slider->slider->getParam('enable_custom_size_notebook', 'off'); $enable_custom_size_tablet = $slider->slider->getParam('enable_custom_size_tablet', 'off'); $enable_custom_size_iphone = $slider->slider->getParam('enable_custom_size_iphone', 'off'); $adv_resp_sizes = $enable_custom_size_notebook == 'on' || $enable_custom_size_tablet == 'on' || $enable_custom_size_iphone == 'on' ? true : false; if ($adv_resp_sizes == true) { $width = $slider->slider->getParam("width", 1240, RevSlider::FORCE_NUMERIC); $width .= ',' . $slider->slider->getParam("width_notebook", 1024, RevSlider::FORCE_NUMERIC); $width .= ',' . $slider->slider->getParam("width_tablet", 778, RevSlider::FORCE_NUMERIC); $width .= ',' . $slider->slider->getParam("width_mobile", 480, RevSlider::FORCE_NUMERIC); $height = $slider->slider->getParam("height", 868, RevSlider::FORCE_NUMERIC); $height .= ',' . $slider->slider->getParam("height_notebook", 768, RevSlider::FORCE_NUMERIC); $height .= ',' . intval($slider->slider->getParam("height_tablet", 960, RevSlider::FORCE_NUMERIC)); $height .= ',' . intval($slider->slider->getParam("height_mobile", 720, RevSlider::FORCE_NUMERIC)); $responsive = isset($arrValues['width']) ? $arrValues['width'] : '1240'; $def = isset($arrValues['width']) ? $arrValues['width'] : '1240'; $responsive .= ','; if ($enable_custom_size_notebook == 'on') { $responsive .= isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : '1024'; $def = isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : '1024'; } else { $responsive .= $def; } $responsive .= ','; if ($enable_custom_size_tablet == 'on') { $responsive .= isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : '778'; $def = isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : '778'; } else { $responsive .= $def; } $responsive .= ','; if ($enable_custom_size_iphone == 'on') { $responsive .= isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : '480'; $def = isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : '480'; } else { $responsive .= $def; } return array('level' => $responsive, 'height' => $height, 'width' => $width); } else { return array('height' => $slider->slider->getParam("height", "868", RevSlider::FORCE_NUMERIC), 'width' => $slider->slider->getParam("width", "1240", RevSlider::FORCE_NUMERIC)); } }
/** * Change FontURL to new URL (added for chinese support since google is blocked there) * @since: 5.0 */ public static function modify_punch_url($url) { $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $set_diff_font = RevSliderFunctions::getVal($arrValues, "change_font_loading", ''); if ($set_diff_font !== '') { return $set_diff_font; } else { return $url; } }