本文整理汇总了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);
示例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);