本文整理汇总了PHP中UniteFunctionsWPRev::getPathContent方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsWPRev::getPathContent方法的具体用法?PHP UniteFunctionsWPRev::getPathContent怎么用?PHP UniteFunctionsWPRev::getPathContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsWPRev
的用法示例。
在下文中一共展示了UniteFunctionsWPRev::getPathContent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: initByData
public function initByData($record)
{
if (isset($record["id"])) {
$this->id = $record["id"];
}
if (isset($record["slider_id"])) {
$this->sliderID = $record["slider_id"];
}
if (isset($record["slide_order"])) {
$this->slideOrder = $record["slide_order"];
}
$params = $record["params"];
if (get_magic_quotes_gpc()) {
//changes made 1st Apr 2014
$params = stripslashes($params);
}
$params = (array) json_decode($params);
$layers = $record["layers"];
if (get_magic_quotes_gpc()) {
//changes made 1st Apr 2014
$layers = stripslashes($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");
}
if (is_ssl()) {
$imageUrl = str_replace("http://", "https://", $imageUrl);
}
//dmp($imageUrl);exit();
//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;
$ijk = 0;
foreach ($layers as $layer) {
if (isset($layer['image_url']) && !empty($layer['image_url'])) {
$layers[$ijk]['image_url'] = modify_image_url($layers[$ijk]['image_url']);
}
$ijk++;
}
$this->arrLayers = $layers;
}
示例3: 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);
//set image path, file and url
$this->imageUrl = UniteFunctionsRev::getVal($params, "image");
$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;
}
示例4: setImageByImageID
/**
*
* set slide image by image id
*/
private function setImageByImageID($imageID)
{
$this->imageID = $imageID;
$this->imageUrl = UniteFunctionsWPRev::getUrlAttachmentImage($imageID);
$this->imageThumb = UniteFunctionsWPRev::getUrlAttachmentImage($imageID, UniteFunctionsWPRev::THUMB_MEDIUM);
if (empty($this->imageUrl)) {
return false;
}
$this->params["background_type"] = "image";
if (is_ssl()) {
$this->imageUrl = str_replace("http://", "https://", $this->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);
}
示例5: onShowImage
/**
*
* on show image ajax event. outputs image with parameters
*/
public static function onShowImage()
{
$pathImages = UniteFunctionsWPRev::getPathContent();
$urlImages = UniteFunctionsWPRev::getUrlContent();
try {
$imageView = new UniteImageViewRev(self::$path_cache, $pathImages, $urlImages);
$imageView->showImageFromGet();
} catch (Exception $e) {
header("status: 500");
echo $e->getMessage();
exit;
}
}
示例6: getImageRealPathFromUrl
/**
* get image real path phisical on disk from url
*/
public static function getImageRealPathFromUrl($urlImage)
{
$filepath = self::getImagePathFromURL($urlImage);
$realPath = UniteFunctionsWPRev::getPathContent() . $filepath;
return $realPath;
}
示例7: onShowImage
/**
*
* on show image ajax event. outputs image with parameters
*/
public static function onShowImage()
{
$img = Tools::getValue('img');
if (empty($img)) {
die('Image doesn\'t exists!');
}
$pathImages = UniteFunctionsWPRev::getPathContent();
$urlImages = UniteFunctionsWPRev::getUrlContent();
try {
$imageView = new UniteImageViewRev(self::$path_cache, $pathImages, $urlImages);
$imageView->showImageFromGet();
} catch (Exception $e) {
header("status: 500");
echo $e->getMessage();
exit;
}
}