$separatepos = 0;
$threadlist = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');$displayorderadd = $filter != 'digest' && $filter != 'type' && $stickycount ? 't.displayorder IN (0, 1)' : 't.displayorder>=0';if(($start_limit && $start_limit > $stickycount) || !$stickycount || $filter == 'digest' || $filter == 'type' ) { $querysticky = '';
$query = $db->query("SELECT $dotadd1 t.* FROM {$tablepre}threads t $dotadd2
WHERE t.fid='$fid' $filteradd AND $displayorderadd
ORDER BY t.displayorder DESC, t.$orderby $ascdesc
LIMIT ".($filter == 'digest' || $filter == 'type' ? $start_limit : $start_limit - $stickycount).", $tpp");} else { $querysticky = $db->query("SELECT $dotadd1 t.* FROM {$tablepre}threads t $dotadd2
WHERE t.tid IN ($stickytids) AND t.displayorder IN (2, 3)
ORDER BY displayorder DESC, $orderby $ascdesc
LIMIT $start_limit, ".($stickycount - $start_limit < $tpp ? $stickycount - $start_limit : $tpp)); if($tpp - $stickycount + $start_limit > 0) {
$query = $db->query("SELECT $dotadd1 t.* FROM {$tablepre}threads t $dotadd2
WHERE t.fid='$fid' $filteradd AND $displayorderadd
ORDER BY displayorder DESC, $orderby $ascdesc
LIMIT ".($tpp - $stickycount + $start_limit));
} else {
$query = '';
}}while(($querysticky && $thread = $db->fetch_array($querysticky)) || ($query && $thread = $db->fetch_array($query))) {
$thread['icon'] = isset($_DCACHE['icons'][$thread['iconid']]) ? '<img src="'.SMDIR.'/'.$_DCACHE['icons'][$thread['iconid']].'" align="absmiddle">' : '&nbsp;';
$thread['lastposterenc'] = rawurlencode($thread['lastposter']); $thread['typeid'] = $thread['typeid'] && !empty($forum['threadtypes']['prefix']) && isset($forum['threadtypes']['types'][$thread['typeid']]) ?
'['.$forum['threadtypes']['types'][$thread['typeid']].'] ' : ''; $topicposts = $thread['replies'] + 1;
if($topicposts > $ppp) {
$pagelinks = '';
$topicpages = ceil($topicposts / $ppp);
for ($i = 1; $i <= $topicpages; $i++) {
$pagelinks .= "<a href=\"viewthread.php?tid=$thread[tid]&page=$i&extra=$extra\">$i</a> ";
if($i == 6) {
$i = $topicpages + 1;
}
}
if($topicpages > 6) {
$pagelinks .= " .. <a href=\"viewthread.php?tid=$thread[tid]&page=$topicpages&extra=$extra\">$topicpages</a> ";
}
$thread['multipage'] = '&nbsp; &nbsp;( <img src="'.IMGDIR.'/multipage.gif" align="absmiddle" boader="0"> '.$pagelinks.')';
} else {
$thread['multipage'] = '';
} if($thread['highlight']) {
$string = sprintf('%02d', $thread['highlight']);
$stylestr = sprintf('%03b', $string[0]); $thread['highlight'] = 'style="';
$thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$thread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$thread['highlight'] .= '"';
} else {
$thread['highlight'] = '';
} $thread['moved'] = 0;
if($thread['closed'] || ($forum['autoclose'] && $timestamp - $thread[$closedby] > $forum['autoclose'])) {
$thread['new'] = 0;
if($thread['closed'] > 1) {
$thread['moved'] = $thread['tid'];
$thread['tid'] = $thread['closed'];
$thread['replies'] = '-';
$thread['views'] = '-';
}
$thread['folder'] = 'lock_folder.gif';
} else {
$thread['folder'] = 'folder.gif';
if($lastvisit < $thread['lastpost'] && (empty($_DCOOKIE['oldtopics']) || strpos($_DCOOKIE['oldtopics'], 'D'.$thread['tid'].'D') === FALSE)) {
$thread['new'] = 1;
$thread['folder'] = 'red_'.$thread['folder'];
} else {
$thread['new'] = 0;
}
if($thread['replies'] > $thread['views']) {
$thread['views'] = $thread['replies'];
}
if($thread['replies'] >= $hottopic) {
$thread['folder'] = 'hot_'.$thread['folder'];
}
if($dotfolders && $thread['dotauthor'] == $discuz_uid && $discuz_uid) {
$thread['folder'] = 'dot_'.$thread['folder'];
}
} $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
$thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600); if($thread['displayorder'] > 0) {
$separatepos++;
} $threadlist[] = $thread;}//$separatepos = $announcement && !$separatepos ? 1 : ($separatepos ? $separatepos + 1 : 0);
$separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0);$check = array();
$check[$filter] = $check[$orderby] = $check[$ascdesc] = 'selected="selected"';$visitedforums = $visitedforums ? visitedforums() : '';
$forumselect = $forumjump ? forumselect() : '';
$typeselect = typeselect($typeid);$usesigcheck = $discuz_uid && $sigstatus ? 'checked' : '';
$allowpost = (!$forum['postperm'] && $allowpost) || ($forum['postperm'] && strstr($forum['postperm'], "\t$groupid\t")) || !empty($forum['allowpost']);
$allowpostpoll = $allowpost && $allowpostpoll;
include template('forumdisplay');
?>

解决方案 »

  1.   

    免费版论坛分类信息在cdb_forums表中 cdb为默认前缀
    帖子信息在 cdb_threads表中
      

  2.   

    我的是Discuz! 2.5F SP1
    安装数据库中的表是系统默认的前缀 cab
    所以论坛各个版块的信息在cdb_forums表中
    帖子信息(文章标题 点击数 所属版块)在 cdb_threads表中对应(subject views fid)
    内容在cdb_posts表中
    建议装个phpmyadmin(需要php环境)查看discuz安装的数据,会很直观
      

  3.   

    http://forum.xsdzq.cn/forumdisplay.php?fid=4
    是采用国内的php论坛程序discuz
    你给的那个网址 页面下方 很清楚 Powered by Discuz! 4.0.0RC4  
    官方网址 http://www.discuz.com/
    官方论坛 http://www.discuz.net/