克米设计

克米设计官方联系方式

工作时间: 周一到周五早上09:00-11:30, 下午03:00-05:30, 晚上09:00-10:30(周六、日休息)
QQ: 21400445  8821775  11012081  327460889TEL: 0668-8810200 13450110120 15813025137  E-Mail: ceo#comiis.com
用户交流QQ群
①群83667771 ②群83667772 ③群83667773 ④群110900020 ⑤群110900021 ⑥群70068388 ⑦群110899987 ←提醒: 请勿重复加群, 谢谢合作
楼主: snkeyu - 

精仿深圳乡情网HOME页发布[优化代码+智能调用]

[复制链接]
发表于 2008-9-6 14:28:45 | 显示全部楼层
我原先论坛的首页内容:

<?php

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

        $Id: index.php 10486 2007-09-03 06:53:29Z liuqiang $
*/

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;

//----首页四格代码开始
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//新贴
$hack_cut_str = 26; //标题字数
$hack_cut_strauthor = 9;
$new_post_threadlist = array();
$nthread = 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 f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
$nthread['forumname'] = ereg_replace('<[^>]*>','',$nthread['name']);
$nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
$nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
$nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
$nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
if($nthread['highlight']) {
$string = sprintf('%02d', $nthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$nthread['highlight'] = 'style="';
$nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$nthread['highlight'] .= '"';
} else {
$nthread['highlight'] = '';
}
$new_post_threadlist[] = $nthread;
}
//新回复
$hack_cut_str = 26; //标题字数
$hack_cut_strauthor = 9;
$new_reply_threadlist = array();
$rthread = 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.replies !=0 AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.lastpost DESC LIMIT 0, 10");
while($rthread = $db->fetch_array($query)) {
$rthread['forumname'] = ereg_replace('<[^>]*>','',$rthread['name']);
$rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
$rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
$rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
$rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
if($rthread['highlight']) {
$string = sprintf('%02d', $rthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$rthread['highlight'] = 'style="';
$rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$rthread['highlight'] .= '"';
} else {
$rthread['highlight'] = '';
}
$new_reply_threadlist[] = $rthread;
}
//热帖
$hack_cut_str = 26; //标题字数
$hack_cut_strauthor = 9;
$new_hot_threadlist = array();
$mthread = array();
$ctime=$timestamp-3600*24*7;//最后7是天数为本周
$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.replies !=0 AND t.dateline>$ctime AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10");
while($mthread = $db->fetch_array($query)) {
$mthread['forumname'] = ereg_replace('<[^>]*>','',$mthread['name']);
$mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
$mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
$mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
$mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
if($mthread['highlight']) {
$string = sprintf('%02d', $mthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$mthread['highlight'] = 'style="';
$mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$mthread['highlight'] .= '"';
} else {
$mthread['highlight'] = '';
}
$new_hot_threadlist[] = $mthread;
}
//----首页四格代码结束

$rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth."\" />\n") : '';
$customtopics = '';
if($qihoo['maxtopics']) {
        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> &nbsp;';
        }
}
$supeitemsstatus = $supe['status'] && $supe['items']['status'] && $_DCACHE['supe_updateitems'];
$hottagstatus = $tagstatus && $hottags && $_DCACHE['tags'];

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

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';
        }
}

$gid = !empty($gid) ? intval($gid) : 0;
if(!$gid) {
        $announcements = '';
        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 .= '<li><a href="announcement.php?id='.$announcement['id'].'#'.$announcement['id'].'">'.$announcement['subject'].
                                                '<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
                                } elseif($announcement['type'] == 1) {
                                        $announcements .= '<li><a href="'.$announcement['message'].'" target="_blank">'.$announcement['subject'].
                                                '<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
                                } elseif($discuz_uid && $announcement['type'] == 2 && !in_array($announcement['pmid'], $readapmids)) {
                                        $announcement['announce'] = TRUE;
                                        $pmlist[] = $announcement;
                                        $announcepm++;
                                }
                        }
                }
        }
        unset($_DCACHE['announcements']);

        $sql = !empty($accessmasks) ?
                                "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.**, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect, 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, f.**, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect 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);
