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


PHP UniteFunctionsWPRev::getImageRealPathFromUrl方法代码示例

本文整理汇总了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 
    }
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:63,代码来源:settings_product.class.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 
    }
开发者ID:venkimithu,项目名称:npmgroups,代码行数:55,代码来源:settings_product.class.php


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