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


PHP RevSlider::isSlidesFromPosts方法代码示例

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


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

示例1: toggleSlideStatFromData

 /**
  * toggle slide state from data
  **/
 public function toggleSlideStatFromData($data)
 {
     $sliderID = RevSliderFunctions::getVal($data, "slider_id");
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $slideID = RevSliderFunctions::getVal($data, "slide_id");
     if ($slider->isSlidesFromPosts()) {
         $postData = RevSliderFunctionsWP::getPost($slideID);
         $oldState = $postData["post_status"];
         $newState = $oldState == RevSliderFunctionsWP::STATE_PUBLISHED ? RevSliderFunctionsWP::STATE_DRAFT : RevSliderFunctionsWP::STATE_PUBLISHED;
         //update the state in wp
         RevSliderFunctionsWP::updatePostState($slideID, $newState);
         //return state:
         $newState = $newState == RevSliderFunctionsWP::STATE_PUBLISHED ? "published" : "unpublished";
     } else {
         $this->initByID($slideID);
         $state = $this->getParam("state", "published");
         $newState = $state == "published" ? "unpublished" : "published";
         $arrUpdate = array();
         $arrUpdate["state"] = $newState;
         $this->updateParamsInDB($arrUpdate);
     }
     return $newState;
 }
开发者ID:hathbanger,项目名称:squab,代码行数:27,代码来源:slide.class.php

示例2: getArrSlidersWithSlidesShort

 /**
  * 
  * get array of sliders with slides, short, assoc.
  */
 public function getArrSlidersWithSlidesShort($filterType = self::SLIDER_TYPE_ALL)
 {
     $arrSliders = self::getArrSlidersShort(null, $filterType);
     $output = array();
     foreach ($arrSliders as $sliderID => $sliderName) {
         $slider = new RevSlider();
         $slider->initByID($sliderID);
         $isFromPosts = $slider->isSlidesFromPosts();
         $isTemplate = $slider->getParam("template", "false");
         //filter by gallery only
         if ($filterType == self::SLIDER_TYPE_POSTS && $isFromPosts == false) {
             continue;
         }
         if ($filterType == self::SLIDER_TYPE_GALLERY && $isFromPosts == true) {
             continue;
         }
         //filter by template type
         if ($filterType == self::SLIDER_TYPE_TEMPLATE && $isTemplate == "false") {
             continue;
         }
         $sliderTitle = $slider->getTitle();
         $arrSlides = $slider->getArrSlidesFromGalleryShort();
         foreach ($arrSlides as $slideID => $slideName) {
             $output[$slideID] = $sliderName . ", " . $slideName;
         }
     }
     return $output;
 }
开发者ID:ConceptHaus,项目名称:huasca,代码行数:32,代码来源:revslider_slider.class.php

示例3: updateSlideImageFromData

 /**
  * 
  * update slide image from data
  */
 public function updateSlideImageFromData($data)
 {
     $sliderID = RevSliderFunctions::getVal($data, "slider_id");
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $slideID = RevSliderFunctions::getVal($data, "slide_id");
     $urlImage = RevSliderFunctions::getVal($data, "url_image");
     RevSliderFunctions::validateNotEmpty($urlImage);
     $imageID = RevSliderFunctions::getVal($data, "image_id");
     if ($slider->isSlidesFromPosts()) {
         if (!empty($imageID)) {
             RevSliderFunctionsWP::updatePostThumbnail($slideID, $imageID);
         }
     } elseif ($slider->isSlidesFromStream() !== false) {
         //do nothing
     } else {
         $this->initByID($slideID);
         $arrUpdate = array();
         $arrUpdate["image"] = $urlImage;
         $arrUpdate["image_id"] = $imageID;
         $this->updateParamsInDB($arrUpdate);
     }
     return $urlImage;
 }
开发者ID:ksan5835,项目名称:maadithottam,代码行数:28,代码来源:slide.class.php

示例4: count

