当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSliderDB类代码示例

本文整理汇总了PHP中RevSliderDB的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderDB类的具体用法?PHP RevSliderDB怎么用?PHP RevSliderDB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RevSliderDB类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: move_template_slider

 /**
  * move the template sliders and add the slides to corresponding post based slider or simply move them and change them to post based slider if no slider is using them
  * @since 5.0
  */
 public static function move_template_slider()
 {
     $db = new RevSliderDB();
     $used_templates = array();
     //will store all template IDs that are used by post based Sliders, these can be deleted after the progress.
     $sr = new RevSlider();
     $sl = new RevSliderSlide();
     $arrSliders = $sr->getArrSliders(false, false);
     $tempSliders = $sr->getArrSliders(false, true);
     if (empty($tempSliders) || !is_array($tempSliders)) {
         return true;
     }
     //as we do not have any template sliders, we do not need to run further here
     if (!empty($arrSliders) && is_array($arrSliders)) {
         foreach ($arrSliders as $slider) {
             if ($slider->getParam('source_type', 'gallery') !== 'posts') {
                 continue;
             }
             //only check Slider with type of posts
             $slider_id = $slider->getID();
             $template_id = $slider->getParam('slider_template_id', 0);
             if ($template_id > 0) {
                 //initialize slider to see if it exists. Then copy over the Template Sliders Slides to the Post Based Slider
                 foreach ($tempSliders as $t_slider) {
                     if ($t_slider->getID() === $template_id) {
                         //copy over the slides
                         //get all slides from template, then copy to Slider
                         $slides = $t_slider->getSlides();
                         if (!empty($slides) && is_array($slides)) {
                             foreach ($slides as $slide) {
                                 $slide_id = $slide->getID();
                                 $slider->copySlideToSlider(array('slider_id' => $slider_id, 'slide_id' => $slide_id));
                             }
                         }
                         $static_id = $sl->getStaticSlideID($template_id);
                         if ($static_id !== false) {
                             $record = $db->fetchSingle(RevSliderGlobals::$table_static_slides, $db->prepare("id = %s", array($static_id)));
                             unset($record['id']);
                             $record['slider_id'] = $slider_id;
                             $db->insert(RevSliderGlobals::$table_static_slides, $record);
                         }
                         $used_templates[$template_id] = $t_slider;
                         break;
                     }
                 }
             }
         }
     }
     if (!empty($used_templates)) {
         foreach ($used_templates as $tid => $t_slider) {
             $t_slider->deleteSlider();
         }
     }
     //translate all other template Sliders to normal sliders and set them to post based
     $temp_sliders = $sr->getArrSliders(false, true);
     if (!empty($temp_sliders) && is_array($temp_sliders)) {
         foreach ($temp_sliders as $slider) {
             $slider->updateParam(array('template' => 'false'));
             $slider->updateParam(array('source_type' => 'posts'));
         }
     }
 }
开发者ID:dawnthemes,项目名称:tkb,代码行数:66,代码来源:plugin-update.class.php

示例2: get_captions_sorted

 public static function get_captions_sorted()
 {
     $db = new RevSliderDB();
     $styles = $db->fetch(RevSliderGlobals::$table_css, '', 'handle ASC');
     $arr = array('5.0' => array(), 'Custom' => array(), '4' => array());
     foreach ($styles as $style) {
         $setting = json_decode($style['settings'], true);
         if (!isset($setting['type'])) {
             $setting['type'] = 'text';
         }
         if (array_key_exists('version', $setting) && isset($setting['version'])) {
             $arr[ucfirst($setting['version'])][] = array('label' => trim(str_replace('.tp-caption.', '', $style['handle'])), 'type' => $setting['type']);
         }
     }
     $sorted = array();
     foreach ($arr as $version => $class) {
         foreach ($class as $name) {
             $sorted[] = array('label' => $name['label'], 'version' => $version, 'type' => $name['type']);
         }
     }
     return $sorted;
 }
开发者ID:robertmeans,项目名称:evergreentaphouse,代码行数:22,代码来源:cssparser.class.php

