本文整理汇总了PHP中cms_utils::generate_thumbnail方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::generate_thumbnail方法的具体用法?PHP cms_utils::generate_thumbnail怎么用?PHP cms_utils::generate_thumbnail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms_utils
的用法示例。
在下文中一共展示了cms_utils::generate_thumbnail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: after_uploaded_file
protected function after_uploaded_file($fileobject)
{
// here we may do image handling, and other cruft.
if (is_object($fileobject) && $fileobject->name != '') {
$mod = cms_utils::get_module('FileManager');
$parms = array();
$parms['file'] = filemanager_utils::join_path(filemanager_utils::get_full_cwd(), $fileobject->name);
if ($mod->GetPreference('create_thumbnails')) {
$thumb = cms_utils::generate_thumbnail($parms['file']);
if ($thumb) {
$params['thumb'] = $thumb;
}
}
$str = $fileobject->name . ' uploaded to ' . filemanager_utils::get_full_cwd();
if (isset($params['thumb'])) {
$str .= ' and a thumbnail was generated';
}
audit('', $mod->GetName(), $str);
$mod->SendEvent('OnFileUploaded', $parms);
}
}
示例2: cmsms
$params["fmerror"] = "morethanonefiledirselected";
$this->Redirect($id, "defaultadmin", $returnid, $params);
}
$advancedmode = filemanager_utils::check_advanced_mode();
$basedir = $config['root_path'];
$config = cmsms()->GetConfig();
$filename = $this->decodefilename($selall[0]);
$src = filemanager_utils::join_path($basedir, filemanager_utils::get_cwd(), $filename);
if (!file_exists($src)) {
$params["fmerror"] = "filenotfound";
$this->Redirect($id, "defaultadmin", $returnid, $params);
}
$thumb = filemanager_utils::join_path($basedir, filemanager_utils::get_cwd(), 'thumb_' . $filename);
if (isset($params['submit'])) {
$thumb = filemanager_utils::join_path($basedir, filemanager_utils::get_cwd(), 'thumb_' . $filename);
$thumb = cms_utils::generate_thumbnail($src);
if (!$thumb) {
$params["fmerror"] = "thumberror";
} else {
$params["fmmessage"] = "thumbsuccess";
}
$this->Redirect($id, "defaultadmin", $returnid, $params);
}
//
// build the form
//
$smarty->assign('filename', $filename);
$smarty->assign('filespec', $src);
$smarty->assign('thumb', $thumb);
$smarty->assign('thumbexists', file_exists($thumb));
if (is_array($selall)) {