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


PHP URLify::GetLatinSafeFileName方法代碼示例

本文整理匯總了PHP中URLify::GetLatinSafeFileName方法的典型用法代碼示例。如果您正苦於以下問題:PHP URLify::GetLatinSafeFileName方法的具體用法?PHP URLify::GetLatinSafeFileName怎麽用?PHP URLify::GetLatinSafeFileName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在URLify的用法示例。


在下文中一共展示了URLify::GetLatinSafeFileName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: UploadTovarImage

function UploadTovarImage($AFileInputName, $APath, $ANewFileName, $AMax_image_x, $AMax_image_y, $AWatermark_position = '', $AWatermark_FileRelativeURL = '', $AFixedSourceFileName = '', $ANewFileExt = '')
{
    $vError = "";
    $vFileRelativeURL = "";
    if (empty($AFixedSourceFileName)) {
        $ImgUploader = new Upload($_FILES[$AFileInputName], "ru_RU");
    } else {
        $ImgUploader = new Upload($AFixedSourceFileName, "ru_RU");
    }
    if ($ImgUploader->uploaded) {
        $ImgUploader->file_overwrite = true;
        //$ImgUploader->file_new_name_body = $ANewFileName;
        $ImgUploader->file_new_name_body = URLify::GetLatinSafeFileName($ANewFileName);
        if (!empty($ANewFileExt)) {
            $ImgUploader->file_new_name_ext = $ANewFileExt;
        }
        if (!empty($AWatermark_position) && $AWatermark_position != '00' && !empty($AWatermark_FileRelativeURL)) {
            $ImgUploader->image_watermark_position = $AWatermark_position;
            $ImgUploader->image_watermark = DIR_DBIMAGES . 'comission/' . $AWatermark_FileRelativeURL;
        }
        if ($AMax_image_x != 0 && $AMax_image_y != 0) {
            if ($ImgUploader->image_src_x > $AMax_image_x || $ImgUploader->image_src_y > $AMax_image_y) {
                $ImgUploader->image_resize = true;
                $ImgUploader->image_x = $AMax_image_x;
                $ImgUploader->image_y = $AMax_image_y;
                $ImgUploader->image_ratio = true;
            } else {
                $ImgUploader->image_resize = false;
                $ImgUploader->image_x = $ImgUploader->image_src_x;
                $ImgUploader->image_y = $ImgUploader->image_src_y;
                $ImgUploader->image_ratio = false;
            }
        }
        //$ImgUploader->image_convert = gif;
        //$ImgUploader->image_ratio_y = true;
        $UploadDir = MakeDirForWrite($APath);
        $ImgUploader->Process($UploadDir);
        if ($ImgUploader->processed) {
            $vFileRelativeURL = $APath . $ANewFileName . "." . $ImgUploader->file_dst_name_ext;
            $ImgUploader->Clean();
        } else {
            $vError = $ImgUploader->error;
        }
    } else {
        $vError = $ImgUploader->error;
    }
    return array($vError, $vFileRelativeURL);
}
開發者ID:AleksandrChukhray,項目名稱:good_deals,代碼行數:48,代碼來源:global.php


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