示例3: onFrontAjaxAction

 /**
  * onAjax action handler
  */
 public static function onFrontAjaxAction()
 {
     $db = new RevSliderDB();
     $slider = new RevSlider();
     $slide = new RevSlide();
     $operations = new RevSliderOperations();
     $token = self::getPostVar("token", false);
     //verify the token
     $isVerified = wp_verify_nonce($token, 'RevSlider_Front');
     $error = false;
     if ($isVerified) {
         $data = self::getPostVar('data', false);
         switch (self::getPostVar('client_action', false)) {
             case 'get_slider_html':
                 $id = intval(self::getPostVar('id', 0));
                 if ($id > 0) {
                     $html = '';
                     add_filter('revslider_add_js_delay', array('RevSliderAdmin', 'rev_set_js_delay'));
                     ob_start();
                     $slider_class = RevSliderOutput::putSlider($id);
                     $html = ob_get_contents();
                     //add styling
                     $custom_css = RevSliderOperations::getStaticCss();
                     $custom_css = RevSliderCssParser::compress_css($custom_css);
                     $styles = $db->fetch(RevSliderGlobals::$table_css);
                     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
                     $styles = RevSliderCssParser::compress_css($styles);
                     $html .= '<style type="text/css">' . $custom_css . '</style>';
                     $html .= '<style type="text/css">' . $styles . '</style>';
                     ob_clean();
                     ob_end_clean();
                     $result = !empty($slider_class) && $html !== '' ? true : false;
                     if (!$result) {
                         $error = __('Slider not found', 'revslider');
                     } else {
                         if ($html !== false) {
                             self::ajaxResponseData($html);
                         } else {
                             $error = __('Slider not found', 'revslider');
                         }
                     }
                 } else {
                     $error = __('No Data Received', 'revslider');
                 }
                 break;
         }
     } else {
         $error = true;
     }
     if ($error !== false) {
         $showError = __('Loading Error', 'revslider');
         if ($error !== true) {
             $showError = __('Loading Error: ', 'revslider') . $error;
         }
         self::ajaxResponseError($showError, false);
     }
     exit;
 }
开发者ID:zruiz,项目名称:NG,代码行数:61,代码来源:revslider-admin.class.php

