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


PHP RevSlider::getMaxOrder方法代码示例

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


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

示例1: createSlide

 /**
  * create the slide (from image)
  */
 public function createSlide($sliderID, $obj = "", $static = false)
 {
     $imageID = null;
     if (is_array($obj)) {
         $urlImage = RevSliderFunctions::getVal($obj, "url");
         $imageID = RevSliderFunctions::getVal($obj, "id");
     } else {
         $urlImage = $obj;
     }
     //get max order
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $maxOrder = $slider->getMaxOrder();
     $order = $maxOrder + 1;
     $params = array();
     if (!empty($urlImage)) {
         $params["background_type"] = "image";
         $params["image"] = $urlImage;
         if (!empty($imageID)) {
             $params["image_id"] = $imageID;
         }
     } else {
         //create transparent slide
         $params["background_type"] = "trans";
     }
     $jsonParams = json_encode($params);
     $arrInsert = array("params" => $jsonParams, "slider_id" => $sliderID, "layers" => "");
     if (!$static) {
         $arrInsert["slide_order"] = $order;
     }
     if (!$static) {
         $slideID = $this->db->insert(RevSliderGlobals::$table_slides, $arrInsert);
     } else {
         $slideID = $this->db->insert(RevSliderGlobals::$table_static_slides, $arrInsert);
     }
     return $slideID;
 }
开发者ID:hathbanger,项目名称:squab,代码行数:40,代码来源:slide.class.php

示例2: createSlide

 /**
  * 
  * create the slide (from image)
  */
 public function createSlide($sliderID, $urlImage)
 {
     //get max order
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $maxOrder = $slider->getMaxOrder();
     $order = $maxOrder + 1;
     $params = array();
     $params["image"] = $urlImage;
     $jsonParams = json_encode($params);
     $arrInsert = array("params" => $jsonParams, "slider_id" => $sliderID, "slide_order" => $order, "layers" => "");
     $slideID = $this->db->insert(GlobalsRevSlider::$table_slides, $arrInsert);
     return $slideID;
 }
开发者ID:nimishavyas,项目名称:proiti,代码行数:18,代码来源:revslider_slide.class.php

示例3: copyMoveSlide

 /**
  * 
  * copy / move slide
  */
 private function copyMoveSlide($slideID, $targetSliderID, $operation)
 {
     if ($operation == "move") {
         $targetSlider = new RevSlider();
         $targetSlider->initByID($targetSliderID);
         $maxOrder = $targetSlider->getMaxOrder();
         $newOrder = $maxOrder + 1;
         $arrUpdate = array("slider_id" => $targetSliderID, "slide_order" => $newOrder);
         //update children
         $arrChildren = $this->getArrSlideChildren($slideID);
         foreach ($arrChildren as $child) {
             $childID = $child->getID();
             $this->db->update(GlobalsRevSlider::$table_slides, $arrUpdate, array("id" => $childID));
         }
         $this->db->update(GlobalsRevSlider::$table_slides, $arrUpdate, array("id" => $slideID));
     } else {
         //in place of copy
         $newSlideID = $this->duplicateSlide($slideID);
         $this->duplicateChildren($slideID, $newSlideID);
         $this->copyMoveSlide($newSlideID, $targetSliderID, "move");
     }
 }
开发者ID:ConceptHaus,项目名称:huasca,代码行数:26,代码来源:revslider_slider.class.php

示例4: copyMoveSlide

 /**
  * 
  * copy / move slide
  */
 private function copyMoveSlide($slideID, $targetSliderID, $operation)
 {
     if ($operation == "move") {
         $targetSlider = new RevSlider();
         $targetSlider->initByID($targetSliderID);
         $maxOrder = $targetSlider->getMaxOrder();
         $newOrder = $maxOrder + 1;
         $arrUpdate = array("slider_id" => $targetSliderID, "slide_order" => $newOrder);
         $this->db->update(GlobalsRevSlider::$table_slides, $arrUpdate, array("id" => $slideID));
     } else {
         //in place of copy
         $this->duplicateSlide($slideID);
         $this->copyMoveSlide($slideID, $targetSliderID, "move");
     }
 }
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:19,代码来源:revslider_slider.class.php


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