本文整理匯總了PHP中PwUpload::MakeThumb方法的典型用法代碼示例。如果您正苦於以下問題:PHP PwUpload::MakeThumb方法的具體用法?PHP PwUpload::MakeThumb怎麽用?PHP PwUpload::MakeThumb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PwUpload
的用法示例。
在下文中一共展示了PwUpload::MakeThumb方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
}
}
foreach ($diaryAttachs as $at) {
if ($at['type'] == 'img') {
$a_url = geturl($at['attachurl'], 'show');
$attach_ext = strtolower(substr(strrchr($a_url[0], '.'), 1));
$prename = substr(md5($timestamp . randstr(8)), 10, 15);
$filename = $winduid . "_{$did}_{$prename}.{$attach_ext}";
$attachurl = "{$savedir}/{$filename}";
$fileuplodeurl = "{$attachdir}/diary/{$attachurl}";
$uploadSerivce->postupload($a_url[0], $fileuplodeurl);
if ($db_ifathumb) {
$thumbdir = "thumb/diary/{$attachurl}";
$thumburl = "{$attachdir}/{$thumbdir}";
$ifthumb = 1;
$thumbsize = $uploadSerivce->MakeThumb($fileuplodeurl, $thumburl, $db_athumbsize, $ifthumb);
}
$data = array('did' => $did, 'uid' => $winduid, 'hits' => 0, 'name' => $at['name'], 'type' => $at['type'], 'size' => $at['size'], 'attachurl' => 'diary/' . $attachurl, 'needrvrc' => $at['needrvrc'], 'special' => $at['special'], 'ctype' => $at['ctype'], 'uploadtime' => $timestamp, 'descrip' => $at['descrip'], 'ifthumb' => 0);
$db->update("INSERT INTO pw_attachs SET " . S::sqlSingle($data));
$aid = $db->insert_id();
$data['aid'] = $aid;
$aids[] = $data['aid'];
$diaryAid[$aid] = $data;
}
}
//*=======拷貝圖片===========*//
$diaryAid = $diaryAid ? serialize($diaryAid) : '';
if ($aids) {
preg_match_all('/attachment=(\\d+)/i', $diary['content'], $result);
$diary['content'] = str_replace($result[1], $aids, $diary['content']);
}