代码如下:
$focus_file = $focus_link = $focus_text = array();
foreach($focusimg as $imgs) {
$focus_text[] = $imgs[0];
$focus_file[] = PUBATTURL.(!$autofocus? $imgsdir : '').$imgs[3];
$focus_link[] = trim($imgs[2]);
}
$focus_text = implode(' | ', $focus_text);
$focus_file = implode(' | ', $focus_file);
$focus_link = implode(' | ', $focus_link);
$hotimgs = $aggregation['hotimgs'] ? $aggregation['hotimgs'] : array(); //note 热图推荐
foreach($hotimgs as $key => $value) {
$hotimgs[$key][3] = $imgsdir.$hotimgs[$key][3];
}
$hotimgscount = 6 - count($hotimgs);
if($hotimgscount > 0) { //note 补全热图推荐
$query = $db->query("SELECT t.tid, t.subject, atta.attachment FROM {$tablepre}threads t LEFT JOIN {$tablepre}attachments atta ON atta.tid = t.tid WHERE t.attachment = '1' $sqljoin_disableforum AND atta.isimage = '1' AND atta.filesize > '8192' GROUP BY atta.tid ORDER BY t.replies DESC,t.dateline DESC LIMIT 20");
while($hotimg = $db->fetch_array($query)) {
$link = './viewthread.php?tid='.$hotimg['tid'];
if(file_exists($attachmentdir.$hotimg['attachment'])) {
$targetimg = $home_autocache.'autothumb_'.random(5).'.jpg';
$sourceimg = $attachmentdir.$hotimg['attachment'];
makethumb($sourceimg, $targetimg, '134', '95');
if(file_exists($targetimg)) {
$hotimgs[] = array(cutstr($hotimg['subject'],'16'), '', $link, PUBATTURL.$targetimg);
}
if(count($hotimgs) == 6) break;
}
}
}
如何增加帖子的调用时间限制,比如只想调用一周内的. |