本文整理汇总了PHP中format::urlencode_parts方法的典型用法代码示例。如果您正苦于以下问题:PHP format::urlencode_parts方法的具体用法?PHP format::urlencode_parts怎么用?PHP format::urlencode_parts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format
的用法示例。
在下文中一共展示了format::urlencode_parts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_thumbnail_url
public function get_thumbnail_url()
{
$root = SubfolioTheme::get_site_root();
if ($this->has_custom_thumbnail()) {
return $root . "directory/" . format::urlencode_parts($this->parent) . "/-thumbnails-custom/" . Filebrowser::double_encode_specialcharacters($this->get_custom_thumbnail_file_name());
} else {
$thumbnail = "-thumbnails/" . $this->name;
$url = $root . "directory/" . format::urlencode_parts($this->parent) . "/-thumbnails/" . Filebrowser::double_encode_specialcharacters(urlencode($this->name));
if (!file_exists("-thumbnails")) {
mkdir("-thumbnails", 0755, true);
}
$build_thumbnail = false;
if (!$this->has_thumbnail()) {
$build_thumbnail = true;
}
if ($build_thumbnail) {
$max_size = Kohana::config('filebrowser.thumbnail_max_filesize');
$stats = stat($this->name);
if ($stats['size'] > $max_size * 1024 * 1024) {
return '';
} else {
$thumbnail_width = SubfolioTheme::get_option('thumbnail_width', Kohana::config('filebrowser.thumbnail_width'));
$thumbnail_height = SubfolioTheme::get_option('thumbnail_height', Kohana::config('filebrowser.thumbnail_height'));
$info = @getimagesize($this->name);
if (isset($info[1])) {
if ($info[1] <= $thumbnail_height) {
} else {
$this->image = new Image($this->name);
if ($this->image) {
$this->image->resize($thumbnail_width, $thumbnail_height, Image::HEIGHT);
$this->image->save($thumbnail);
}
}
}
}
}
if (file_exists($thumbnail)) {
$thumbnail_stats = stat($thumbnail);
return $url . "?rnd=" . $thumbnail_stats['ctime'];
} else {
return '';
}
}
}
示例2: get_file_url
public function get_file_url()
{
$root = SubfolioTheme::get_site_root();
return $root . "directory/" . format::urlencode_parts($this->filepath);
}