调用论坛精华的修改方法
下段代码替换论坛根目录下index.php中论坛热门相关位置代码
复制内容到剪贴板代码:
//最新回复// //论坛精华// $hack_cut_str =28; //修改标题显示字数
$hack_cut_strauthor = 9;
$new_digest_threadlist = array();
$dthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE digest>'0' AND t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 10"); //修改显示帖子条数
while($dthread = $db->fetch_array($query)) {
$dthread['forumname'] = $dthread['name'];
$dthread['view_subject'] = cutstr($dthread['subject'],$hack_cut_str);
$dthread['view_author'] = cutstr($dthread['author'],$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;
}
//论坛精华//
下段代码替换/templates/风格/discuz.htm中论坛热门相关位置代码
复制内容到剪贴板代码:
<td>
<!--{loop $new_digest_threadlist $dthread}-->
<table border="0" width='100%' cellspacing="2">
<tr>
<td height=12 width='76%'><FONT face=Wingdings>z</FONT> </font><a href="viewthread.php?tid=$dthread[tid]" $dthread['highlight'] title="精华文章 {LF}所在论坛: $dthread[forumname]{LF}主题标题: $dthread[subject]{LF}主题作者: $dthread[author]{LF}发表时间: $dthread[date]{LF}浏览次数: $dthread[views] 次{LF}回复次数: $dthread[replies] 次{LF}最后回复: $dthread[lastreplytime]{LF}{lang lastpost}: $dthread[lastposter]">$dthread[view_subject]</a></td>
</tr>
</table>
<!--{/loop}--></td>
这是我的首页精华调用,请问,这是最新精华吗?为什么我把新的帖子评为精华后,首页不会更新呢?也更新缓存了。 |