本文整理汇总了PHP中RevSlide::initByStaticID方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlide::initByStaticID方法的具体用法?PHP RevSlide::initByStaticID怎么用?PHP RevSlide::initByStaticID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlide
的用法示例。
在下文中一共展示了RevSlide::initByStaticID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: putSlides
//.........这里部分代码省略.........
//check for kenburn & pan zoom
$kenburn_effect = $slide->getParam("kenburn_effect", "off");
//$kb_rotation_start = intval($slide->getParam("kb_rotation_start","0"));
//$kb_rotation_end = intval($slide->getParam("kb_rotation_end","0"));
$kb_duration = intval($slide->getParam("kb_duration", $this->slider->getParam("delay", 9000)));
$kb_ease = $slide->getParam("kb_easing", "Linear.easeNone");
$kb_start_fit = $slide->getParam("kb_start_fit", "100");
$kb_end_fit = $slide->getParam("kb_end_fit", "100");
$kb_pz = '';
if ($kenburn_effect == "on" && ($bgType == 'image' || $bgType == 'external')) {
$kb_pz .= ' data-kenburns="on"';
//$kb_pz.= ' data-rotationstart="'.$kb_rotation_start.'"';
//$kb_pz.= ' data-rotationend="'.$kb_rotation_end.'"';
$kb_pz .= ' data-duration="' . $kb_duration . '"';
$kb_pz .= ' data-ease="' . $kb_ease . '"';
$kb_pz .= ' data-bgfit="' . $kb_start_fit . '"';
$kb_pz .= ' data-bgfitend="' . $kb_end_fit . '"';
$bgEndPosition = $slide->getParam("bg_end_position", "center top");
$bgEndPositionX = intval($slide->getParam("bg_end_position_x", "0"));
$bgEndPositionY = intval($slide->getParam("bg_end_position_y", "0"));
if ($bgEndPosition == 'percentage') {
$kb_pz .= ' data-bgpositionend="' . $bgEndPositionX . '% ' . $bgEndPositionY . '%"';
} else {
$kb_pz .= ' data-bgpositionend="' . $bgEndPosition . '"';
}
//set image original width and height
//$imgSize = @getimagesize($urlSlideImage);
//if(is_array($imgSize) && !empty($imgSize)){
// $kb_pz.= ' data-owidth="'.$imgSize[0].'"';
// $kb_pz.= ' data-oheight="'.$imgSize[1].'"';
//}
} else {
//only set if kenburner is off
if ($bgFit == 'percentage') {
$imageAddParams .= ' data-bgfit="' . $bgFitX . '% ' . $bgFitY . '%"';
} else {
$imageAddParams .= ' data-bgfit="' . $bgFit . '"';
}
$imageAddParams .= ' data-bgrepeat="' . $bgRepeat . '"';
}
$thumbWidth = $this->slider->getParam("thumb_width", 100);
//add Slide Title if we have special navigation type choosen
$slide_title = '';
$class_attr = $slide->getParam("class_attr", "");
if ($class_attr !== '') {
$htmlParams .= ' class="' . $class_attr . '"';
}
$id_attr = $slide->getParam("id_attr", "");
if ($id_attr !== '') {
$htmlParams .= ' id="' . $id_attr . '"';
}
$attr_attr = $slide->getParam("attr_attr", "");
if ($attr_attr !== '') {
$htmlParams .= ' id="' . $attr_attr . '"';
}
$data_attr = stripslashes($slide->getParam("data_attr", ""));
if ($data_attr !== '') {
$htmlParams .= ' ' . $data_attr;
}
switch ($cur_slide_title) {
case 'preview1':
case 'preview2':
case 'preview3':
case 'preview4':
case 'custom':
//check if we are post based or normal slider
$slide_title = ' data-title="' . str_replace("\\'", "'", $slide->getParam("title", "Slide")) . '"';
break;
}
$slideCounter = $index + 1;
//Html
echo "\t<!-- SLIDE {$slideCounter}-->\n";
echo "\t<li data-transition=\"" . $transition . "\" data-slotamount=\"" . $slotAmount . "\" " . $add_rand . $htmlParams . $slide_title . ">\n";
echo "\t\t<!-- MAIN IMAGE -->\n";
echo "\t\t<img src=\"" . $urlSlideImage . "\" " . $styleImage . " alt=\"" . $alt . "\" " . $imageAddParams . $kb_pz . ">\n";
echo "\t\t<!-- LAYERS -->\n";
//put video:
if ($fullWidthVideoData["found"] == true) {
//backward compatability
$this->putFullWidthVideoLayer($fullWidthVideoData);
}
$this->putCreativeLayer($slide);
echo "\t</li>\n";
}
//get foreach
echo "</ul>\n";
//check for static layers
$useStaticLayers = $this->slider->getParam("enable_static_layers", "off");
if ($useStaticLayers == 'on') {
$sliderID = $this->slider->getID();
$staticID = $slide->getStaticSlideID($sliderID);
if ($staticID !== false) {
$static_slide = new RevSlide();
$static_slide->initByStaticID($staticID);
echo '<div class="tp-static-layers">' . "\n";
$this->putCreativeLayer($static_slide, true);
echo '</div>' . "\n";
}
}
}
示例2: RevSlide
//treat multilanguage
$isWpmlExists = RevSliderWpml::isWpmlExists();
$useWpml = $slider->getParam("use_wpml", "off");
$wpmlActive = false;
$jsonStaticLayers = "";
if (!$slide->isStaticSlide()) {
if ($isWpmlExists && $useWpml == "on") {
$wpmlActive = true;
$parentSlide = $slide->getParentSlide();
$arrChildLangs = $parentSlide->getArrChildrenLangs();
}
//get static slide, check all layers and add them to the action list
$static_slide_id = $slide->getStaticSlideID($sliderID);
if ($static_slide_id !== false) {
$static_slide = new RevSlide();
$static_slide->initByStaticID($static_slide_id);
$static_layers = $static_slide->getLayers();
$jsonStaticLayers = RevSliderFunctions::jsonEncodeForClientSide($static_layers);
}
}
?>
<script type="text/javascript">
/*
* Copyright 2015 Small Batch, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
示例3: getStaticSlideForExport
/**
*
* get slides for export
*/
private function getStaticSlideForExport($useDummy = false)
{
$arrSlidesExport = array();
$slide = new RevSlide();
$staticID = $slide->getStaticSlideID($this->id);
if ($staticID !== false) {
$slideNew = array();
$slide->initByStaticID($staticID);
$slideNew["params"] = $slide->getParamsForExport();
$slideNew["slide_order"] = $slide->getOrder();
$slideNew["layers"] = $slide->getLayersForExport($useDummy);
$arrSlidesExport[] = $slideNew;
}
return $arrSlidesExport;
}
示例4: putSlides
//.........这里部分代码省略.........
$htmlFirstTransWrap .= ' data-fstransition="' . $firstTransition . '"';
$firstDuration = $this->slider->getParam('first_transition_duration', '300');
if (!empty($firstDuration) && is_numeric($firstDuration)) {
$htmlFirstTransWrap .= ' data-fsmasterspeed="' . $firstDuration . '"';
}
$firstSlotAmount = $this->slider->getParam('first_transition_slot_amount', '7');
if (!empty($firstSlotAmount) && is_numeric($firstSlotAmount)) {
$htmlFirstTransWrap .= ' data-fsslotamount="' . $firstSlotAmount . '"';
}
}
$oneSlideLoop = $this->slider->getParam("loop_slide", "loop");
if (($oneSlideLoop == 'loop' || $oneSlideLoop == 'on') && $slider_type !== 'hero') {
if (count($slides) == 1 && $this->oneSlideMode == false) {
$new_slide = clone reset($slides);
$new_slide->ignore_alt = true;
$new_slide->setID($new_slide->getID() . '-1');
$slides[] = $new_slide;
$this->hasOnlyOneSlide = true;
}
}
if (count($slides) == 0) {
return false;
}
// No Slides added yet
$def_transition = $this->slider->getParam('def-slide_transition', 'fade');
$def_image_source_type = $this->slider->getParam('def-image_source_type', 'full');
$do_static = apply_filters('revslider_enable_static_layers', true);
if ($do_static) {
$sliderID = $this->slider->getID();
foreach ($slides as $slide) {
$staticID = $slide->getStaticSlideID($sliderID);
if ($staticID !== false) {
$static_slide = new RevSlide();
$static_slide->initByStaticID($staticID);
$this->static_slide = $static_slide;
}
break;
}
}
$index = 0;
foreach ($slides as $slide) {
$params = $slide->getParams();
$navigation_arrow_stlye = $this->slider->getParam('navigation_arrow_style', 'round');
$navigation_bullets_style = $this->slider->getParam('navigation_bullets_style', 'round');
//check if date is set
$date_from = $slide->getParam('date_from', '');
$date_to = $slide->getParam('date_to', '');
if ($this->previewMode === false) {
// do only if we are not in preview mode
$ts = current_time('timestamp');
if ($date_from != '') {
$date_from = strtotime($date_from);
if ($ts < $date_from) {
continue;
}
}
if ($date_to != '') {
$date_to = strtotime($date_to);
if ($ts > $date_to) {
continue;
}
}
}
$transition = $slide->getParam('slide_transition', $def_transition);
if (!is_array($transition)) {
$transition_arr = explode(',', $transition);
示例5: putSlides
//.........这里部分代码省略.........
$imageAddParams = "";
if ($lazyLoad == "on") {
$imageAddParams .= "data-lazyload=\"{$urlSlideImage}\"";
$urlSlideImage = UniteBaseClassRev::$url_plugin . "images/dummy.png";
}
$bgFit = $slide->getParam("bg_fit", "cover");
$bgFitX = intval($slide->getParam("bg_fit_x", "100"));
$bgFitY = intval($slide->getParam("bg_fit_y", "100"));
$bgPosition = $slide->getParam("bg_position", "center top");
$bgPositionX = intval($slide->getParam("bg_position_x", "0"));
$bgPositionY = intval($slide->getParam("bg_position_y", "0"));
$bgRepeat = $slide->getParam("bg_repeat", "no-repeat");
if ($bgPosition == 'percentage') {
$imageAddParams .= ' data-bgposition="' . $bgPositionX . '% ' . $bgPositionY . '%"';
} else {
$imageAddParams .= ' data-bgposition="' . $bgPosition . '"';
}
$kenburn_effect = $slide->getParam("kenburn_effect", "off");
$kb_duration = intval($slide->getParam("kb_duration", $this->slider->getParam("delay", 9000)));
$kb_ease = $slide->getParam("kb_easing", "Linear.easeNone");
$kb_start_fit = $slide->getParam("kb_start_fit", "100");
$kb_end_fit = $slide->getParam("kb_end_fit", "100");
$kb_pz = '';
if ($kenburn_effect == "on" && ($bgType == 'image' || $bgType == 'external')) {
$kb_pz .= ' data-kenburns="on"';
$kb_pz .= ' data-duration="' . $kb_duration . '"';
$kb_pz .= ' data-ease="' . $kb_ease . '"';
$kb_pz .= ' data-bgfit="' . $kb_start_fit . '"';
$kb_pz .= ' data-bgfitend="' . $kb_end_fit . '"';
$bgEndPosition = $slide->getParam("bg_end_position", "center top");
$bgEndPositionX = intval($slide->getParam("bg_end_position_x", "0"));
$bgEndPositionY = intval($slide->getParam("bg_end_position_y", "0"));
if ($bgEndPosition == 'percentage') {
$kb_pz .= ' data-bgpositionend="' . $bgEndPositionX . '% ' . $bgEndPositionY . '%"';
} else {
$kb_pz .= ' data-bgpositionend="' . $bgEndPosition . '"';
}
} else {
if ($bgFit == 'percentage') {
$imageAddParams .= ' data-bgfit="' . $bgFitX . '% ' . $bgFitY . '%"';
} else {
$imageAddParams .= ' data-bgfit="' . $bgFit . '"';
}
$imageAddParams .= ' data-bgrepeat="' . $bgRepeat . '"';
}
$thumbWidth = $this->slider->getParam("thumb_width", 100);
$slide_title = '';
$class_attr = $slide->getParam("class_attr", "");
if ($class_attr !== '') {
$htmlParams .= ' class="' . $class_attr . '"';
}
$id_attr = $slide->getParam("id_attr", "");
if ($id_attr !== '') {
$htmlParams .= ' id="' . $id_attr . '"';
}
$attr_attr = $slide->getParam("attr_attr", "");
if ($attr_attr !== '') {
$htmlParams .= ' id="' . $attr_attr . '"';
}
$data_attr = stripslashes($slide->getParam("data_attr", ""));
if ($data_attr !== '') {
$htmlParams .= ' ' . $data_attr;
}
switch ($cur_slide_title) {
case 'preview1':
case 'preview2':
case 'preview3':
case 'preview4':
case 'custom':
if ($templateSlider) {
$new_title = @get_the_title($slide->getID());
$slide_title = ' data-title="' . str_replace("\\'", "'", $new_title) . '"';
} else {
$slide_title = ' data-title="' . str_replace("\\'", "'", $slide->getParam("title", "Slide")) . '"';
}
break;
}
echo "\t<!-- SLIDE -->\n";
echo "\t<li data-transition=\"" . $transition . "\" data-slotamount=\"" . $slotAmount . "\" " . $add_rand . $htmlParams . $slide_title . ">\n";
echo "\t\t<!-- MAIN IMAGE -->\n";
echo "\t\t<img src=\"" . $urlSlideImage . "\" " . $styleImage . " alt=\"" . $alt . "\" " . $imageAddParams . $kb_pz . ">\n";
echo "\t\t<!-- LAYERS -->\n";
if ($fullWidthVideoData["found"] == true) {
$this->putFullWidthVideoLayer($fullWidthVideoData);
}
$this->putCreativeLayer($slide);
echo "\t</li>\n";
}
echo "</ul>\n";
$useStaticLayers = $this->slider->getParam("enable_static_layers", "off");
if ($useStaticLayers == 'on') {
$sliderID = $this->slider->getID();
$staticID = $slide->getStaticSlideID($sliderID);
if ($staticID !== false) {
$static_slide = new RevSlide();
$static_slide->initByStaticID($staticID);
echo '<div class="tp-static-layers">' . "\n";
$this->putCreativeLayer($static_slide, true);
echo '</div>' . "\n";
}