本文整理汇总了PHP中ElggObject::getFilenameOnFilestore方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggObject::getFilenameOnFilestore方法的具体用法?PHP ElggObject::getFilenameOnFilestore怎么用?PHP ElggObject::getFilenameOnFilestore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggObject
的用法示例。
在下文中一共展示了ElggObject::getFilenameOnFilestore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pleiofile_generate_file_thumbs
function pleiofile_generate_file_thumbs(ElggObject $file)
{
if ($file->simpletype != "image") {
return null;
}
$file->icontime = time();
$sizes = array(60 => "thumb", 153 => "tinythumb", 153 => "smallthumb", 600 => "largethumb");
$filename = str_replace("file/", "", $file->getFilename());
foreach ($sizes as $size => $description) {
if ($size < 600) {
$upscale = true;
} else {
$upscale = false;
}
$thumbnail = get_resized_image_from_existing_file($file->getFilenameOnFilestore(), $size, $size, $upscale);
if ($thumbnail) {
$path = "file/" . $description . "_" . $filename;
$thumb = new ElggFile();
$thumb->setMimeType($_FILES['upload']['type']);
$thumb->setFilename($path);
$thumb->open("write");
$thumb->write($thumbnail);
$thumb->close();
if ($description == "thumb") {
$file->thumbnail = $path;
} else {
$file->{$description} = $path;
}
unset($thumbnail);
}
}
}
示例2: __construct
public function __construct(ElggObject $video)
{
parent::__construct();
$this->setInputfile($video->getFilenameOnFilestore());
$this->fileinfo = $this->execute();
}