當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。