本文整理汇总了PHP中UniteBaseClassRev::getImageUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteBaseClassRev::getImageUrl方法的具体用法?PHP UniteBaseClassRev::getImageUrl怎么用?PHP UniteBaseClassRev::getImageUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteBaseClassRev
的用法示例。
在下文中一共展示了UniteBaseClassRev::getImageUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawImageInput
/**
*
* draw imaeg input:
* @param $setting
*/
protected function drawImageInput($setting)
{
$class = UniteFunctionsRev::getVal($setting, "class");
if (!empty($class)) {
$class = "class='{$class}'";
}
$settingsID = $setting["id"];
$buttonID = $settingsID . "_button";
$spanPreviewID = $buttonID . "_preview";
$img = "";
$value = UniteFunctionsRev::getVal($setting, "value");
if (!empty($value)) {
$urlImage = $value;
$imagePath = UniteFunctionsWPRev::getImageRealPathFromUrl($urlImage);
if (file_exists($realPath)) {
$filepath = UniteFunctionsWPRev::getImagePathFromURL($urlImage);
$urlImage = UniteBaseClassRev::getImageUrl($filepath, 100, 70, true);
}
$img = "<img width='100' height='70' src='{$urlImage}'></img>";
}
?>
<span id='<?php
echo $spanPreviewID;
?>
' class='setting-image-preview'><?php
echo $img;
?>
</span>
<input type="hidden" id="<?php
echo $setting["id"];
?>
" name="<?php
echo $setting["name"];
?>
" value="<?php
echo $setting["value"];
?>
" />
<input type="button" id="<?php
echo $buttonID;
?>
" class='button-image-select <?php
echo $class;
?>
' value="Choose Image"></input>
<?php
}
示例2: getUrlImageThumb
/**
*
* get thumb url
*/
public function getUrlImageThumb()
{
//get image url by thumb
if (!empty($this->imageID)) {
$urlImage = UniteFunctionsWPRev::getUrlAttachmentImage($this->imageID, UniteFunctionsWPRev::THUMB_MEDIUM);
} else {
//get from cache
if (!empty($this->imageFilepath)) {
$urlImage = UniteBaseClassRev::getImageUrl($this->imageFilepath, 200, 100, true);
} else {
$urlImage = $this->imageUrl;
}
}
if (empty($urlImage)) {
$urlImage = $this->imageUrl;
}
return $urlImage;
}
示例3: putSlides
/**
*
* put the slider slides
*/
private function putSlides()
{
$sliderType = $this->slider->getParam("slider_type");
$publishedOnly = true;
if ($this->previewMode == true && $this->oneSlideMode == true) {
$previewSlideID = UniteFunctionsRev::getVal($this->oneSlideData, "slideid");
$previewSlide = new RevSlide();
$previewSlide->initByID($previewSlideID);
$slides = array($previewSlide);
} else {
$slides = $this->slider->getSlidesForOutput($publishedOnly, $this->sliderLang);
}
$this->slidesNumIndex = $this->slider->getSlidesNumbersByIDs(true);
if (empty($slides)) {
?>
<div class="no-slides-text">
No slides found, please add some slides
</div>
<?php
}
$thumbWidth = $this->slider->getParam("thumb_width", 100);
$thumbHeight = $this->slider->getParam("thumb_height", 50);
$slideWidth = $this->slider->getParam("width", 900);
$slideHeight = $this->slider->getParam("height", 300);
$navigationType = $this->slider->getParam("navigaion_type", "none");
$isThumbsActive = $navigationType == "thumb" ? true : false;
//for one slide preview
if ($this->oneSlideMode == true) {
$slides = $this->filterOneSlide($slides);
}
?>
<ul>
<?php
foreach ($slides as $index => $slide) {
$params = $slide->getParams();
//check if date is set
$date_from = $slide->getParam("date_from", "");
$date_to = $slide->getParam("date_to", "");
if ($date_from != "") {
$date_from = strtotime($date_from);
if (time() < $date_from) {
continue;
}
}
if ($date_to != "") {
$date_to = strtotime($date_to);
if (time() > $date_to) {
continue;
}
}
$transition = $slide->getParam("slide_transition", "random");
$slotAmount = $slide->getParam("slot_amount", "7");
$urlSlideImage = $slide->getImageUrl();
//get image alt
$imageFilename = $slide->getImageFilename();
$info = pathinfo($imageFilename);
$alt = $info["filename"];
//get thumb url
$htmlThumb = "";
if ($isThumbsActive == true) {
$urlThumb = $slide->getParam("slide_thumb", "");
if (empty($urlThumb)) {
//try to get resized thumb
$pathThumb = $slide->getImageFilepath();
if (!empty($pathThumb)) {
$urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
}
}
//if not - put regular image:
if (empty($urlThumb)) {
$urlThumb = $slide->getImageUrl();
}
$htmlThumb = 'data-thumb="' . $urlThumb . '" ';
}
//get link
$htmlLink = "";
$enableLink = $slide->getParam("enable_link", "false");
if ($enableLink == "true") {
$linkType = $slide->getParam("link_type", "regular");
switch ($linkType) {
//---- normal link
default:
case "regular":
$link = $slide->getParam("link", "");
$linkOpenIn = $slide->getParam("link_open_in", "same");
$htmlTarget = "";
if ($linkOpenIn == "new") {
$htmlTarget = ' data-target="_blank"';
}
$htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
break;
//---- link to slide
//---- link to slide
case "slide":
$slideLink = UniteFunctionsRev::getVal($params, "slide_link");
if (!empty($slideLink) && $slideLink != "nothing") {
//.........这里部分代码省略.........
示例4: putSlides
/**
*
* put the slider slides
*/
private function putSlides($doWrapFromTemplate)
{
//go to template slider if post template
if ($doWrapFromTemplate !== false) {
$this->slider->initByMixed($doWrapFromTemplate);
}
//back to original Slider
$sliderType = $this->slider->getParam("slider_type");
$publishedOnly = true;
if ($this->previewMode == true && $this->oneSlideMode == true) {
$previewSlideID = UniteFunctionsRev::getVal($this->oneSlideData, "slideid");
$previewSlide = new RevSlide();
$previewSlide->initByID($previewSlideID);
$slides = array($previewSlide);
} else {
$slides = $this->slider->getSlidesForOutput($publishedOnly, $this->sliderLang);
}
$this->slidesNumIndex = $this->slider->getSlidesNumbersByIDs(true);
if (empty($slides)) {
?>
<div class="no-slides-text">
No slides found, please add some slides
</div>
<?php
}
//go back to normal slider if post template
if ($doWrapFromTemplate) {
$this->slider->initByMixed($this->slider->getParam("slider_template_id", false));
}
//back to template for JS
$thumbWidth = $this->slider->getParam("thumb_width", 100);
$thumbHeight = $this->slider->getParam("thumb_height", 50);
$slideWidth = $this->slider->getParam("width", 900);
$slideHeight = $this->slider->getParam("height", 300);
$navigationType = $this->slider->getParam("navigaion_type", "none");
$isThumbsActive = $navigationType == "thumb" ? true : false;
$lazyLoad = $this->slider->getParam("lazy_load", "off");
//for one slide preview
if ($this->oneSlideMode == true) {
$slides = $this->filterOneSlide($slides);
}
echo "<ul>";
$htmlFirstTransWrap = "";
$startWithSlide = $this->slider->getStartWithSlideSetting();
$firstTransActive = $this->slider->getParam("first_transition_active", "false");
if ($firstTransActive == "true") {
$firstTransition = $this->slider->getParam("first_transition_type", "fade");
$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}\"";
}
}
if (count($slides) == 1 && $this->oneSlideMode == false) {
$slides[] = $slides[0];
$this->hasOnlyOneSlide = true;
}
foreach ($slides as $index => $slide) {
$params = $slide->getParams();
//check if date is set
$date_from = $slide->getParam("date_from", "");
$date_to = $slide->getParam("date_to", "");
if ($date_from != "") {
$date_from = strtotime($date_from);
if (time() < $date_from) {
continue;
}
}
if ($date_to != "") {
$date_to = strtotime($date_to);
if (time() > $date_to) {
continue;
}
}
$transition = $slide->getParam("slide_transition", "random");
//if($transition == "fade") $transition = "tp-fade";
//$transitionPremium = $slide->getParam("slide_transition_premium","random");
//if(trim($transition) == '')
// $transition = $transitionPremium;
//else
// if(trim($transitionPremium) != '') $transition .= ','.$transitionPremium;
$slotAmount = $slide->getParam("slot_amount", "7");
$isExternal = $slide->getParam("background_type", "image");
if ($isExternal != "external") {
$urlSlideImage = $slide->getImageUrl();
//get image alt
$imageFilename = $slide->getImageFilename();
$info = pathinfo($imageFilename);
$alt = $info["filename"];
} else {
$urlSlideImage = $slide->getParam("slide_bg_external", "");
$info = '';
//.........这里部分代码省略.........
示例5: putSlides
/**
*
* put the slider slides
*/
private function putSlides()
{
$sliderType = $this->slider->getParam("slider_type");
$slides = $this->slider->getSlides();
$this->slidesNumIndex = $this->slider->getSlidesNumbersByIDs();
if (empty($slides)) {
?>
<div class="no-slides-text">
No slides found, please add some slides
</div>
<?php
}
$thumbWidth = $this->slider->getParam("thumb_width", 100);
$thumbHeight = $this->slider->getParam("thumb_height", 50);
$slideWidth = $this->slider->getParam("width", 900);
$slideHeight = $this->slider->getParam("height", 300);
$navigationType = $this->slider->getParam("navigaion_type", "none");
$isThumbsActive = $navigationType == "thumb" ? true : false;
//for one slide preview
if ($this->oneSlideMode == true) {
$slides = $this->filterOneSlide($slides);
}
?>
<ul>
<?php
foreach ($slides as $slide) {
$params = $slide->getParams();
$transition = $slide->getParam("slide_transition", "random");
$slotAmount = $slide->getParam("slot_amount", "7");
$urlSlideImage = $slide->getImageUrl();
//get image alt
$imageFilename = $slide->getImageFilename();
$info = pathinfo($imageFilename);
$alt = $info["filename"];
//get thumb url
$htmlThumb = "";
if ($isThumbsActive == true) {
$urlThumb = $slide->getParam("slide_thumb", "");
if (empty($urlThumb)) {
//try to get resized thumb
$pathThumb = $slide->getImageFilepath();
if (!empty($pathThumb)) {
$urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
}
}
//if not - put regular image:
if (empty($urlThumb)) {
$urlThumb = $slide->getImageUrl();
}
$htmlThumb = 'data-thumb="' . $urlThumb . '" ';
}
//get link
$htmlLink = "";
$enableLink = $slide->getParam("enable_link", "false");
if ($enableLink == "true") {
$linkType = $slide->getParam("link_type", "regular");
switch ($linkType) {
//---- normal link
default:
case "regular":
$link = $slide->getParam("link", "");
$linkOpenIn = $slide->getParam("link_open_in", "same");
$htmlTarget = "";
if ($linkOpenIn == "new") {
$htmlTarget = ' data-target="_blank"';
}
$htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
break;
//---- link to slide
//---- link to slide
case "slide":
$slideLink = UniteFunctionsRev::getVal($params, "slide_link");
if (!empty($slideLink) && $slideLink != "nothing") {
//get slide index from id
if (is_numeric($slideLink)) {
$slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink);
}
if (!empty($slideLink)) {
$htmlLink = "data-link=\"slide\" data-linktoslide=\"{$slideLink}\" ";
}
}
break;
}
//set link position:
$linkPos = UniteFunctionsRev::getVal($params, "link_pos", "front");
if ($linkPos == "back") {
$htmlLink .= ' data-slideindex="back"';
}
}
//set delay
$htmlDelay = "";
$delay = $slide->getParam("delay", "");
if (!empty($delay) && is_numeric($delay)) {
$htmlDelay = "data-delay=\"{$delay}\" ";
}
//get duration
//.........这里部分代码省略.........
示例6: putSlides
/**
*
* put the slider slides
*/
private function putSlides()
{
$slides = $this->slider->getSlides();
if (empty($slides)) {
?>
<div class="no-slides-text">
No slides found, please add some slides
</div>
<?php
}
$thumbWidth = $this->slider->getParam("thumb_width", 100);
$thumbHeight = $this->slider->getParam("thumb_height", 50);
$slideWidth = $this->slider->getParam("width", 900);
$slideHeight = $this->slider->getParam("height", 300);
$navigationType = $this->slider->getParam("navigaion_type", "none");
$isThumbsActive = $navigationType == "thumb" ? true : false;
$flagReize = $this->slider->getParam("php_resize", "none");
$flagReize = $flagReize == "on" ? true : false;
?>
<ul>
<?php
foreach ($slides as $slide) {
$params = $slide->getParams();
$transition = $slide->getParam("slide_transition", "random");
$slotAmount = $slide->getParam("slot_amount", "7");
$urlSlideImage = $slide->getImageUrl();
if ($flagReize == true) {
$pathSlideImage = $slide->getImageFilepath();
if (!empty($pathSlideImage)) {
$urlSlideImage = UniteBaseClassRev::getImageUrl($pathSlideImage, $slideWidth, $slideHeight, true);
}
}
//get thumb url
$htmlThumb = "";
if ($isThumbsActive == true) {
$urlThumb = $slide->getParam("slide_thumb", "");
if (empty($urlThumb)) {
//try to get resized thumb
$pathThumb = $slide->getImageFilepath();
if (!empty($pathThumb)) {
$urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
}
}
//if not - put regular image:
if (empty($urlThumb)) {
$urlThumb = $slide->getImageUrl();
}
$htmlThumb = 'data-thumb="' . $urlThumb . '" ';
}
//get link
$htmlLink = "";
$enableLink = $slide->getParam("enable_link", "false");
if ($enableLink == "true") {
$link = $slide->getParam("link", "");
$linkOpenIn = $slide->getParam("link_open_in", "same");
$htmlTarget = "";
if ($linkOpenIn == "new") {
$htmlTarget = ' data-target="_blank"';
}
$htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
}
//set delay
$htmlDelay = "";
$delay = $slide->getParam("delay", "");
if (!empty($delay) && is_numeric($delay)) {
$htmlDelay = "data-delay=\"{$delay}\" ";
}
//get duration
$htmlDuration = "";
$duration = $slide->getParam("transition_duration", "");
if (!empty($duration) && is_numeric($duration)) {
$htmlDuration = "data-masterspeed=\"{$duration}\" ";
}
//get rotation
$htmlRotation = "";
$rotation = $slide->getParam("transition_rotation", "");
if (!empty($rotation)) {
$rotation = (int) $rotation;
if ($rotation != 0) {
if ($rotation > 720 && $rotation != 999) {
$rotation = 720;
}
if ($rotation < -720) {
$rotation = -720;
}
}
$htmlRotation = "data-rotate=\"{$rotation}\" ";
}
$videoData = $this->getSlideFullWidthVideoData($slide);
$htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation;
//Html
?>
<li data-transition="<?php
echo $transition;
?>
" data-slotamount="<?php
//.........这里部分代码省略.........