示例4: isSlideByID

 /**
  * Check if Slide Exists with given ID
  * @since: 5.0
  */
 public static function isSlideByID($slideid)
 {
     $db = new RevSliderDB();
     try {
         if (strpos($slideid, 'static_') !== false) {
             $sliderID = str_replace('static_', '', $slideid);
             RevSliderFunctions::validateNumeric($sliderID, "Slider ID");
             $sliderID = $db->escape($sliderID);
             $record = $db->fetch(RevSliderGlobals::$table_static_slides, "slider_id={$sliderID}");
             if (empty($record)) {
                 return false;
             }
             return true;
         } else {
             $slideid = $db->escape($slideid);
             $record = $db->fetchSingle(RevSliderGlobals::$table_slides, "id={$slideid}");
             if (empty($record)) {
                 return false;
             }
             return true;
         }
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:hathbanger,项目名称:squab,代码行数:29,代码来源:slide.class.php

示例5: previewOutput

    /**
     *
     * preview slider output
     * if output object is null - create object
     */
    public function previewOutput($sliderID, $output = null)
    {
        if ($sliderID == "empty_output") {
            $this->loadingMessageOutput();
            exit;
        }
        if ($output == null) {
            $output = new RevSliderOutput();
        }
        $slider = new RevSlider();
        $slider->initByID($sliderID);
        $isWpmlExists = RevSliderWpml::isWpmlExists();
        $useWpml = $slider->getParam("use_wpml", "off");
        $wpmlActive = false;
        if ($isWpmlExists && $useWpml == "on") {
            $wpmlActive = true;
            $arrLanguages = RevSliderWpml::getArrLanguages(false);
            //set current lang to output
            $currentLang = RevSliderFunctions::getPostGetVariable("lang");
            if (empty($currentLang)) {
                $currentLang = RevSliderWpml::getCurrentLang();
            }
            if (empty($currentLang)) {
                $currentLang = $arrLanguages[0];
            }
            $output->setLang($currentLang);
            $selectLangChoose = RevSliderFunctions::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
        }
        $output->setPreviewMode();
        //put the output html
        $urlPlugin = RS_PLUGIN_URL . 'public/assets/';
        $urlPreviewPattern = RevSliderBase::$url_ajax_actions . "&client_action=preview_slider&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
        $nonce = wp_create_nonce("revslider_actions");
        $setBase = is_ssl() ? "https://" : "http://";
        ?>
			<html>
				<head>
					<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/settings.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
					<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
fonts/font-awesome/css/font-awesome.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
					<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
					<?php 
        $db = new RevSliderDB();
        $styles = $db->fetch(RevSliderGlobals::$table_css);
        $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
        $styles = RevSliderCssParser::compress_css($styles);
        echo '<style type="text/css">' . $styles . '</style>';
        //.$stylesinnerlayers
        $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=';
        }
        $custom_css = RevSliderOperations::getStaticCss();
        echo '<style type="text/css">' . RevSliderCssParser::compress_css($custom_css) . '</style>';
        ?>

					<script type='text/javascript' src='<?php 
        echo $setBase;
        ?>
code.jquery.com/jquery-latest.min.js'></script>

					<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
					<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
//.........这里部分代码省略.........
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:101,代码来源:operations.class.php

示例6: previewOutputMarkup


//.........这里部分代码省略.........
        ob_start();
        ?>
<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/settings.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
		<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
		<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
		<?php 
        $head_content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        $custom_css = RevSliderOperations::getStaticCss();
        echo $custom_css . "\n\n";
        echo '/*****************' . "\n";
        echo ' ** ' . __('CAPTIONS CSS', REVSLIDER_TEXTDOMAIN) . "\n";
        echo ' ****************/' . "\n\n";
        $db = new RevSliderDB();
        $styles = $db->fetch(RevSliderGlobals::$table_css);
        echo RevSliderCssParser::parseDbArrayToCss($styles, "\n");
        $style_content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        $output->putSliderBase($sliderID);
        $content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        $script_content = substr($content, strpos($content, '<script type="text/javascript">'), strpos($content, '</script>') + 9 - strpos($content, '<script type="text/javascript">'));
        $content = htmlentities(str_replace($script_content, '', $content));
        $script_content = str_replace('				', '', $script_content);
        $script_content = str_replace(array('<script type="text/javascript">', '</script>'), '', $script_content);
        ?>
		<style>
			body 	 { font-family:sans-serif; font-size:12px;}
			textarea { background:#f1f1f1; border:#ddd; font-size:10px; line-height:16px; margin-bottom:40px; padding:10px;}
			.rev_cont_title { color:#000; text-decoration:none;font-size:14px; line-height:24px; font-weight:800;background: #D5D5D5;padding: 10px;}
			.rev_cont_title a, .rev_cont_title a:visited { margin-left:25px;font-size:12px;line-height:12px;float:right;background-color:#8e44ad; color:#fff; padding:8px 10px;text-decoration:none;}
			.rev_cont_title a:hover	  { background-color:#9b59b6;}
		</style>
		<p><?php 
        $dir = wp_upload_dir();
        if (!isset($dir['baseurl'])) {
            $dir['baseurl'] = '';
        }
        ?>
			<?php 
        _e('Replace image path:', REVSLIDER_TEXTDOMAIN);
        ?>
 <?php 
开发者ID:hathbanger,项目名称:squab,代码行数:67,代码来源:operations.class.php

示例7: importSliderFromPost


//.........这里部分代码省略.........
             if ($custom_animations) {
                 while (!feof($custom_animations)) {
                     $animations .= fread($custom_animations, 1024);
                 }
             }
             if ($dynamic_captions) {
                 while (!feof($dynamic_captions)) {
                     $dynamic .= fread($dynamic_captions, 1024);
                 }
             }
             if ($static_captions) {
                 while (!feof($static_captions)) {
                     $static .= fread($static_captions, 1024);
                 }
             }
             fclose($slider_export);
             if ($custom_animations) {
                 fclose($custom_animations);
             }
             if ($dynamic_captions) {
                 fclose($dynamic_captions);
             }
             if ($static_captions) {
                 fclose($static_captions);
             }
             //check for images!
         } else {
             //check if fallback
             //get content array
             $content = @file_get_contents($filepath);
         }
         if ($importZip === true) {
             //we have a zip
             $db = new RevSliderDB();
             //update/insert custom animations
             $animations = @unserialize($animations);
             if (!empty($animations)) {
                 foreach ($animations as $key => $animation) {
                     //$animation['id'], $animation['handle'], $animation['params']
                     $exist = $db->fetch(RevSliderGlobals::$table_layer_anims, "handle = '" . $animation['handle'] . "'");
                     if (!empty($exist)) {
                         //update the animation, get the ID
                         if ($updateAnim == "true") {
                             //overwrite animation if exists
                             $arrUpdate = array();
                             $arrUpdate['params'] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                             $db->update(RevSliderGlobals::$table_layer_anims, $arrUpdate, array('handle' => $animation['handle']));
                             $anim_id = $exist['0']['id'];
                         } else {
                             //insert with new handle
                             $arrInsert = array();
                             $arrInsert["handle"] = 'copy_' . $animation['handle'];
                             $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                             $anim_id = $db->insert(RevSliderGlobals::$table_layer_anims, $arrInsert);
                         }
                     } else {
                         //insert the animation, get the ID
                         $arrInsert = array();
                         $arrInsert["handle"] = $animation['handle'];
                         $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                         $anim_id = $db->insert(RevSliderGlobals::$table_layer_anims, $arrInsert);
                     }
                     //and set the current customin-oldID and customout-oldID in slider params to new ID from $id
                     $content = str_replace(array('customin-' . $animation['id'] . '"', 'customout-' . $animation['id'] . '"'), array('customin-' . $anim_id . '"', 'customout-' . $anim_id . '"'), $content);
                 }
                 dmp(__("animations imported!", REVSLIDER_TEXTDOMAIN));
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:67,代码来源:slider.class.php

示例8: add_inline_styles

    /**
     * Output Dynamic Inline Styles
     */
    public function add_inline_styles()
    {
        if (!is_admin()) {
            echo '<script>var htmlDiv = document.getElementById("rs-plugin-settings-inline-css"); var htmlDivCss="';
        } else {
            echo "<style>";
        }
        $db = new RevSliderDB();
        $styles = $db->fetch(RevSliderGlobals::$table_css);
        foreach ($styles as $key => $style) {
            $handle = str_replace('.tp-caption', '', $style['handle']);
            if (!isset($this->class_include[$handle])) {
                unset($styles[$key]);
            }
        }
        $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
        $styles = RevSliderCssParser::compress_css($styles);
        if (!is_admin()) {
            echo addslashes($styles) . '";
				if(htmlDiv) {
					htmlDiv.innerHTML = htmlDiv.innerHTML + htmlDivCss;
				}else{
					var htmlDiv = document.createElement("div");
					htmlDiv.innerHTML = "<style>" + htmlDivCss + "</style>";
					document.getElementsByTagName("head")[0].appendChild(htmlDiv.childNodes[0]);
				}
			</script>' . "\n";
        } else {
            echo $styles . '</style>';
        }
    }
开发者ID:surreal8,项目名称:wptheme,代码行数:34,代码来源:output.class.php

示例9: importSliderFromPost

 /**
  * 
  * import slider from multipart form
  */
 public function importSliderFromPost($updateAnim = true, $updateStatic = true, $exactfilepath = false, $is_template = false, $single_slide = false, $updateNavigation = true)
 {
     try {
         $sliderID = RevSliderFunctions::getPostVariable("sliderid");
         $sliderExists = !empty($sliderID);
         if ($sliderExists) {
             $this->initByID($sliderID);
         }
         if ($exactfilepath !== false) {
             $filepath = $exactfilepath;
         } else {
             switch ($_FILES['import_file']['error']) {
                 case UPLOAD_ERR_OK:
                     break;
                 case UPLOAD_ERR_NO_FILE:
                     RevSliderFunctions::throwError(__('No file sent.', 'revslider'));
                 case UPLOAD_ERR_INI_SIZE:
                 case UPLOAD_ERR_FORM_SIZE:
                     RevSliderFunctions::throwError(__('Exceeded filesize limit.', 'revslider'));
                 default:
                     break;
             }
             $filepath = $_FILES["import_file"]["tmp_name"];
         }
         if (file_exists($filepath) == false) {
             RevSliderFunctions::throwError(__('Import file not found!!!', 'revslider'));
         }
         $importZip = false;
         WP_Filesystem();
         global $wp_filesystem;
         $upload_dir = wp_upload_dir();
         $d_path = $upload_dir['basedir'] . '/rstemp/';
         $unzipfile = unzip_file($filepath, $d_path);
         if (is_wp_error($unzipfile)) {
             define('FS_METHOD', 'direct');
             //lets try direct.
             WP_Filesystem();
             //WP_Filesystem() needs to be called again since now we use direct !
             //@chmod($filepath, 0775);
             $unzipfile = unzip_file($filepath, $d_path);
             if (is_wp_error($unzipfile)) {
                 $d_path = RS_PLUGIN_PATH . 'rstemp/';
                 $unzipfile = unzip_file($filepath, $d_path);
                 if (is_wp_error($unzipfile)) {
                     $f = basename($filepath);
                     $d_path = str_replace($f, '', $filepath);
                     $unzipfile = unzip_file($filepath, $d_path);
                 }
             }
         }
         if (!is_wp_error($unzipfile)) {
             $importZip = true;
             //raus damit..
             //read all files needed
             $content = $wp_filesystem->exists($d_path . 'slider_export.txt') ? $wp_filesystem->get_contents($d_path . 'slider_export.txt') : '';
             if ($content == '') {
                 RevSliderFunctions::throwError(__('slider_export.txt does not exist!', 'revslider'));
             }
             $animations = $wp_filesystem->exists($d_path . 'custom_animations.txt') ? $wp_filesystem->get_contents($d_path . 'custom_animations.txt') : '';
             $dynamic = $wp_filesystem->exists($d_path . 'dynamic-captions.css') ? $wp_filesystem->get_contents($d_path . 'dynamic-captions.css') : '';
             $static = $wp_filesystem->exists($d_path . 'static-captions.css') ? $wp_filesystem->get_contents($d_path . 'static-captions.css') : '';
             $navigations = $wp_filesystem->exists($d_path . 'navigation.txt') ? $wp_filesystem->get_contents($d_path . 'navigation.txt') : '';
             $uid_check = $wp_filesystem->exists($d_path . 'info.cfg') ? $wp_filesystem->get_contents($d_path . 'info.cfg') : '';
             $version_check = $wp_filesystem->exists($d_path . 'version.cfg') ? $wp_filesystem->get_contents($d_path . 'version.cfg') : '';
             if ($is_template !== false) {
                 if ($uid_check != $is_template) {
                     return array("success" => false, "error" => __('Please select the correct zip file, checksum failed!', 'revslider'));
                 }
             } else {
                 //someone imported a template base Slider, check if it is existing in Base Sliders, if yes, check if it was imported
                 if ($uid_check !== '') {
                     $tmpl = new RevSliderTemplate();
                     $tmpl_slider = $tmpl->getThemePunchTemplateSliders();
                     foreach ($tmpl_slider as $tp_slider) {
                         if (!isset($tp_slider['installed'])) {
                             continue;
                         }
                         if ($tp_slider['uid'] == $uid_check) {
                             $is_template = $uid_check;
                             break;
                         }
                     }
                 }
             }
             $db = new RevSliderDB();
             //update/insert custom animations
             $animations = @unserialize($animations);
             if (!empty($animations)) {
                 foreach ($animations as $key => $animation) {
                     //$animation['id'], $animation['handle'], $animation['params']
                     $exist = $db->fetch(RevSliderGlobals::$table_layer_anims, $db->prepare("handle = %s", array($animation['handle'])));
                     if (!empty($exist)) {
                         //update the animation, get the ID
                         if ($updateAnim == "true") {
                             //overwrite animation if exists
                             $arrUpdate = array();
//.........这里部分代码省略.........
开发者ID:ksan5835,项目名称:maadithottam,代码行数:101,代码来源:slider.class.php

示例10: add_inline_styles

 /**
  * Output Dynamic Inline Styles
  */
 public function add_inline_styles()
 {
     if (!is_admin()) {
         echo '<script>var htmlDiv = document.getElementById("rs-plugin-settings-inline-css");htmlDiv.innerHTML = htmlDiv.innerHTML + unescape("';
     } else {
         echo "<style>";
     }
     $db = new RevSliderDB();
     $styles = $db->fetch(RevSliderGlobals::$table_css);
     foreach ($styles as $key => $style) {
         $handle = str_replace('.tp-caption', '', $style['handle']);
         if (!isset($this->class_include[$handle])) {
             unset($styles[$key]);
         }
     }
     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
     $styles = RevSliderCssParser::compress_css($styles);
     if (!is_admin()) {
         echo addslashes($styles) . '");</script>' . "\n";
     } else {
         echo $styles . '</style>';
     }
 }
开发者ID:allanRoberto,项目名称:klassea,代码行数:26,代码来源:output.class.php

示例11: importCaptionsCssContentArray

 /**
  *
  * import contents of the css file
  */
 public static function importCaptionsCssContentArray()
 {
     $db = new RevSliderDB();
     $css = self::getCaptionsCssContentArray();
     $static = array();
     if (is_array($css) && $css !== false && count($css) > 0) {
         foreach ($css as $class => $styles) {
             //check if static style or dynamic style
             $class = trim($class);
             if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                 //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
                 $static[$class] = $styles;
                 continue;
             }
             //is a dynamic style
             if (strpos($class, ':hover') !== false) {
                 $class = trim(str_replace(':hover', '', $class));
                 $arrInsert = array();
                 $arrInsert["hover"] = json_encode($styles);
                 $arrInsert["settings"] = json_encode(array('hover' => 'true'));
             } else {
                 $arrInsert = array();
                 $arrInsert["params"] = json_encode($styles);
             }
             //check if class exists
             $result = $db->fetch(RevSliderGlobals::$table_css, $db->prepare("handle = %s", array($class)));
             if (!empty($result)) {
                 //update
                 $db->update(RevSliderGlobals::$table_css, $arrInsert, array('handle' => $class));
             } else {
                 //insert
                 $arrInsert["handle"] = $class;
                 $db->insert(RevSliderGlobals::$table_css, $arrInsert);
             }
         }
     }
     if (!empty($static)) {
         //save static into static-captions.css
         $css = RevSliderCssParser::parseStaticArrayToCss($static);
         $static_cur = RevSliderOperations::getStaticCss();
         //get the open sans line!
         $css = $static_cur . "\n" . $css;
         self::updateStaticCss($css);
     }
 }
开发者ID:surreal8,项目名称:wptheme,代码行数:49,代码来源:operations.class.php

示例12: add_inline_styles

 /**
  * Output Dynamic Inline Styles
  */
 public function add_inline_styles()
 {
     if (!is_admin()) {
         echo '<script>document.write("<style type=\\"text/css\\">';
     } else {
         echo "<style>";
     }
     $db = new RevSliderDB();
     $styles = $db->fetch(RevSliderGlobals::$table_css);
     foreach ($styles as $key => $style) {
         $handle = str_replace('.tp-caption', '', $style['handle']);
         if (!isset($this->class_include[$handle])) {
             unset($styles[$key]);
         }
     }
     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
     $styles = RevSliderCssParser::compress_css($styles);
     if (!is_admin()) {
         echo addslashes($styles) . '</style>");</script>' . "\n";
     } else {
         echo $styles . '</style>';
     }
 }
开发者ID:jamesvillarrubia,项目名称:uniken-web,代码行数:26,代码来源:output.class.php

示例13: ts_show_page_slider

function ts_show_page_slider()
{
    global $ts_page_datas;
    $revolution_exists = class_exists('RevSlider') && class_exists('UniteFunctionsRev');
    switch ($ts_page_datas['ts_page_slider']) {
        case 'revslider':
            if ($revolution_exists && $ts_page_datas['ts_rev_slider']) {
                $rev_db = new RevSliderDB();
                $response = $rev_db->fetch(RevSliderGlobals::$table_sliders, 'id=' . $ts_page_datas['ts_rev_slider']);
                if (!empty($response)) {
                    RevSliderOutput::putSlider($ts_page_datas['ts_rev_slider'], '');
                }
            }
            break;
        default:
            break;
    }
}
开发者ID:ericsoncardosoweb,项目名称:dallia,代码行数:18,代码来源:theme_functions.php


注:本文中的RevSliderDB类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。