楼主你好,我是一个菜鸟,刚接触discuz,也没学过html语言
我想论坛有个首页四格,所以下载了某个大大的绿色简单版,安装无问题(link:https://discuz.dismall.com/viewth ... 3%CB%C4%B8%F1%2B6.0)
然后我想把本周热贴改成随即精华贴,我自己修改了toplist.php文件,精华部分这样
// digest
$hack_cut_str = 24;
$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 t.fid<>'$fid' AND f.fid=t.fid AND t.closed NOT LIKE 'moved|%' AND t.digest>0 ORDER by rand() 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_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']) {
$dtring = sprintf('%02d', $dthread['highlight']);
$dtylestr = 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;
运行后不显示,没有调用帖子,不知道什么原因,请版主看下回复我,万分感谢
已解决,原来是需要改动几个文件,不然产生不了链接,还是谢谢版主了- -
[ 本帖最后由 天涯的浪花 于 2008-2-29 15:13 编辑 ] |