本文整理汇总了PHP中XoopsMediaUploader::noAdminSizeCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsMediaUploader::noAdminSizeCheck方法的具体用法?PHP XoopsMediaUploader::noAdminSizeCheck怎么用?PHP XoopsMediaUploader::noAdminSizeCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsMediaUploader
的用法示例。
在下文中一共展示了XoopsMediaUploader::noAdminSizeCheck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: genobio_uploading
function genobio_uploading($uploaddir = "uploads", $allowed_mimetypes = '', $redirecturl = "index.php", $num = 0, $redirect = 0, $usertype = 1, $index = 0)
{
global $_FILES, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
$down = array();
include_once XOOPS_ROOT_PATH . "/modules/genobio/class/uploader.php";
$upload_dir = XOOPS_ROOT_PATH . "/" . $uploaddir . "/";
genobio_makeWritable($upload_dir);
$maxfilesize = isset($xoopsModuleConfig['maxfilesize']) ? $xoopsModuleConfig['maxfilesize'] : 10000000000.0;
$maxfilewidth = isset($xoopsModuleConfig['maximgwidth']) ? $xoopsModuleConfig['maximgwidth'] : 5000;
$maxfileheight = isset($xoopsModuleConfig['maximgheight']) ? $xoopsModuleConfig['maximgheight'] : 5000;
$uploader = new XoopsMediaUploader($upload_dir, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
$uploader->setPrefix('img_' . time());
$uploader->noAdminSizeCheck(1);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][$num])) {
if (!$uploader->upload()) {
$down['error'] = $uploader->getErrors();
return $down;
} else {
if ($redirect) {
redirect_header($redirecturl, 1, _AM_PDD_UPLOADFILE);
} else {
if (is_file($uploader->savedDestination)) {
$down['path'] = "/" . $uploaddir . "/" . strtolower($uploader->savedFileName);
$down['size'] = filesize(XOOPS_ROOT_PATH . "/" . $uploaddir . "/" . strtolower($uploader->savedFileName));
}
return $down;
}
}
} else {
$down['error'] = $uploader->getErrors();
return $down;
}
}