自己搞定了
//精华帖
$hack_cut_str = 54; //标题字数
$hack_cut_strauthor = 15;
$new_digest_threadlist = array();
$dthread = array();
$dtime=$timestamp-3600*24*5;//最后30是天数为本月
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid'
AND f.fid=t.fid AND t.dateline>$dtime AND t.digest in (1,2,3) ORDER BY t.dateline DESC LIMIT 0, 20");
while($dthread = $db->fetch_array($query)) {
$dthread['forumname'] = ereg_replace('<[^>]*>','',$dthread['name']);
$dthread['view_subject'] = cutstr($dthread['subject'],$hack_cut_str);
$dthread['view_lastposter'] = cutstr($dthread['lastposter'],$hack_cut_strauthor);
$dthread['date']= gmdate("$dateformat $timeformat", $dthread['dateline'] + $timeoffset *
3600);
$dthread['lastreplytime']= gmdate("$dateformat $timeformat", $dthread[lastpost] + ($timeoffset *
3600));
if($dthread['highlight']) {
$string = sprintf('%02d', $dthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$dthread['highlight'] = 'style="';
$dthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$dthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$dthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$dthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$dthread['highlight'] .= '"';
} else {
$dthread['highlight'] = '';
}
$new_digest_threadlist[] = $dthread;
}
//----首页四格代码结束 |