本文整理汇总了PHP中Gallery::imageUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Gallery::imageUrl方法的具体用法?PHP Gallery::imageUrl怎么用?PHP Gallery::imageUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gallery
的用法示例。
在下文中一共展示了Gallery::imageUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: image
function image($image_url, $link_url = false)
{
$HTML = Gallery::imageUrl($url);
$this->HTML[] = $link_url ? Link::url($link_url, $HTML, "id={$this->record_id}") : $HTML;
}
示例2: url
function url($url, $size = false, $dimensions = false, $get_still_image = false, $field_name = false, $img_size_persist = false)
{
global $CFG;
if (!is_array(self::$image_sizes) || !$img_size_persist) {
self::$image_sizes = DB::getImageSizes($field_name);
}
if ($size && array_key_exists($size, self::$image_sizes)) {
$suffix = '_' . $size;
$dimensions = $dimensions ? $dimensions : self::$image_sizes[$size];
}
if (strstr($url, "<embed")) {
$url = String::getUrlFromEmbed($url);
}
$path = pathinfo($url);
$ext = $path['extension'];
if (in_array($ext, $CFG->accepted_image_formats)) {
return "<img src=\"{$url}\" height=\"{$dimensions['height']}\" width=\"{$dimensions['width']}\" />";
} elseif (in_array($ext, $CFG->accepted_audio_formats)) {
} else {
if (strstr($url, "youtube") || strstr($url, 'youtu.be')) {
if (!$get_still_image) {
$url = strstr($url, 'youtu.be') ? str_ireplace('youtu.be', 'youtube.com/embed', $url) : $url;
return '<iframe width="' . $dimensions['width'] . '" height="' . $dimensions['height'] . '" src="' . $url . '" frameborder="0" allowfullscreen></iframe>';
//return '<object width="'.$dimensions['width'].'" height="'.$dimensions['height'].'"><param name="movie" value="'.$url.'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="'.$url.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$dimensions['width'].'" height="'.$dimensions['height'].'"></embed></object>';
} else {
$url = str_ireplace('http://www.youtube.com/v/', '', $url);
$url1 = explode('&', $url);
$key = $url1[0];
return Gallery::imageUrl('http://i2.ytimg.com/vi/' . $key . '/default.jpg', $dimensions, $field_name, true);
}
}
}
}