发表于 2008-9-6 14:29:21 | 显示全部楼层

接上,刚没有发完!

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']]['**'] & 16) || ($forumlist[$forum['fup']]['**'] & 8)) {
                                        $forumlist[$forum['fup']]['subforums'] .= '<a href="forumdisplay.php?fid='.$forum['fid'].'">'.$forum['name'].'</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>&nbsp;</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]);
        }

        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'] = $_DCACHE['onlinelist']['guest'];
                                }

                                $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');

?>
发表于 2008-9-6 14:31:27 | 显示全部楼层

从你这下载下来的HOME首页文件。index.php

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

        $Id: index.php 13301 2008-04-08 02:46:07Z monkey $
*/
define('CURSCRIPT', 'index');

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

//---设置---start
$shownums        = 6;//演示个数 6以内
$searchnums        = 18;//搜索总数.
$cachelife        = 1800;//缓存时间.
$orderby        = 'rand';//搜索顺序:按日期dateline.按浏览次数downloads.随机rand.
$cachename        = 'showpic';//缓存名.若与何插件冲突请修改,只要不冲突不会影响使用.
$searchfid        = '';//搜索fid范围.不**留空.请用逗号相隔,如'1,2,3'.
//---设置---end

if((@!include('forumdata/cache/cache_'.$cachename.'.php')) || $expiration < time() || $cacheshownums != $shownums || $cachesearchnums != $searchnums || $cachecachelife != $cachelife || $cacheorderby != $orderby || $cachecachename != $cachename || $cachesearchfid != $searchfid) {
        require_once './include/common.inc.php';
        $orderby = $orderby != 'rand' ? 'attach.'.$orderby : 'rand()';
        $fids = $searchfid ? 'AND '."t.fid IN ($searchfid)" : '';
        $data = array();
        $query = $db->query("SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM {$tablepre}attachments attach LEFT JOIN {$tablepre}threads t ON t.tid=attach.tid WHERE attach.readperm='0' AND displayorder>='0' AND filetype='image/pjpeg' $fids GROUP BY attach.tid ORDER BY $orderby DESC LIMIT $searchnums");
        while ($pic = $db->fetch_array($query)) {
                $data['pic'][$pic[aid]]['showpicpics'] = $attachurl.'/'.$pic['attachment'];
                $data['pic'][$pic[aid]]['showpiclinks'] = "viewthread.php?tid=$pic[tid]";
                $data['pic'][$pic[aid]]['showpictexts'] = str_replace('\'', '&nbsp;',$pic['subject']);
        }
        $data['expiration'] = $cachelife + time();
        $data['cacheshownums'] = $shownums;
        $data['cachesearchnums'] = $searchnums;
        $data['cachecachelife'] = $cachelife;
        $data['cacheorderby'] = $orderby;
        $data['cachecachename'] = $cachename;
        $data['cachesearchfid'] = $searchfid;
        require_once DISCUZ_ROOT.'./include/cache.func.php';
        writetocache($cachename, '', getcachevars($data));
        include(DISCUZ_ROOT.'./forumdata/cache/cache_'.$cachename.'.php');
}

shuffle($pic);
$i = 0;
$j = 0;
while ($j < $shownums && isset($pic[$i])) {
        if(is_readable($pic[$i]['showpicpics'])) {
                $showpicpics .= $comma.$pic[$i]['showpicpics'];
                $showpiclinks .= $comma.$pic[$i]['showpiclinks'];
                $showpictexts .= $comma.$pic[$i]['showpictexts'];
                $comma = '|';
                $j++;
        }
        $i++;
}

