本文整理匯總了PHP中CBlogTools::ResizeImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBlogTools::ResizeImage方法的具體用法?PHP CBlogTools::ResizeImage怎麽用?PHP CBlogTools::ResizeImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBlogTools
的用法示例。
在下文中一共展示了CBlogTools::ResizeImage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$arResult["filter"] = $arFilter;
$dbPost = CBlogPost::GetList($SORT, $arFilter, array("FAVORITE_SORT", "DATE_PUBLISH", "ID", "MAX" => "PERMS"), array("nTopCount" => $arParams["MESSAGE_COUNT"]));
$p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$bFirst = true;
while ($arPost = $dbPost->GetNext()) {
$CurPost = CBlogPost::GetByID($arPost["ID"]);
$CurPost = CBlogTools::htmlspecialcharsExArray($CurPost);
if ($bFirst) {
$CurPost["FIRST"] = "Y";
}
$bFirst = false;
$CurPost["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "post_id" => $CurPost["ID"]));
if (IntVal($CurPost["ATTACH_IMG"]) <= 0) {
$dbImage = CBlogImage::GetList(array("ID" => "ASC"), array("BLOG_ID" => $CurPost["BLOG_ID"], "POST_ID" => $CurPost["ID"]));
if ($arImage = $dbImage->Fetch()) {
if ($file = CBlogTools::ResizeImage($arImage["FILE_ID"], $arParams["PREVIEW_WIDTH"], $arParams["PREVIEW_HEIGHT"])) {
$arFile = CFile::MakeFileArray($_SERVER["DOCUMENT_ROOT"] . $file);
$arFile["MODULE_ID"] = "blog";
$fileID = CFile::SaveFile($arFile, "blog");
if (IntVal($fileID) > 0) {
$id = CBlogPost::Update($arPost["ID"], array("ATTACH_IMG" => $fileID));
$CurPost["IMG"] = CFile::ShowImage($fileID, false, false, 'align="left" hspace="2" vspace="2"');
}
$dbFile = CFile::GetByID($arImage["FILE_ID"]);
if ($arFile = $dbFile->Fetch()) {
if ("/" . COption::GetOptionString("main", "upload_dir", "upload") . "/" . $arFile["SUBDIR"] . $arFile["FILE_NAME"] != $file && is_file($file)) {
DeleteDirFilesEx($file);
}
}
}
}