Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

index.php代码错误☆★悬赏1个月QQ业务! ☆★谢谢!!

[复制链接]
rui3bo2 发表于 2007-8-1 16:50:44 | 显示全部楼层 |阅读模式
行: 53
字符: 1
错误: 缺少对象
代码: 0
URL: http://www.xxxxx.cn/index.php

这个就是index.php的53行代码
$topiclist = isset($qihoo_links['topics']) ? $qihoo_links['topics'] : '';


谁可以帮我修好☆★悬赏1个月QQ业务! ☆★ 虽然不多,谢谢!!!
 楼主| rui3bo2 发表于 2007-8-9 17:56:25 | 显示全部楼层
<?php

/*
        [Discuz!] (C)2001-2007 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $RCSfile: index.php,v $
        $Revision: 1.44.2.5 $
        $Date: 2007/07/24 13:07:27 $
*/

define('CURSCRIPT', 'index');

require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';

$discuz_action = 1;

if($cacheindexlife && !$discuz_uid && $showoldetails != 'yes' && (!$_DCACHE['settings']['frameon'] || $_DCACHE['settings']['frameon'] && $_GET['frameon'] != 'yes') && empty($gid)) {

        $indexcache = getcacheinfo(0);

        if($timestamp - $indexcache['filemtime'] > $cacheindexlife) {
                @unlink($indexcache['filename']);
                define('CACHE_FILE', $indexcache['filename']);
                $styleid = $_DCACHE['settings']['styleid'];
        } elseif($indexcache['filename']) {
                @readfile($indexcache['filename']);
                $debug && debuginfo();
                die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " '.($debug ? 'Update at '.gmdate("H:i:s", $indexcache['filemtime'] + 3600 * 8).', Processed in '.$debuginfo['time'].' second(s), '.$debuginfo['queries'].' Queries'.($gzipcompress ? ', Gzip enabled' : '') : '').'";</script>');
        }
}

$validdays = $discuz_uid && !empty($groupexpiry) && $groupexpiry >= $timestamp ? ceil(($groupexpiry - $timestamp) / 86400) : 0;
if(isset($showoldetails)) {
        switch($showoldetails) {
                case 'no': dsetcookie('onlineindex', 0, 86400 * 365); break;
                case 'yes': dsetcookie('onlineindex', 1, 86400 * 365); break;
        }
} else {
        $showoldetails = false;
}

$currenttime = gmdate($timeformat, $timestamp + $timeoffset * 3600);
$lastvisittime = gmdate("$dateformat $timeformat", $lastvisit + $timeoffset * 3600);

$memberenc = rawurlencode($lastmember);
$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
$navigation = $navtitle = '';
$rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth."\" />\n") : '';
$searchboxstatus = $qihoo_searchbox & 1;
$keywordlist = isset($qihoo_links['keywords']) ? $qihoo_links['keywords'] : '';
$topiclist = isset($qihoo_links['topics']) ? $qihoo_links['topics'] : '';
if($qihoo_maxtopics) {
        $customtopics = '';
        foreach(explode("\t", isset($_DCOOKIE['customkw']) ? $_DCOOKIE['customkw'] : '') as $topic) {
                $topic = dhtmlspecialchars(trim(stripslashes($topic)));
                $customtopics .= '<a href="topic.php?keyword='.rawurlencode($topic).'" target="_blank">'.$topic.'</a> ';
        }
}

$catlist = $forumlist = $sublist = $pmlist = array();
$threads = $posts = $todayposts = $fids = $announcepm = 0;