//论坛新贴开始//
$hack_cut_str =40; //修改标题显示字数
$hack_cut_strauthor = 9;
$new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 9");
while($nthread = $db->fetch_array($query)) {
        
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $new_post_threadlist[] = $nthread;
}

//论坛新贴结束//


//论坛精华贴开始//
$hack_cut_str =40; //修改标题显示字数
$hack_cut_strauthor = 9;
$new_digest_threadlist = array();
$sthread = 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.digest in (1,2,3) ORDER BY t.dateline DESC LIMIT 0, 9");
while($sthread = $db->fetch_array($query)) {
        $sthread['forumname'] = $sthread['name'];
        $sthread['view_subject'] = cutstr($sthread['subject'],$hack_cut_str);
        $sthread['view_author'] = cutstr($sthread['author'],$hack_cut_strauthor);
        $sthread['date']= gmdate("$dateformat $timeformat", $sthread['dateline'] + $timeoffset * 3600);
        $sthread['lastreplytime']= gmdate("$dateformat $timeformat", $sthread[lastpost] + ($timeoffset * 3600));
        if($sthread['highlight']) {
                $string = sprintf('%02d', $sthread['highlight']);


                $stylestr = sprintf('%03b', $string[0]);
                $sthread['highlight'] = 'style="';
                $sthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $sthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $sthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $sthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $sthread['highlight'] .= '"';
        } else {
                $sthread['highlight'] = '';
        }
        $new_digest_threadlist[] = $sthread;
}

//论坛精华贴结束//


//km论坛热贴开始//
$hack_cut_str =28; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*30); //30天内
$new_digesthot_threadlist = array();
$hsthread = 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.replies !=0 and t.dateline > $sort_time ORDER BY t.replies DESC LIMIT 0, 9");
while($hsthread = $db->fetch_array($query)) {
        $hsthread['forumname'] = $hsthread['name'];
        $hsthread['view_subject'] = cutstr($hsthread['subject'],$hack_cut_str);
        $hsthread['view_author'] = cutstr($hsthread['author'],$hack_cut_strauthor);
        $hsthread['date']= gmdate("$dateformat $timeformat", $hsthread['dateline'] + $timeoffset * 3600);
        $hsthread['lastreplytime']= gmdate("$dateformat $timeformat", $hsthread[lastpost] + ($timeoffset * 3600));
        if($hsthread['highlight']) {
                $string = sprintf('%02d', $hsthread['highlight']);


                $stylestr = sprintf('%03b', $string[0]);
                $hsthread['highlight'] = 'style="';
                $hsthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $hsthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $hsthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $hsthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $hsthread['highlight'] .= '"';
        } else {
                $hsthread['highlight'] = '';
        }
        $new_digesthot_threadlist[] = $hsthread;
}

//论坛热贴结束//



//热门搜索文字调用
$hottags = array();
$query = $db->query("SELECT tagname,total FROM {$tablepre}tags LIMIT 3");
while($variable = $db->fetch_array($query)) {
        $hottags[] = array('tagname'=>$variable['tagname'],'total'=>$variable['total']);
}
//热门搜索文字调用//



//调用论坛版块fid为13的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid13_new_post_threadlist = array();
$nthread = 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 f.fid in (13) ORDER BY t.dateline DESC LIMIT 0,5");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
发表于 2008-9-6 14:32:03 | 显示全部楼层

接上没完!

} else {
                $nthread['highlight'] = '';
        }
        $fid13_new_post_threadlist[] = $nthread;
}
//完毕//




//调用论坛版块fid为26的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid26_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='26' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid26_new_post_threadlist[] = $nthread;
}
//完毕//


//调用论坛版块fid为25的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid25_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='25' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid25_new_post_threadlist[] = $nthread;
}
//完毕//


//调用论坛版块fid为24的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid24_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='24' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid24_new_post_threadlist[] = $nthread;
}
//完毕//



//调用论坛版块fid为19的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid19_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='19' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';

        } else {
                $nthread['highlight'] = '';
        }
        $fid19_new_post_threadlist[] = $nthread;
}
//完毕//
发表于 2008-9-6 14:32:38 | 显示全部楼层

