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


PHP RevSliderFunctions::convertStdClassToArray方法代码示例

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


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

示例1: updateStaticSlideFromData

 /**
  * 
  * update slide from data
  * @param $data
  */
 public function updateStaticSlideFromData($data)
 {
     $slideID = RevSliderFunctions::getVal($data, "slideid");
     $this->initByStaticID($slideID);
     //treat layers
     $layers = RevSliderFunctions::getVal($data, "layers");
     if (gettype($layers) == "string") {
         $layersStrip = stripslashes($layers);
         $layersDecoded = json_decode($layersStrip);
         if (empty($layersDecoded)) {
             $layersDecoded = json_decode($layers);
         }
         $layers = RevSliderFunctions::convertStdClassToArray($layersDecoded);
     }
     if (empty($layers) || gettype($layers) != "array") {
         $layers = array();
     }
     $layers = $this->normalizeLayers($layers);
     $settings = RevSliderFunctions::getVal($data, "settings");
     $arrUpdate = array();
     $arrUpdate["layers"] = json_encode($layers);
     $arrUpdate["settings"] = json_encode($settings);
     $this->db->update(RevSliderGlobals::$table_static_slides, $arrUpdate, array("id" => $this->id));
     //RevSliderOperations::updateDynamicCaptions();
 }
开发者ID:hathbanger,项目名称:squab,代码行数:30,代码来源:slide.class.php

示例2: filterOneSlide

 /**
  *
  * filter the slides for one slide preview
  */
 private function filterOneSlide($slides)
 {
     $oneSlideID = $this->oneSlideData['slideid'];
     if (strpos($oneSlideID, 'static_') !== false) {
         global $wpdb;
         $sliderID = str_replace('static_', '', $oneSlideID);
         $tmp_slides = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . RevSliderGlobals::$table_static_slides . " WHERE slider_id = %s", array($sliderID)), ARRAY_A);
         if (!empty($tmp_slides)) {
             $n_slides = new RevSliderSlide();
             $n_slides->initByData($tmp_slides[0]);
             $slides[0] = $n_slides;
             $oneSlideID = $n_slides->getID();
         }
     }
     $oneSlideParams = RevSliderFunctions::getVal($this->oneSlideData, 'params');
     $oneSlideLayers = RevSliderFunctions::getVal($this->oneSlideData, 'layers');
     if (gettype($oneSlideParams) == 'object') {
         $oneSlideParams = (array) $oneSlideParams;
     }
     if (gettype($oneSlideLayers) == 'object') {
         $oneSlideLayers = (array) $oneSlideLayers;
     }
     if (!empty($oneSlideLayers)) {
         $oneSlideLayers = RevSliderFunctions::convertStdClassToArray($oneSlideLayers);
     }
     $newSlides = array();
     foreach ($slides as $slide) {
         $slideID = $slide->getID();
         if ($slideID == $oneSlideID) {
             if (!empty($oneSlideParams)) {
                 $slide->setParams($oneSlideParams);
             }
             if (!empty($oneSlideLayers)) {
                 $slide->setLayers($oneSlideLayers);
             }
             $newSlides[] = $slide;
             //add 2 slides
             $newSlides[] = $slide;
         }
     }
     return $newSlides;
 }
开发者ID:surreal8,项目名称:wptheme,代码行数:46,代码来源:output.class.php

示例3: getCategoriesByIDs

 /**
  * 
  * get categories by id's
  */
 public static function getCategoriesByIDs($arrIDs, $strTax = null)
 {
     if (empty($arrIDs)) {
         return array();
     }
     if (is_string($arrIDs)) {
         $strIDs = $arrIDs;
     } else {
         $strIDs = implode(",", $arrIDs);
     }
     $args = array();
     $args["include"] = $strIDs;
     if (!empty($strTax)) {
         if (is_string($strTax)) {
             $strTax = explode(",", $strTax);
         }
         $args["taxonomy"] = $strTax;
     }
     $arrCats = get_categories($args);
     if (!empty($arrCats)) {
         $arrCats = RevSliderFunctions::convertStdClassToArray($arrCats);
     }
     return $arrCats;
 }
开发者ID:iq007,项目名称:MadScape,代码行数:28,代码来源:functions-wordpress.class.php

示例4: filterOneSlide

 /**
  *
  * filter the slides for one slide preview
  */
 private function filterOneSlide($slides)
 {
     $oneSlideID = $this->oneSlideData['slideid'];
     $oneSlideParams = RevSliderFunctions::getVal($this->oneSlideData, 'params');
     $oneSlideLayers = RevSliderFunctions::getVal($this->oneSlideData, 'layers');
     if (gettype($oneSlideParams) == 'object') {
         $oneSlideParams = (array) $oneSlideParams;
     }
     if (gettype($oneSlideLayers) == 'object') {
         $oneSlideLayers = (array) $oneSlideLayers;
     }
     if (!empty($oneSlideLayers)) {
         $oneSlideLayers = RevSliderFunctions::convertStdClassToArray($oneSlideLayers);
     }
     $newSlides = array();
     foreach ($slides as $slide) {
         $slideID = $slide->getID();
         if ($slideID == $oneSlideID) {
             if (!empty($oneSlideParams)) {
                 $slide->setParams($oneSlideParams);
             }
             if (!empty($oneSlideLayers)) {
                 $slide->setLayers($oneSlideLayers);
             }
             $newSlides[] = $slide;
             //add 2 slides
             $newSlides[] = $slide;
         }
     }
     return $newSlides;
 }
开发者ID:silverbux,项目名称:smartmag-magazine-wordpress,代码行数:35,代码来源:output.class.php


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