本文整理匯總了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;
}
}