本文整理汇总了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']);
}