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


PHP UniteFunctionsWPRev::getUrlAttachmentImage方法代码示例

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


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

示例1: initByData

 /**
  * 
  * init slide by db record
  */
 public function initByData($record)
 {
     $this->id = $record["id"];
     $this->sliderID = $record["slider_id"];
     $this->slideOrder = $record["slide_order"];
     $params = $record["params"];
     $params = (array) json_decode($params);
     $layers = $record["layers"];
     $layers = (array) json_decode($layers);
     $layers = UniteFunctionsRev::convertStdClassToArray($layers);
     $imageID = UniteFunctionsRev::getVal($params, "image_id");
     //get image url and thumb url
     if (!empty($imageID)) {
         $this->imageID = $imageID;
         $imageUrl = UniteFunctionsWPRev::getUrlAttachmentImage($imageID);
         if (empty($imageUrl)) {
             $imageUrl = UniteFunctionsRev::getVal($params, "image");
         }
         $this->imageThumb = UniteFunctionsWPRev::getUrlAttachmentImage($imageID, UniteFunctionsWPRev::THUMB_MEDIUM);
     } else {
         $imageUrl = UniteFunctionsRev::getVal($params, "image");
     }
     //set image path, file and url
     $this->imageUrl = $imageUrl;
     $this->imageFilepath = UniteFunctionsWPRev::getImagePathFromURL($this->imageUrl);
     $realPath = UniteFunctionsWPRev::getPathContent() . $this->imageFilepath;
     if (file_exists($realPath) == false || is_file($realPath) == false) {
         $this->imageFilepath = "";
     }
     $this->imageFilename = basename($this->imageUrl);
     $this->params = $params;
     $this->arrLayers = $layers;
 }
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:37,代码来源:revslider_slide.class.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;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:22,代码来源:revslider_slide.class.php


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