$selectSliders = UniteFunctionsRev::getHTMLSelect($arrSliders, "", "id='selectSliders'", true);
$numSliders = count($arrSliders);
//set iframe parameters
//$width = $sliderParams["width"];
//$height = $sliderParams["height"];
$width = isset($sliderParams["width"]) ? $sliderParams["width"] : '';
$height = isset($sliderParams["height"]) ? $sliderParams["height"] : '';
$iframeWidth = $width + 60;
$iframeHeight = $height + 50;
$iframeStyle = "width:" . $iframeWidth . "px;height:" . $iframeHeight . "px;";
$arrSlides = $slider->getSlides(false);
$numSlides = count($arrSlides);
$linksSliderSettings = self::getViewUrl(RevSliderAdmin::VIEW_SLIDER, "id={$sliderID}");
$patternViewSlide = self::getViewUrl("slide", "id=[slideid]");
//treat in case of slides from gallery
if ($slider->isSlidesFromPosts() == false) {
    $templateName = "slides_gallery";
    //handle wpml
    $isWpmlExists = UniteWpmlRev::isWpmlExists();
    $useWpml = $slider->getParam("use_wpml", "off");
    $wpmlActive = false;
    if ($isWpmlExists && $useWpml == "on") {
        $wpmlActive = true;
        //get langs floating menu
        $urlIconDelete = self::$url_plugin . "images/icon-trash.png";
        $urlIconEdit = self::$url_plugin . "images/icon-edit.png";
        $urlIconPreview = self::$url_plugin . "images/preview.png";
        $textDelete = ControllerModulerevslideropencart::$lang_var['Delete_Slider'];
        $textEdit = ControllerModulerevslideropencart::$lang_var['Edit_Slide'];
        $textPreview = ControllerModulerevslideropencart::$lang_var['Preview_Slide'];
        $htmlBefore = "";
开发者ID:rinodung,项目名称:opencart-15x-flat-admin,代码行数:31,代码来源:slides.php

示例5: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $operations = new RevOperations();
     $sliderID = $this->getRequest()->getParam('id');
     $storeID = $this->getRequest()->getParam('store_id', 0);
     if (empty($sliderID)) {
         UniteFunctionsRev::throwError("Slider ID not found");
     }
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $sliderParams = $slider->getParams();
     $arrSliders = $slider->getArrSlidersShort($sliderID);
     $selectSliders = UniteFunctionsRev::getHTMLSelect($arrSliders, "", "id='selectSliders'", true);
     $numSliders = count($arrSliders);
     //set iframe parameters
     $width = $sliderParams["width"];
     $height = $sliderParams["height"];
     $iframeWidth = $width + 60;
     $iframeHeight = $height + 50;
     $iframeStyle = "width:" . $iframeWidth . "px;height:" . $iframeHeight . "px;";
     $arrSlides = $slider->getSlides(false, $storeID);
     $numSlides = count($arrSlides);
     $linksSliderSettings = $this->helper("adminhtml")->getUrl('adminhtml/nwdrevslider/slider/id/' . $sliderID);
     $patternViewSlide = $this->helper("adminhtml")->getUrl('adminhtml/nwdrevslider/slider/id/[slideid]');
     $useStaticLayers = $slider->getParam("enable_static_layers", "off");
     //treat in case of slides from gallery
     if ($slider->isSlidesFromPosts() == false) {
         $templateName = "slides_gallery";
         // store view
         $selectStoreView = Mage::app()->getLayout()->createBlock('core/html_select')->setName('select_storeview')->setId('select_storeview')->setTitle('Store View')->setValue($storeID)->setOptions(Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true))->getHtml();
         $this->assign('storeID', $storeID);
         $this->assign('selectStoreView', $selectStoreView);
         $this->setTemplate('nwdthemes/revslider/templates/slides_gallery.phtml');
     } else {
         //slides from posts
         $templateName = "slides_posts";
         $sourceType = $slider->getParam("source_type", "posts");
         $showSortBy = $sourceType == "posts" ? true : false;
         $showDelete = $sourceType == "specific_posts" ? true : false;
         //get button links
         $urlNewPost = $this->helper('adminhtml')->getUrl('adminhtml/catalog_product/new');
         $linkNewPost = UniteFunctionsRev::getHtmlLink($urlNewPost, $this->__("<i class='revicon-pencil-1'></i>New Product"), "button_new_post", "button-primary revblue", true);
         //get ordering
         $arrSortBy = $this->helper('nwdrevslider')->getArrSortBy();
         $sortBy = $slider->getParam("post_sortby", RevSlider::DEFAULT_POST_SORTBY);
         $selectSortBy = UniteFunctionsRev::getHTMLSelect($arrSortBy, $sortBy, "id='select_sortby'", true);
         $this->assign('showSortBy', $showSortBy);
         $this->assign('showDelete', $showDelete);
         $this->assign('selectSortBy', $selectSortBy);
         $this->assign('linkNewPost', $linkNewPost);
         $this->setTemplate('nwdthemes/revslider/templates/slides_posts.phtml');
     }
     $this->assign('sliderID', $sliderID);
     $this->assign('iframeStyle', $iframeStyle);
     $this->assign('patternViewSlide', $patternViewSlide);
     $this->assign('selectSliders', $selectSliders);
     $this->assign('linksSliderSettings', $linksSliderSettings);
     $this->assign('useStaticLayers', $useStaticLayers);
     $this->assign('arrSlides', $arrSlides);
     $this->assign('slider', $slider);
     $this->assign('numSlides', $numSlides);
     $this->assign('numSliders', $numSliders);
 }
开发者ID:perseusl,项目名称:kingdavid,代码行数:67,代码来源:Slides.php


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