當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XoopsMediaUploader::noAdminSizeCheck方法代碼示例

本文整理匯總了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;
    }
}
開發者ID:severnaya99,項目名稱:Sg-2010,代碼行數:33,代碼來源:functions.php


注:本文中的XoopsMediaUploader::noAdminSizeCheck方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。