接上~

//调用论坛版块fid为18的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid18_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='18' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid18_new_post_threadlist[] = $nthread;
}
//完毕//
//调用论坛版块fid为17的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid17_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='17' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid17_new_post_threadlist[] = $nthread;
}
//完毕//


//调用论坛版块fid为12的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid12_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='12' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid12_new_post_threadlist[] = $nthread;
}
//完毕//

//调用论坛版块fid为10的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid10_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='10' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid10_new_post_threadlist[] = $nthread;
}
//完毕//


//调用论坛版块fid为9的新贴//
$hack_cut_str =26; //修改标题显示字数
$hack_cut_strauthor = 9;
$sort_time = $today - ( 60*60*24*7); //本周
$fid9_new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid='9' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0,10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
发表于 2008-9-6 14:32:59 | 显示全部楼层

接上!

if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $fid9_new_post_threadlist[] = $nthread;
}
//完毕//

$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();
                $debug ? 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>') : die();
        }
}

$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;

$rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth."\" />\n") : '';
$customtopics = '';
if($qihoo['maxtopics']) {
        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> &nbsp;';
        }
}
$hottagstatus = $tagstatus && $hottags && $_DCACHE['tags'];

$catlist = $forumlist = $sublist = $forumname = $collapseimg = $collapse = array();
$threads = $posts = $todayposts = $fids = $announcepm = 0;
$postdata = $historyposts ? explode("\t", $historyposts) : array();

foreach(array('forumlinks', 'birthdays') 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';
        }
}

$gid = !empty($gid) ? intval($gid) : 0;
if(!$gid) {
        $announcements = '';
        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 .= '<li><a href="announcement.php?id='.$announcement['id'].'">'.$announcement['subject'].
                                                '<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
                                } elseif($announcement['type'] == 1) {
                                        $announcements .= '<li><a href="'.$announcement['message'].'" target="_blank">'.$announcement['subject'].
                                                '<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
                                }
                        }
                }
        }
        unset($_DCACHE['announcements']);

        $sql = !empty($accessmasks) ?
                                "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.**, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect, 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, f.**, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect 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
发表于 2008-9-6 14:33:33 | 显示全部楼层
['threads'];
                                $forumlist[$forum['fup']]['posts'] += $forum['posts'];
                                $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts'];
                                if($subforumsindex && $forumlist[$forum['fup']]['permission'] == 2 && !($forumlist[$forum['fup']]['**'] & 16) || ($forumlist[$forum['fup']]['**'] & 8)) {
                                        $forumlist[$forum['fup']]['subforums'] .= '<a href="forumdisplay.php?fid='.$forum['fid'].'">'.$forum['name'].'</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>&nbsp;</td>';
                                        $colspan ++;
                                }
                                $catlist[$catid]['endrows'] .= '</tr>';
                        }

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

        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]);
        }

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

                $onlineinfo = explode("\t", $onlinerecord);
                if(empty($_DCOOKIE['onlineusernum'])) {
                        $onlinenum = $db->result_first("SELECT COUNT(*) FROM {$tablepre}sessions");
                        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'] = $_DCACHE['onlinelist']['guest'];
                                }

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

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

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

                        $guestcount = $onlinenum - $membercount;

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

        } else {
                $whosonlinestatus = 0;
        }

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

}

include template('comiis_home');

?>
发表于 2008-9-6 14:35:38 | 显示全部楼层

comiis_home.htm 文件~ 下载下来的

<!--
克米出品 必属精品

克米设计工作室 版权所有 http://www.Comiis.com
相信克米 你将会有意想不到的收获

我们致力于为企业提供优质网站建设、网站推广、网站优化、程序开发、域名注册、虚拟主机等服务,
一流设计和解决方案为企业量身打造适合自己需求的网站运营平台,最大限度地使企业在信息时代稳握无限商机。

