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


PHP RevOperations::getPostWilcardValues方法代码示例

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


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

示例1: initByPostData

 /**
  *
  * init slide by post data
  */
 public function initByPostData($postData, RevSlide $slideTemplate, $sliderID)
 {
     $this->postData = $this->postData;
     $_view_link = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . UniteFunctionsRev::getVal($postData, 'url_path');
     $_cart_link = UniteFunctionsRev::getVal($postData, 'cart_link');
     $_wishlist_link = UniteFunctionsRev::getVal($postData, 'wishlist_link');
     $postID = $postData["entity_id"];
     $arrWildcardsValues = RevOperations::getPostWilcardValues($postID);
     $slideTemplateID = UniteFunctionsRev::getVal($arrWildcardsValues, "slide_template");
     if (!empty($slideTemplateID) && is_numeric($slideTemplateID)) {
         //init by local template, if fail, init by global (slider) template
         try {
             $slideTemplateLocal = new RevSlide();
             $slideTemplateLocal->initByID($slideTemplateID);
             $this->initBySlide($slideTemplateLocal);
         } catch (Exception $e) {
             $this->initBySlide($slideTemplate);
         }
     } else {
         //init by global template
         $this->initBySlide($slideTemplate);
     }
     //set some slide params
     $this->id = $postID;
     $this->params["title"] = UniteFunctionsRev::getVal($postData, "name");
     if (@$this->params['enable_link'] == "true" && @$this->params['link_type'] == "regular") {
         $this->params["link"] = str_replace('%view_link%', $_view_link, $this->params["link"]);
         $this->params["link"] = str_replace('%cart_link%', $_cart_link, $this->params["link"]);
         $this->params["link"] = str_replace('%wishlist_link%', $_wishlist_link, $this->params["link"]);
     }
     //set image
     $this->imageFilename = $postData['image'];
     //replace placeholders in layers:
     $this->setLayersByPostData($postData, $sliderID);
 }
开发者ID:perseusl,项目名称:kingdavid,代码行数:39,代码来源:revslider_slide.class.php

示例2: initByPostData

 /**
  * 
  * init slide by post data
  */
 public function initByPostData($postData, RevSlide $slideTemplate, $sliderID)
 {
     $this->postData = $this->postData;
     $postID = $postData["ID"];
     $arrWildcardsValues = RevOperations::getPostWilcardValues($postID);
     $slideTemplateID = UniteFunctionsRev::getVal($arrWildcardsValues, "slide_template");
     if (!empty($slideTemplateID) && is_numeric($slideTemplateID)) {
         //init by local template, if fail, init by global (slider) template
         try {
             $slideTemplateLocal = new RevSlide();
             $slideTemplateLocal->initByID($slideTemplateID);
             $this->initBySlide($slideTemplateLocal);
         } catch (Exception $e) {
             $this->initBySlide($slideTemplate);
         }
     } else {
         //init by global template
         $this->initBySlide($slideTemplate);
     }
     //set some slide params
     $this->id = $postID;
     $this->params["title"] = UniteFunctionsRev::getVal($postData, "post_title");
     if ($this->params['enable_link'] == "true" && $this->params['link_type'] == "regular") {
         $link = get_permalink($postID);
         $this->params["link"] = str_replace("%link%", $link, $this->params["link"]);
         $this->params["link"] = str_replace('-', '_REVSLIDER_', $this->params["link"]);
         //process meta tags:
         $arrMatches = array();
         preg_match('/%meta:\\w+%/', $this->params["link"], $arrMatches);
         foreach ($arrMatches as $match) {
             $meta = str_replace("%meta:", "", $match);
             $meta = str_replace("%", "", $meta);
             $meta = str_replace('_REVSLIDER_', '-', $meta);
             $metaValue = get_post_meta($postID, $meta, true);
             $this->params["link"] = str_replace($match, $metaValue, $this->params["link"]);
         }
         $this->params["link"] = str_replace('_REVSLIDER_', '-', $this->params["link"]);
     }
     $status = $postData["post_status"];
     if ($status == "publish") {
         $this->params["state"] = "published";
     } else {
         $this->params["state"] = "unpublished";
     }
     //set image
     $thumbID = UniteFunctionsWPRev::getPostThumbID($postID);
     if (!empty($thumbID)) {
         $this->setImageByImageID($thumbID);
     }
     //replace placeholders in layers:
     $this->setLayersByPostData($postData, $sliderID);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:56,代码来源:revslider_slide.class.php

示例3: initByPostData

 public function initByPostData($postData, RevSlide $slideTemplate, $sliderID)
 {
     $this->postData = $this->postData;
     $postID = $postData['id_product'];
     $arrWildcardsValues = RevOperations::getPostWilcardValues($postID);
     $slideTemplateID = UniteFunctionsRev::getVal($arrWildcardsValues, "slide_template");
     if (!empty($slideTemplateID) && is_numeric($slideTemplateID)) {
         //init by local template, if fail, init by global (slider) template
         try {
             $slideTemplateLocal = new RevSlide();
             $slideTemplateLocal->initByID($slideTemplateID);
             $this->initBySlide($slideTemplateLocal);
         } catch (Exception $e) {
             $this->initBySlide($slideTemplate);
         }
     } else {
         $this->initBySlide($slideTemplate);
     }
     $this->id = $postID;
     $this->params["title"] = UniteFunctionsRev::getVal($postData, "post_title");
     // if($this->params['enable_link'] == "true" && $this->params['link_type'] == "regular"){
     // $link = get_permalink($postID);
     // $this->params["link"] = str_replace("%link%", $link, $this->params["link"]);
     // $this->params["link"] = str_replace('-', '_REVSLIDER_', $this->params["link"]);
     // $arrMatches = array();
     // preg_match('/%product:\w+%/', $this->params["link"], $arrMatches);
     // foreach($arrMatches as $match){
     // 	$meta = str_replace("%product:", "", $match);
     // 	$meta = str_replace("%","",$meta);
     // 	$meta = str_replace('_REVSLIDER_', '-', $meta);
     // 	if(isset($postData[$meta]) && !empty($postData[$meta])){
     // 		$metaValue = $postData[$meta];
     // 		$this->params["link"] = str_replace($match,$metaValue,$this->params["link"]);
     // 	}
     // }
     // $this->params["link"] = str_replace('_REVSLIDER_','-',$this->params["link"]);
     // }
     $status = $postData["active"];
     if ($status == 1) {
         $this->params["state"] = "published";
     } else {
         $this->params["state"] = "unpublished";
     }
     //set image
     // $thumbID = UniteFunctionsWPRev::getPostThumbID($postID);
     $RevSlider = new RevSlider();
     $GetSliderImgSettings = $RevSlider->GetSliderImgSettings($sliderID);
     if (!empty($postID)) {
         $this->setImageByImageID($postID, $GetSliderImgSettings);
     }
     //replace placeholders in layers:
     $this->setLayersByPostData($postData, $sliderID);
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:53,代码来源:revslider_slide.class.php


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