$gid = !empty($gid) ? intval($gid) : 0;
if(!$gid) {
        $announcements = $space = '';
        if($_DCACHE['announcements']) {
                $readapmids = !empty($_DCOOKIE['readapmid']) ? explode('D', $_DCOOKIE['readapmid']) : array();
                foreach($_DCACHE['announcements'] as $announcement) {
                        if(empty($announcement['groups']) || in_array($groupid, $announcement['groups'])) {
                                if(empty($announcement['type'])) {
                                        $announcements .= $space.'<a href="announcement.php?id='.$announcement['id'].'#'.$announcement['id'].'"><span class="bold">'.$announcement['subject'].'</span> '.
                                                '('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</a>';
                                } elseif($announcement['type'] == 1) {
                                        $announcements .= $space.'<a href="'.$announcement['message'].'" target="_blank"><span class="bold">'.$announcement['subject'].'</span> '.
                                                '('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</a>';
                                } elseif($discuz_uid && $announcement['type'] == 2 && !in_array($announcement['id'], $readapmids)) {
                                        $announcement['announce'] = TRUE;
                                        $pmlist[] = $announcement;
                                        $announcepm++;
                                }
                                $space = '&nbsp; &nbsp; &nbsp; &nbsp;';
                        }
                }
        }
        unset($_DCACHE['announcements']);

        $threads = $posts = $todayposts = 0;

        $sql = !empty($accessmasks) ?
                                "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, ff.description, ff.moderators, ff.icon, ff.viewperm, a.allowview FROM {$tablepre}forums f
                                        LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
                                        LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
                                        WHERE f.status>0 ORDER BY f.type, f.displayorder"
                                : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, ff.description, ff.moderators, ff.icon, ff.viewperm FROM {$tablepre}forums f
                                        LEFT JOIN {$tablepre}forumfields ff USING(fid)
                                        WHERE f.status>0 ORDER BY f.type, f.displayorder";

        $query = $db->query($sql);

        while($forum = $db->fetch_array($query)) {
                $forumname[$forum['fid']] = strip_tags($forum['name']);
                if($forum['type'] != 'group') {
                        $threads += $forum['threads'];
                        $posts += $forum['posts'];
                        $todayposts += $forum['todayposts'];

                        if($forum['type'] == 'forum') {

                                if(forum($forum)) {
                                        $catlist[$forum['fup']]['forums'][] = $forum['fid'];
                                        $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
                                        $forum['subforums'] = '';
                                        $forumlist[$forum['fid']] = $forum;
                                }

                        } elseif(isset($forumlist[$forum['fup']])) {

                                $forumlist[$forum['fup']]['threads'] += $forum['threads'];
                                $forumlist[$forum['fup']]['posts'] += $forum['posts'];
                                $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts'];
                                if($subforumsindex && $forumlist[$forum['fup']]['permission'] == 2) {
                                        $forumlist[$forum['fup']]['subforums'] .= '<a href="forumdisplay.php?fid='.$forum['fid'].'"><u>'.$forum['name'].'</u></a>&nbsp;&nbsp;';
                                }

                        }

                } else {

                        if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'category_'.$forum['fid'].' ') === FALSE) {
                                $forum['collapseimg'] = 'collapsed_no.gif';
                                $collapse['category_'.$forum['fid']] = '';
                        } else {
                                $forum['collapseimg'] = 'collapsed_yes.gif';
                                $collapse['category_'.$forum['fid']] = 'display: none';
                        }

                        if($forum['moderators']) {
                                 $forum['moderators'] = moddisplay($forum['moderators'], 'flat');
                        }
                        $forum['forumscount']         = 0;
                        $catlist[$forum['fid']] = $forum;
                }
        }

        foreach($catlist as  $catid => $category) {
                if($catlist[$catid]['forumscount'] && $category['forumcolumns']) {
                        $catlist[$catid]['forumcolwidth'] = floor(100 / $category['forumcolumns']).'%';
                        $catlist[$catid]['endrows'] = '';
                        if($colspan = $category['forumscount'] % $category['forumcolumns']) {
                                while(($category['forumcolumns'] - $colspan) > 0) {
                                        $catlist[$catid]['endrows'] .= '<td class="altbg2"></td>';
                                        $colspan ++;
                                }
                                $catlist[$catid]['endrows'] .= '</tr>';
                        }

                } elseif(empty($category['forumscount'])) {
                        unset($catlist[$catid]);
                }
        }

        if(isset($catlist[0]) && $catlist[0]['forumscount']) {
                $catlist[0]['fid'] = 0;
                $catlist[0]['type'] = 'group';
                $catlist[0]['name'] = $bbname;
                $catlist[0]['collapseimg'] = 'collapsed_no.gif';
        } else {
                unset($catlist[0]);
        }

        foreach(array('forumlinks', 'birthdays', 'supe_updateusers') as $key) {
                if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], $key.' ') === FALSE) {
                        $collapseimg[$key] = 'collapsed_no.gif';
                        $collapse[$key] = '';
                } else {
                        $collapseimg[$key] = 'collapsed_yes.gif';
                        $collapse[$key] = 'display: none';
                }
        }

        if($whosonlinestatus == 1 || $whosonlinestatus == 3) {
                $whosonlinestatus = 1;

                $onlineinfo = explode("\t", $onlinerecord);
                if(empty($_DCOOKIE['onlineusernum'])) {
                        $onlinenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions"), 0);
                        if($onlinenum > $onlineinfo[0]) {
                                $_DCACHE['settings']['onlinerecord'] = $onlinerecord = "$onlinenum\t$timestamp";
                                $db->query("UPDATE {$tablepre}settings SET value='$onlinerecord' WHERE variable='onlinerecord'");
                                require_once DISCUZ_ROOT.'./include/cache.func.php';
                                updatesettings();
                                $onlineinfo = array($onlinenum, $timestamp);
                        }
                        dsetcookie('onlineusernum', intval($onlinenum), 300);
                } else {
                        $onlinenum = intval($_DCOOKIE['onlineusernum']);
                }
                $onlineinfo[1] = gmdate($dateformat, $onlineinfo[1] + ($timeoffset * 3600));

                $detailstatus = $showoldetails == 'yes' || (((!isset($_DCOOKIE['onlineindex']) && !$whosonline_contract) || $_DCOOKIE['onlineindex']) && $onlinenum < 500 && !$showoldetails);

                if($detailstatus) {
                        @include language('actions');

                        $discuz_uid && updatesession();
                        $membercount = $invisiblecount = 0;
                        $whosonline = array();

                        $maxonlinelist = $maxonlinelist ? $maxonlinelist : 500;

                        $query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions ".(isset($_DCACHE['onlinelist'][7]) ? '' : 'WHERE uid <> 0')." ORDER BY uid DESC LIMIT ".$maxonlinelist);
                        while($online = $db->fetch_array($query)) {
                                if($online['uid']) {
                                        $membercount ++;
                                        if($online['invisible']) {
                                                $invisiblecount++;
                                                continue;
                                        } else {
                                                $online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
                                        }

                                } else {
                                        $online['icon'] = $_DCACHE['onlinelist'][7];
                                        $online['username'] = '客人';
                                }

                                $online['fid'] = $online['fid'] ? $forumname[$online['fid']] : 0;
                                $online['action'] = $actioncode[$online['action']];
                                $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
                                $whosonline[] = $online;
                        }

                        if($onlinenum > $maxonlinelist) {
                                $membercount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE uid <> '0'"), 0);
                                $invisiblecount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE invisible = '1'"), 0);
                        }

                        if($onlinenum < $membercount) {
                                $onlinenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions"), 0);
                                dsetcookie('onlineusernum', intval($onlinenum), 300);
                        }

                        $guestcount = $onlinenum - $membercount;

                        $db->free_result($query);
                        unset($online);
                }

        } else {
                $whosonlinestatus = 0;
        }

        if($discuz_uid && $newpm) {
                require_once DISCUZ_ROOT.'./include/pmprompt.inc.php';
        }

} else {
        require_once DISCUZ_ROOT.'./include/category.inc.php';

}

