本文整理汇总了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;
}
示例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;
}
示例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");
}
}
示例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");
}
}