本文整理汇总了PHP中UniteFunctionsWPRev::getImageRealPathFromUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsWPRev::getImageRealPathFromUrl方法的具体用法?PHP UniteFunctionsWPRev::getImageRealPathFromUrl怎么用?PHP UniteFunctionsWPRev::getImageRealPathFromUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsWPRev
的用法示例。
在下文中一共展示了UniteFunctionsWPRev::getImageRealPathFromUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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";
$buttonRemoveID = $settingsID . "_button_remove";
$spanPreviewID = $buttonID . "_preview";
$img = "";
$value = UniteFunctionsRev::getVal($setting, "value");
if (!empty($value)) {
$urlImage = $value;
$imagePath = UniteFunctionsWPRev::getImageRealPathFromUrl($urlImage);
$img = '<div style="width:100px;height:70px;background:url(' . $urlImage . '); background-position:center center; background-size:cover;"></div>';
}
?>
<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;
?>
" style="width: 110px !important; float: left;" class='button-image-select button-primary revblue<?php
echo $class;
?>
' value="<?php
_e('Choose Image', REVSLIDER_TEXTDOMAIN);
?>
"></input>
<input type="button" class="button-image-remove button-primary revred" style="width: 110px !important;" id="<?php
echo $buttonRemoveID;
?>
" value="<?php
_e('Remove', REVSLIDER_TEXTDOMAIN);
?>
" />
<div class="clear"></div>
<?php
}
示例2: 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
}