当前位置: 首页>>代码示例>>PHP>>正文


PHP FileUpload::DoThumbs方法代码示例

本文整理汇总了PHP中FileUpload::DoThumbs方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUpload::DoThumbs方法的具体用法?PHP FileUpload::DoThumbs怎么用?PHP FileUpload::DoThumbs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUpload的用法示例。


在下文中一共展示了FileUpload::DoThumbs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: basename

        }
        // Is this a valid image?
        $strExtension = $CMS->GetExtensionFromPath($FU->GetDBFilePath());
        if (strtoupper($strExtension) != "JPG" && strtoupper($strExtension) != "PNG") {
            $blnSubmitForm = false;
            $strFileError = $CMS->Err_MWarn(M_ERR_UPLOAD_NOT_IMAGE, $FU->GetDBFilePath());
        }
    }
    if ($blnSubmitForm) {
        // Upload file
        $FU->Submit($_FILES['txtFile']['tmp_name']);
        if ($FU->IsError()) {
            $CMS->Err_MFail($FU->GetErrorDesc(), $FU->GetErrorInfo());
        }
        // Make thumbnails
        $FU->DoThumbs("");
        $strWarnings = $FU->GetWarnings();
        // Write to DB
        $dteCreated = $CMS->SYS->GetCurrentDateAndTime();
        $intFileID = $CMS->FL->Create($FU->GetDBAvatarThumb(), $intUserID, $dteCreated, "Avatar", "", "Y", "N", "", "");
        // Set avatar
        $CMS->Query("UPDATE {IFW_TBL_USERS} SET avatar_id = {$intFileID} WHERE id = {$intUserID}", basename(__FILE__), __LINE__);
        $CMS->SYS->CreateAccessLog("Set avatar (File ID: {$intFileID})", AL_TAG_AVATAR_SET, $intUserID);
        // Confirmation page
        $strHTML = "<h1>{$strPageTitle}</h1>\n\n<p>The file was uploaded and set as your avatar. <a href=\"{FN_ADM_MANAGE_AVATARS}\">Manage Avatars</a></p>";
        $CMS->AP->SetTitle($strPageTitle .= " - Results");
        $CMS->AP->Display($strHTML);
    }
}
// NO POST //
$strSubmitButton = $CMS->AC->Submit(M_BTN_UPLOAD_AVATAR);
开发者ID:benbarden,项目名称:injader,代码行数:31,代码来源:upload_avatar.php

示例2:

 // Process file attachment
 if ($blnHasAttachment) {
     // If there's an existing attachment and a new one is being uploaded, delete previous version
     if ($blnExistingAttachment && $_FILES['txtFile']['name']) {
         $strWarnings = $CMS->FL->UnlinkAll($intFileID);
     }
     // Upload file
     if ($FU->IsFileUpload()) {
         $FU->Submit($_FILES['txtFile']['tmp_name']);
         if ($FU->IsError()) {
             $CMS->Err_MFail($FU->GetErrorDesc(), $FU->GetErrorInfo());
         }
     }
     // Make thumbnails
     if ($blnExistingAttachment) {
         $FU->DoThumbs($intFileID);
     } else {
         $FU->DoThumbs("");
     }
     $strWarnings .= $FU->GetWarnings();
 }
 // Prepare content for database
 $CMS->AP->SetTitle($strPageTitle . " - Results");
 $strReadMoreEditor = $CMS->AddSlashesIFW($CMS->AC->ReadMoreEditor());
 $strReadMorePublic = $CMS->AddSlashesIFW($CMS->AC->ReadMorePublic());
 if (strpos($strContBody, $strReadMoreEditor) !== false) {
     $strReadMorePublic = str_replace("<", "{" . ZZZ_TEMP, $strReadMorePublic);
     $strReadMorePublic = str_replace(">", ZZZ_TEMP . "}", $strReadMorePublic);
     $strContBody = str_replace($strReadMoreEditor, $strReadMorePublic, $strContBody);
 }
 $strContBody = strip_tags($strContBody, C_ARTICLE_TAGS);
开发者ID:benbarden,项目名称:injader,代码行数:31,代码来源:write.php


注:本文中的FileUpload::DoThumbs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。