include template('discuz');

?>
回复

使用道具 举报

hanxingo 发表于 2007-8-9 20:10:10 | 显示全部楼层
  1. <?php

  2. /*
  3.         [Discuz!] (C)2001-2007 Comsenz Inc.
  4.         This is NOT a freeware, use is subject to license terms

  5.         $RCSfile: index.php,v $
  6.         $Revision: 1.64.2.1 $
  7.         $Date: 2007/07/24 17:50:15 $
  8. */

  9. define('CURSCRIPT', 'index');

  10. require_once './include/common.inc.php';
  11. require_once DISCUZ_ROOT.'./include/forum.func.php';

  12. $discuz_action = 1;

  13. if($cacheindexlife && !$discuz_uid && $showoldetails != 'yes' && (!$_DCACHE['settings']['frameon'] || $_DCACHE['settings']['frameon'] && $_GET['frameon'] != 'yes') && empty($gid)) {

  14.         $indexcache = getcacheinfo(0);

  15.         if($timestamp - $indexcache['filemtime'] > $cacheindexlife) {
  16.                 @unlink($indexcache['filename']);
  17.                 define('CACHE_FILE', $indexcache['filename']);
  18.                 $styleid = $_DCACHE['settings']['styleid'];
  19.         } elseif($indexcache['filename']) {
  20.                 @readfile($indexcache['filename']);
  21.                 $debug && debuginfo();
  22.                 die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " '.($debug ? 'Update at '.gmdate("H:i:s", $indexcache['filemtime'] + 3600 * 8).', Processed in '.$debuginfo['time'].' second(s), '.$debuginfo['queries'].' Queries'.($gzipcompress ? ', Gzip enabled' : '') : '').'";</script>');
  23.         }
  24. }

  25. $validdays = $discuz_uid && !empty($groupexpiry) && $groupexpiry >= $timestamp ? ceil(($groupexpiry - $timestamp) / 86400) : 0;
  26. if(isset($showoldetails)) {
  27.         switch($showoldetails) {
  28.                 case 'no': dsetcookie('onlineindex', 0, 86400 * 365); break;
  29.                 case 'yes': dsetcookie('onlineindex', 1, 86400 * 365); break;
  30.         }
  31. } else {
  32.         $showoldetails = false;
  33. }

  34. $currenttime = gmdate($timeformat, $timestamp + $timeoffset * 3600);
  35. $lastvisittime = gmdate("$dateformat $timeformat", $lastvisit + $timeoffset * 3600);

  36. $memberenc = rawurlencode($lastmember);
  37. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
  38.         //四格代码//
  39. $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  40. //新贴//
  41. $hack_cut_str =28; //修改标题显示字数
  42. $hack_cut_strauthor = 9;
  43. $new_post_threadlist = array();
  44. $nthread = array();
  45. $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.displayorder>='0' ORDER BY t.dateline DESC LIMIT 0, 10");
  46. while($nthread = $db->fetch_array($query)) {
  47.         $nthread['forumname'] = ereg_replace('<[^>]*>','',$nthread['name']);
  48.         $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
  49.         $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
  50.         $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
  51.         $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
  52.         if($nthread['highlight']) {
  53.                 $string = sprintf('%02d', $nthread['highlight']);
  54.                 $stylestr = sprintf('%03b', $string[0]);
  55.                 $nthread['highlight'] = 'style="';
  56.                 $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  57.                 $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  58.                 $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  59.                 $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  60.                 $nthread['highlight'] .= '"';
  61.         } else {
  62.                 $nthread['highlight'] = '';
  63.         }
  64.         $new_post_threadlist[] = $nthread;
  65. }
  66. //新贴//
  67. //回覆//
  68. $hack_cut_str = 28; //修改标题显示字数
  69. $hack_cut_strauthor = 9;
  70. $new_reply_threadlist = array();
  71. $rthread = array();
  72. $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.displayorder>='0' AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 10");
  73. while($rthread = $db->fetch_array($query)) {
  74.         $rthread['forumname'] = ereg_replace('<[^>]*>','',$rthread['name']);
  75.         $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
  76.         $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
  77. $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
  78.         $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
  79.         if($rthread['highlight']) {
  80.                 $string = sprintf('%02d', $rthread['highlight']);
  81.                 $stylestr = sprintf('%03b', $string[0]);
  82.                 $rthread['highlight'] = 'style="';
  83.                 $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  84.                 $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  85.                 $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  86.                 $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  87.                 $rthread['highlight'] .= '"';
  88.         } else {
  89.                 $rthread['highlight'] = '';
  90.         }
  91.         $new_reply_threadlist[] = $rthread;
  92. }
  93. //回覆//
  94. //热帖//
  95. $hack_cut_str = 30; //修改标题显示字数
  96. $hack_cut_strauthor = 10; //热贴指定天数//
  97. $this_time= time();
  98. $sort_time = $today - ( 60*60*24*7); //括号最后一位数代表x天内
  99. $new_hot_threadlist = array();
  100. $mthread = array();
  101. $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.displayorder>='0' AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 and t.dateline > $sort_time ORDER BY t.views DESC LIMIT 0, 10"); //修改显示帖子条数
  102. while($mthread = $db->fetch_array($query)) {
  103.         $mthread['forumname'] = ereg_replace('<[^>]*>','',$mthread['name']);
  104.         $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
  105.         $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
  106. $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
  107.         $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
  108.         if($mthread['highlight']) {
  109.                 $string = sprintf('%02d', $mthread['highlight']);
  110.                 $stylestr = sprintf('%03b', $string[0]);
  111.                 $mthread['highlight'] = 'style="';
  112.                 $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  113.                 $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  114.                 $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  115.                 $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  116.                 $mthread['highlight'] .= '"';
  117.         } else {
  118.                 $mthread['highlight'] = '';
  119.         }
  120.         $new_hot_threadlist[] = $mthread;
  121. }
  122. //热帖//
  123. //四格代码结束//

  124. $rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth."" />\n") : '';
  125. $searchboxstatus = $qihoo_searchbox & 1;
  126. $keywordlist = isset($qihoo_links['keywords']) ? $qihoo_links['keywords'] : '';
  127. $topiclist = isset($qihoo_links['topics']) ? $qihoo_links['topics'] : '';
  128. if($qihoo_maxtopics) {
  129.         $customtopics = '';
  130.         foreach(explode("\t", isset($_DCOOKIE['customkw']) ? $_DCOOKIE['customkw'] : '') as $topic) {
  131.                 $topic = dhtmlspecialchars(trim(stripslashes($topic)));
  132.                 $customtopics .= '<a href="topic.php?keyword='.rawurlencode($topic).'" target="_blank">'.$topic.'</a> &nbsp;';
  133.         }
  134. }

  135. $catlist = $forumlist = $sublist = $pmlist = array();
  136. $threads = $posts = $todayposts = $fids = $announcepm = 0;
  137. $postdata = $historyposts ? explode("\t", $historyposts) : array();

  138. $gid = !empty($gid) ? intval($gid) : 0;
  139. if(!$gid) {
  140.         $announcements = '';
  141.         if($_DCACHE['announcements']) {
  142.                 $readapmids = !empty($_DCOOKIE['readapmid']) ? explode('D', $_DCOOKIE['readapmid']) : array();
  143.                 foreach($_DCACHE['announcements'] as $announcement) {
  144.                         if(empty($announcement['groups']) || in_array($groupid, $announcement['groups'])) {
  145.                                 if(empty($announcement['type'])) {
  146.                                         $announcements .= '<li><a href="announcement.php?id='.$announcement['id'].'#'.$announcement['id'].'">'.$announcement['subject'].
  147.                                                 '<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
  148.                                 } elseif($announcement['type'] == 1) {
  149.                                         $announcements .= '<li><a href="'.$announcement['message'].'" target="_blank">'.$announcement['subject'].
  150.                                                 '<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
  151.                                 } elseif($discuz_uid && $announcement['type'] == 2 && !in_array($announcement['pmid'], $readapmids)) {
  152.                                         $announcement['announce'] = TRUE;
  153.                                         $pmlist[] = $announcement;
  154.                                         $announcepm++;
  155.                                 }
  156.                         }
  157.                 }
  158.         }
  159.         unset($_DCACHE['announcements']);

  160.         $threads = $posts = $todayposts = 0;

  161.         $sql = !empty($accessmasks) ?
  162.                                 "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, a.allowview FROM {$tablepre}forums f
  163.                                         LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
  164.                                         LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
  165.                                         WHERE f.status>0 ORDER BY f.type, f.displayorder"
  166.                                 : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm FROM {$tablepre}forums f
  167.                                         LEFT JOIN {$tablepre}forumfields ff USING(fid)
  168.                                         WHERE f.status>0 ORDER BY f.type, f.displayorder";

  169.         $query = $db->query($sql);

  170.         while($forum = $db->fetch_array($query)) {
  171.                 $forumname[$forum['fid']] = strip_tags($forum['name']);
  172.                 if($forum['type'] != 'group') {
  173.                         $threads += $forum['threads'];
  174.                         $posts += $forum['posts'];
  175.                         $todayposts += $forum['todayposts'];

  176.                         if($forum['type'] == 'forum') {

  177.                                 if(forum($forum)) {
  178.                                         $catlist[$forum['fup']]['forums'][] = $forum['fid'];
  179.                                         $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
  180.                                         $forum['subforums'] = '';
  181.                                         $forumlist[$forum['fid']] = $forum;
  182.                                 }

  183.                         } elseif(isset($forumlist[$forum['fup']])) {

  184.                                 $forumlist[$forum['fup']]['threads'] += $forum['threads'];
  185.                                 $forumlist[$forum['fup']]['posts'] += $forum['posts'];
  186.                                 $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts'];
  187.                                 if($subforumsindex && $forumlist[$forum['fup']]['permission'] == 2 && !($forumlist[$forum['fup']]['simple'] & 16) || ($forumlist[$forum['fup']]['simple'] & 8)) {
  188.                                         $forumlist[$forum['fup']]['subforums'] .= '<a href="forumdisplay.php?fid='.$forum['fid'].'">'.$forum['name'].'</a>&nbsp;&nbsp;';
  189.                                 }

  190.                         }

  191.                 } else {

  192.                         if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'category_'.$forum['fid']) === FALSE) {
  193.                                 $forum['collapseimg'] = 'collapsed_no.gif';
  194.                                 $collapse['category_'.$forum['fid']] = '';
  195.                         } else {
  196.                                 $forum['collapseimg'] = 'collapsed_yes.gif';
  197.                                 $collapse['category_'.$forum['fid']] = 'display: none';
  198.                         }

  199.                         if($forum['moderators']) {
  200.                                  $forum['moderators'] = moddisplay($forum['moderators'], 'flat');
  201.                         }
  202.                         $forum['forumscount']         = 0;
  203.                         $catlist[$forum['fid']] = $forum;
  204.                 }
  205.         }

  206.         foreach($catlist as  $catid => $category) {
  207.                 if($catlist[$catid]['forumscount'] && $category['forumcolumns']) {
  208.                         $catlist[$catid]['forumcolwidth'] = floor(100 / $category['forumcolumns']).'%';
  209.                         $catlist[$catid]['endrows'] = '';
  210.                         if($colspan = $category['forumscount'] % $category['forumcolumns']) {
  211.                                 while(($category['forumcolumns'] - $colspan) > 0) {
  212.                                         $catlist[$catid]['endrows'] .= '<td>&nbsp;</td>';
  213.                                         $colspan ++;
  214.                                 }
  215.                                 $catlist[$catid]['endrows'] .= '</tr>';
  216.                         }

  217.                 } elseif(empty($category['forumscount'])) {
  218.                         unset($catlist[$catid]);
  219.                 }
  220.         }

  221.         if(isset($catlist[0]) && $catlist[0]['forumscount']) {
  222.                 $catlist[0]['fid'] = 0;
  223.                 $catlist[0]['type'] = 'group';
  224.                 $catlist[0]['name'] = $bbname;
  225.                 $catlist[0]['collapseimg'] = 'collapsed_no.gif';
  226.         } else {
  227.                 unset($catlist[0]);
  228.         }

  229.         foreach(array('forumlinks', 'birthdays', 'supe_updateusers') as $key) {
  230.                 if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], $key) === FALSE) {
  231.                         $collapseimg[$key] = 'collapsed_no.gif';
  232.                         $collapse[$key] = '';
  233.                 } else {
  234.                         $collapseimg[$key] = 'collapsed_yes.gif';
  235.                         $collapse[$key] = 'display: none';
  236.                 }
  237.         }

  238.         if($whosonlinestatus == 1 || $whosonlinestatus == 3) {
  239.                 $whosonlinestatus = 1;

  240.                 $onlineinfo = explode("\t", $onlinerecord);
  241.                 if(empty($_DCOOKIE['onlineusernum'])) {
  242.                         $onlinenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions"), 0);
  243.                         if($onlinenum > $onlineinfo[0]) {
  244.                                 $_DCACHE['settings']['onlinerecord'] = $onlinerecord = "$onlinenum\t$timestamp";
  245.                                 $db->query("UPDATE {$tablepre}settings SET value='$onlinerecord' WHERE variable='onlinerecord'");
  246.                                 require_once DISCUZ_ROOT.'./include/cache.func.php';
  247.                                 updatesettings();
  248.                                 $onlineinfo = array($onlinenum, $timestamp);
  249.                         }
  250.                         dsetcookie('onlineusernum', intval($onlinenum), 300);
  251.                 } else {
  252.                         $onlinenum = intval($_DCOOKIE['onlineusernum']);
  253.                 }
  254.                 $onlineinfo[1] = gmdate($dateformat, $onlineinfo[1] + ($timeoffset * 3600));

  255.                 $detailstatus = $showoldetails == 'yes' || (((!isset($_DCOOKIE['onlineindex']) && !$whosonline_contract) || $_DCOOKIE['onlineindex']) && $onlinenum < 500 && !$showoldetails);

  256.                 if($detailstatus) {
  257.                         @include language('actions');

  258.                         $discuz_uid && updatesession();
  259.                         $membercount = $invisiblecount = 0;
  260.                         $whosonline = array();

  261.                         $maxonlinelist = $maxonlinelist ? $maxonlinelist : 500;

  262.                         $query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions ".(isset($_DCACHE['onlinelist'][7]) ? '' : 'WHERE uid <> 0')." ORDER BY uid DESC LIMIT ".$maxonlinelist);
  263.                         while($online = $db->fetch_array($query)) {
  264.                                 if($online['uid']) {
  265.                                         $membercount ++;
  266.                                         if($online['invisible']) {
  267.                                                 $invisiblecount++;
  268.                                                 continue;
  269.                                         } else {
  270.                                                 $online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
  271.                                         }

  272.                                 } else {
  273.                                         $online['icon'] = $_DCACHE['onlinelist'][7];
  274.                                         $online['username'] = $language['guest'];
  275.                                 }

  276.                                 $online['fid'] = $online['fid'] ? $forumname[$online['fid']] : 0;
  277.                                 $online['action'] = $actioncode[$online['action']];
  278.                                 $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
  279.                                 $whosonline[] = $online;
  280.                         }

  281.                         if($onlinenum > $maxonlinelist) {
  282.                                 $membercount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE uid <> '0'"), 0);
  283.                                 $invisiblecount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE invisible = '1'"), 0);
  284.                         }

  285.                         if($onlinenum < $membercount) {
  286.                                 $onlinenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions"), 0);
  287.                                 dsetcookie('onlineusernum', intval($onlinenum), 300);
  288.                         }

  289.                         $guestcount = $onlinenum - $membercount;

  290.                         $db->free_result($query);
  291.                         unset($online);
  292.                 }

  293.         } else {
  294.                 $whosonlinestatus = 0;
  295.         }

  296.         if($discuz_uid && $newpm) {
  297.                 require_once DISCUZ_ROOT.'./include/pmprompt.inc.php';
  298.         }

  299. } else {
  300.         require_once DISCUZ_ROOT.'./include/category.inc.php';

  301. }

  302. include template('discuz');

  303. ?>
复制代码


试下看看
回复

使用道具 举报

 楼主| rui3bo2 发表于 2007-8-10 02:44:21 | 显示全部楼层
怎么又把首页调用插件加上了? 我不想用了去掉后就有错误了 你知道怎么改代码么?
回复

使用道具 举报

k58k 发表于 2013-2-14 19:23:15 | 显示全部楼层
我也有这个问题,晕~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-3 21:30 , Processed in 0.126176 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表