TEL:13450110120 13729950660
QQ:21400445 24184428
E-mail:design@comiis.com

Copyright (C) 2008-2009 Www.Comiis.Com design.All rights reserv
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<title>$navtitle $bbname $seotitle - {$boardurl}</title>
$seohead
<meta name="keywords" content="{$metakeywords}$seokeywords" />
<meta name="description" content="$metadescription $bbname $seodescription - {$boardurl}" />
<meta name="generator" content="$version" />
<meta name="MSSmartTagsPreventParsing" content="True" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<link rel="archives" title="$bbname" href="{$boardurl}archiver/" />
<LINK href="comiis_sz0759/css.css" type=text/css rel=stylesheet>
<SCRIPT language=JavaScript src="comiis_sz0759/comiis.js" type=text/javascript></SCRIPT>
<noscript><iframe src="*.html"></iframe></noscript>
$rsshead
$extrahead
<!--{if CURSCRIPT == 'viewthread'}-->
        <link rel="stylesheet" type="text/css" href="forumdata/cache/style_{STYLEID}_viewthread.css" />
        <!--{if $thread['special']}-->
                <link rel="stylesheet" type="text/css" href="forumdata/cache/style_{STYLEID}_special.css" />
        <!--{/if}-->
<!--{elseif CURSCRIPT == 'post'}-->
        <link rel="stylesheet" type="text/css" href="forumdata/cache/style_{STYLEID}_editor.css" />
<!--{/if}-->
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_{STYLEID}_common.css" />
<script type="text/javascript">
        var discuz_uid = $discuz_uid;var IMGDIR = '{IMGDIR}';var attackevasive = '$attackevasive';var gid = 0;var STYLEID = '{STYLEID}';
        <!--{if in_array(CURSCRIPT, array('viewthread', 'forumdisplay'))}-->gid = parseInt('$thisgid');<!--{elseif CURSCRIPT == 'index'}-->gid = parseInt('$gid');<!--{/if}-->var fid = parseInt('$fid');var tid = parseInt('$tid');
</script>
<script type="text/javascript" src="include/javascript/common.js"></script>
</head>
<BODY>
<div id="append_parent"></div><div id="ajaxwaitid"></div>
<TABLE width=963 border=0 align="center" cellPadding=0 cellSpacing=0 class=snboder>
  <TBODY>
  <TR>
<TD width=300 bgColor=#F8F8F8 height=25 align=left>&nbsp;&nbsp;{lang time_now}</TD>
<TD width=660 align="right" bgColor=#F8F8F8><A class=blufont
      href="">首页</A> | <A onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('{$boardurl}');return(false);" href="javascript:">设为首页</A> | <A onClick="javascript:window.external.AddFavorite('{$boardurl}', '$bbname $seotitle')" href="javascript:" target="_self">加入收藏</A> | <a href="mailtoadminemail">{lang contactus}</a>&nbsp;&nbsp;</TD>
</TR></TBODY></TABLE>
<TABLE width=963 height=80 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
   <TD width=10 align="center" valign="center"></TD>
    <TD width=195 align="center" valign="center"><a href="$indexname" title="$bbname">{BOARDLOGO}</a></TD>
    <TD width="740" height="80" align="center">
      <DIV align=right><table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
发表于 2008-9-8 19:03:39 | 显示全部楼层
谢谢了 谢谢了谢谢了谢谢了谢谢了谢谢了
发表于 2008-9-8 23:22:11 | 显示全部楼层
辛苦了 学习中
使用高级回帖 (可批量传图、插入视频等)

发表回复

您需要登录后才可以回帖 登录 | 加入克米

本版积分规则   Ctrl + Enter 快速发布  

发帖时请遵守我国法律,网站会将有关你发帖内容、时间以及发帖IP地址等记录保留,只要接到合法请求,即会将信息提供给有关政府机构。
快速回复 返回顶部 返回列表