本文整理汇总了PHP中RevSlider::GetSliderImgSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::GetSliderImgSettings方法的具体用法?PHP RevSlider::GetSliderImgSettings怎么用?PHP RevSlider::GetSliderImgSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlider
的用法示例。
在下文中一共展示了RevSlider::GetSliderImgSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stripslashes
if ($sortBy == UniteFunctionsWPRev::SORTBY_MENU_ORDER) {
$order = $slide->getOrder();
} else {
$order = $index + 1;
}
//$urlImageForView = $slide->getUrlImageThumb();
$slideTitle = $slide->getParam("title", "Slide");
$title = $slideTitle;
$filename = $slide->getImageFilename();
$imageAlt = stripslashes($slideTitle);
if (empty($imageAlt)) {
$imageAlt = "slide";
}
if ($bgType == "image" && !empty($filename)) {
$title .= " (" . $filename . ")";
}
$postID = $slide->getID();
$tem_post_types = $slide->tem_post_types();
// print '<pre>';
// print_r(Tools::getvalue('id'));
// print '</pre>';
$sdsrevsliderid = Tools::getvalue('id');
if (isset($sdsrevsliderid) && !empty($sdsrevsliderid)) {
$RevSlider = new RevSlider();
$img_type_set = $RevSlider->GetSliderImgSettings($sdsrevsliderid);
}
if (!isset($img_type_set) && empty($img_type_set)) {
$img_type_set = 'home_default';
}
// start get image thumbnail
$prdid_image = Product::getCover($postID);
示例2: setImageByImageID
/**
*
* set slide image by image id
*/
private function setImageByImageID($postID, $sliderID = '')
{
$img_arr = array();
$RevSlider = new RevSlider();
$img_arr = $RevSlider->GetSliderImgSettings($sliderID);
$prdid_image = sdsconfig::getProductimg($postID, $img_arr);
if (sizeof($prdid_image) > 0) {
$prdimage_url = $prdid_image;
}
//$this->imageID = $imageID;
$this->imageID = 0;
//$this->imageUrl = UniteFunctionsWPRev::getUrlAttachmentImage($imageID);
$this->imageUrl = $prdimage_url;
// $this->imageThumb = UniteFunctionsWPRev::getUrlAttachmentImage($imageID,UniteFunctionsWPRev::THUMB_MEDIUM);
$this->imageThumb = $prdimage_url;
if (empty($this->imageUrl)) {
return false;
}
$this->params["background_type"] = "image";
if (is_ssl()) {
$this->imageUrl = str_replace("http://", "https://", $this->imageUrl);
}
$this->imageFilepath = $prdimage_url;
//$realPath = UniteFunctionsWPRev::getPathContent().$this->imageFilepath;
$realPath = $prdimage_url;
if (file_exists($realPath) == false || is_file($realPath) == false) {
$this->imageFilepath = "";
}
$this->imageFilename = basename($this->imageUrl);
}
示例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);
}