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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

首页n格的问题整理与解决[最后更新:2007.11.05 JS调用附件]

[复制链接]
googelcn 发表于 2007-12-8 17:38:16 | 显示全部楼层
回复

使用道具 举报

太原团购 发表于 2007-12-10 17:36:06 | 显示全部楼层
太好了 谢谢热心人!


-------------------------

问题: 将某一格改为某一版最新发贴 (包括修改格标题)



我下了个四格 但想把其中一格修改成某一版的最新贴


是不是用这个代码? 我第一次弄,在后台调用里找到的
<script language="JavaScript" src="http://www.tggo.cn/api/javascript.php?key=threads_l5H"></script>

后台调用给的御览



如果是使用上面代码,请问在那几个文件内修改替换那些代码?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

太原团购 发表于 2007-12-10 17:40:29 | 显示全部楼层
提问前 我也搜索找了下

好像是修改这两个文件 index.php   discuz.htm

但具体如何修改就不会了 谢谢帮助!

=============================
index.php 文件:
-----------------------------
<?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) AND f.fid !=22 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) AND f.fid !=22 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*30;//最后30是天数为本月  
$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 t.digest in (1,2,3) 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;
}
//今日发贴排行
$tomonth=date(n);
$todate=date(j);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,$todate,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
        $poststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],10)."</a>&nbsp;<font color=red>[".$result[num]."]</font>&nbsp;&nbsp;";
}
//本月发贴排行
$tomonth=date(n);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,0,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
        $monthpoststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],10)."</a>&nbsp;<font color=red>[".$result[num]."]</font>&nbsp;&nbsp;";
}
//当年发贴排行
$toyear=date(Y);
$time=mktime(0,0,0,0,0,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
        $yearpoststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],6)."</a>&nbsp;<font color=red>[".$result[num]."]</font>&nbsp;&nbsp;";
}
//----首页多格代码结束




$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.simple, 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.simple, 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['threads'];
                                $forumlist[$forum['fup']]['posts'] += $forum['posts'];
                                $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts'];
                                if($subforumsindex && $forumlist[$forum['fup']]['permission'] == 2 && !($forumlist[$forum['fup']]['simple'] & 16) || ($forumlist[$forum['fup']]['simple'] & 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');

?>


=====================================
discuz.htm   文件:
-------------------------------------
{template header}

<div id="foruminfo">
        <div id="userinfo">
                <div id="nav">
                        <!--{if $supe['status']}--><a href="$supe[siteurl]" target="_blank">$supe['sitename']</a> - <!--{/if}-->
                        <!--{if $gid || !$discuz_uid}--><a href="$indexname">$bbname</a> <!--{else}--><a href="space.php?action=viewpro&uid=$discuz_uid" class="dropmenu" id="creditlist" onmouseover="showMenu(this.id)">$discuz_user</a> <!--{/if}-->
                        <!--{if $discuz_uid}-->
                                <!--{if $supe['status'] && $xspacestatus}-->
                                        - <a href="$supe[siteurl]/?uid/$discuz_uid" target="_blank">{lang space}</a>
                                <!--{elseif $spacestatus}-->
                                        - <a href="space.php?uid=$discuz_uid" target="_blank">{lang space}</a>
                                <!--{/if}-->
                                <!--{if $supe['status'] && !$xspacestatus}-->
                                        - <a href="$supe[siteurl]/?uid/$discuz_uid" target="_blank">{lang space_upgrade_space}</a>
                                <!--{/if}-->
                        <!--{/if}-->
                </div>
                <p>
                <!--{if $discuz_uid}-->
                        <!--{if $allowinvisible}-->{lang online_status}:
                        <span id="loginstatus"><!--{if !empty($invisible)}--><a href="member.php?action=switchstatus" onclick="ajaxget(this.href, 'loginstatus');doane(event);">{lang login_invisible_mode}</a><!--{else}--><a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}" onclick="ajaxget(this.href, 'loginstatus');doane(event);">{lang login_normal_mode}</a><!--{/if}--></span>,
                        <!--{/if}-->
                        {lang your_lastvisit}: <em>$lastvisittime</em>
                        <!--{if !empty($google) && ($google & 1)}--><br /><!--{else}--> &nbsp;<!--{/if}-->
                        <a href="search.php?srchfrom=$newthreads&amp;searchsubmit=yes">{lang show_newthreads}</a>
                        <a href="member.php?action=markread" id="ajax_markread" onclick="ajaxmenu(event, this.id)">{lang mark_read}</a>
                <!--{elseif !$passport_status}-->
                        <form id="loginform" method="post" name="login" action="logging.php?action=login&amp;loginsubmit=true">
                                <input type="hidden" name="formhash" value="{FORMHASH}" />
                                <input type="hidden" name="cookietime" value="2592000" />
                                <input type="hidden" name="loginfield" value="username" />
                                <input type="text" id="username" name="username" size="15" maxlength="40" tabindex="1" value="{lang username}" onclick="this.value = ''" />
                                <input type="password" id="password" name="password" size="10" tabindex="2" onkeypress="if((event.keyCode ? event.keyCode : event.charCode) == 13) $('loginform').submit()" />
                                <button name="userlogin" type="submit" value="true">{lang login}</button>
                        </form>
                <!--{/if}-->
                </p>
        </div>

        <div id="forumstats">
                <p>
                        {lang index_today}: <em>$todayposts</em>, {lang index_yesterday}: <em>$postdata[0]</em>, {lang index_maxday}: <em>$postdata[1]</em> &nbsp; <a href="digest.php">{lang digest}</a>
                        <!--{if $rssstatus}--><a href="rss.php?auth=$rssauth" title="{lang rss_subscribe_all}" target="_blank"><img src="images/common/xml.gif" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
                </p>
                <p>{lang index_threads}: <em>$threads</em>, {lang index_posts}: <em>$posts</em>, {lang index_members}: <em>$totalmembers</em>, {lang welcome_newmember} <cite><a href="space.php?username=$memberenc">$lastmember</a></cite></p>
        </div>
        <!--{if !empty($google) && ($google & 1)}-->
                <div id="headsearch" style="clear: both">
                <script type="text/javascript" src="forumdata/cache/google_var.js"></script>
                <script type="text/javascript" src="include/javascript/google.js"></script>
                </div>
        <!--{/if}-->
</div>

<!--{if empty($gid) && $announcements}-->
        <div id="announcement" onmouseover="if(!anncount) {clearTimeout(annst);annst = 0}" onmouseout="if(!annst) annst = setTimeout('announcementScroll()', anndelay);">
                <div id="announcementbody"><ul>$announcements</ul></div>
        </div>
        <script type="text/javascript">
                var anndelay = 3000;
                var anncount = 0;var annheight = 36;var annst = 0;
                function announcementScroll() {
                        if(!annst) {
                                $('announcementbody').innerHTML += '<br style="clear: both" />' + $('announcementbody').innerHTML;$('announcementbody').scrollTop = 0;
                                if($('announcementbody').scrollHeight > annheight * 3) {
                                        annst = setTimeout('announcementScroll()', anndelay);
                                } else {
                                        $('announcement').onmouseover = $('announcement').onmouseout = null;
                                }
                                return;
                        }
                        if(anncount == annheight) {
                                if($('announcementbody').scrollHeight - annheight <= $('announcementbody').scrollTop) {
                                        $('announcementbody').scrollTop = $('announcementbody').scrollHeight / 2 - annheight;
                                }
                                anncount = 0;annst = setTimeout('announcementScroll()', anndelay);
                        } else {
                                $('announcementbody').scrollTop++;anncount++;annst = setTimeout('announcementScroll()', 10);
                        }
                }

        </script>
<!--{/if}-->

<!--{if !empty($newpmexists) || $announcepm}-->
        <div style="clear: both; margin-top: 5px" id="pmprompt">
        {template pmprompt}
        </div>
<!--{/if}-->

<div id="ad_text"></div>



<div class="mainbox forumlist" style="padding:0;">
<table cellspacing="0" cellpadding="0">
  <thead class="category">
  <tr>
   <td align="center" style="padding:0 1px 0 0"><h3>≡ 最新贴图 ≡</h3></td>
   <td align="center" style="padding:0"><h3>≡ 最新帖子发布 ≡</h3></td>
   <td align="center" style="padding:0 1px 0 1px"><h3>≡ 最新回复贴子 ≡</h3></td>
   <td align="center" style="padding:0"><h3>≡ 本周热门贴子 ≡</h3></td>
  </tr>
  </thead>
  <tr>
   <td width="25%">
    <script type="text/javascript" src="pic.php"></script>
   </td>
   <td width="25%">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
     <tr valign="top">
      <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
      <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
      <!--{loop $new_post_threadlist $nthread}-->
       <!--{if $nthread[replies]}-->
        <div style="overflow: hidden;height: 20px;width: 100%;"><a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title='最新帖子 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]'>$nthread[view_subject]</a></div>
                   <!--{else}-->
        <div style="overflow: hidden;height: 20px;width: 100%;"><a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title='最新帖子 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: 暂时没有回复'>$nthread[view_subject]</a></div>
       <!--{/if}-->
      <!--{/loop}-->
      </td>
     </tr>
    </table>
   </td>
   <td width="25%">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
     <tr valign="top">
      <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
      <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
      <!--{loop $new_reply_threadlist $rthread}-->
       <div style="overflow: hidden;height: 20px;width: 100%;"><a href="viewthread.php?tid=$rthread[tid]" $rthread['highlight'] title='最新回复 {LF}所在论坛: $rthread[forumname]{LF}主题标题: $rthread[subject]{LF}主题作者: $rthread[author]{LF}发表时间: $rthread[date]{LF}浏览次数: $rthread[views] 次{LF}回复次数: $rthread[replies] 次{LF}最后回复: $rthread[lastreplytime]{LF}{lang lastpost}: $rthread[lastposter]'>$rthread[view_subject]</a></div>
      <!--{/loop}-->
      </td>
     </tr>
    </table>
   </td>
   <td width="25%">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
     <tr valign="top">
      <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
      <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
                                                <!--{loop $new_hot_threadlist $mthread}-->
                                                        <div style="overflow: hidden;height: 20px;width: 100%;"><a href="viewthread.php?tid=$mthread[tid]" $mthread['highlight'] title='本月精华 {LF}所在论坛: $mthread[forumname]{LF}主题标题: $mthread[subject]{LF}主题作者: $mthread[author]{LF}发表时间: $mthread[date]{LF}浏览次数: $mthread[views] 次{LF}回复次数: $mthread[replies] 次{LF}最后回复: $mthread[lastreplytime]{LF}{lang lastpost}: $mthread[lastposter]'>$mthread[view_subject]</a></div>
                                                <!--{/loop}-->
      </td>
     </tr>
    </table>
   </td>
  </tr>
<tr>
<td colspan=4>今日发贴TOP10:$poststar</td>
</tr>
</table>
<script src='http://www.itolc.cn/js/gg1.js'></script>
</div>



<table summary="HeadBox" class="portalbox" cellpadding="0" cellspacing="1">
        <tr>
        <!--{if $supeitemsstatus || $hottagstatus}-->
                <td>
                        <!--{if $supeitemsstatus}-->
                                <div id="supeitems"><h3><a href="$supe[siteurl]" target="_blank">{lang supe_updateitems}</a></h3>
                                <ul>
                                        $_DCACHE[supe_updateitems]
                                </ul>
                                </div>
                        <!--{/if}-->
                        <!--{if $hottagstatus}-->
                                <div id="hottags"><h3><a href="tag.php" target="_blank">{lang hottags}</a></h3>
                                $_DCACHE[tags]
                                </div>
                        <!--{/if}-->
                </td>
        <!--{/if}-->
        <!--{if !empty($qihoo['status']) && ($qihoo['searchbox'] & 1)}-->
                <td id="qihoosearch"{if $supeitemsstatus || $hottagstatus} style="width: 242px;"{/if}>
                <!--{if !empty($qihoo['status']) && ($qihoo['searchbox'] & 1)}-->
                        <form method="post" action="search.php?srchtype=qihoo" onSubmit="this.target='_blank';">
                                <input type="hidden" name="searchsubmit" value="yes" />
                                <input type="text" name="srchtxt" value="$qihoo_searchboxtxt" size="20" />
                                <select name="stype">
                                        <option value="" selected="selected">{lang qihoo_search_filltext}</option>
                                        <option value="1">{lang qihoo_search_title}</option>
                                        <option value="2">{lang qihoo_search_author}</option>
                                </select>
                                &nbsp;<button name="searchsubmit" type="submit" value="true">{lang search}</button>
                        </form>

                        <!--{if !empty($qihoo['links']['keywords'])}-->
                                <strong>{lang qihoo_hot_searches}</strong>
                                <!--{loop $qihoo['links']['keywords'] $link}-->
                                        $link&nbsp;
                                <!--{/loop}-->
                        <!--{/if}-->

                        <!--{if $customtopics}-->
                                <strong>{lang qihoo_custom_topics}</strong>&nbsp;&nbsp;$customtopics [<a href="###" onclick="window.open('misc.php?action=customtopics', '', 'width=320,height=450,resizable=yes,scrollbars=yes');">{lang edit}</a>]<br />
                        <!--{/if}-->

                        <!--{if !empty($qihoo['links']['topics'])}-->
                                <strong>{lang qihoo_topics}</strong>&nbsp;
                                <!--{loop $qihoo['links']['topics'] $url}-->
                                        {$url} &nbsp;
                                <!--{/loop}-->
                        <!--{/if}-->
                <!--{/if}-->
                </td>
        <!--{/if}-->
        </tr>
</table>

<!--{loop $catlist $key $cat}-->
        <!--{if $cat['forumscount']}-->
                <div class="mainbox forumlist">
                        <span class="headactions">
                                <!--{if $cat['moderators']}-->{lang forum_category_modedby}: $cat[moderators]<!--{/if}-->
                                <img id="category_$cat[fid]_img" src="{IMGDIR}/$cat[collapseimg]" title="{lang spread}" alt="{lang spread}" onclick="toggle_collapse('category_$cat[fid]');" />
                        </span>
                        <h3><a href="$indexname?gid=$cat[fid]">$cat[name]</a></h3>
                        <table id="category_$cat[fid]" summary="category$cat[fid]" cellspacing="0" cellpadding="0" style="$collapse['category_'.$cat[fid]]">
                        <!--{if !$cat['forumcolumns']}-->
                                <thead class="category">
                                        <tr>
                                                <th>{lang forum_name}</th>
                                                <td class="nums">{lang forum_threads}</td>
                                                <td class="nums">{lang forum_posts}</td>
                                                <td class="lastpost">{lang forum_lastpost}</td>
                                        </tr>
                                </thead>
                                <!--{loop $cat[forums] $forumid}-->
                                        <!--{eval $forum=$forumlist[$forumid];}-->
                                        <tbody id="forum$forum[fid]">
                                                <tr>
                                                        <th$forum[folder]>
                                                                $forum[icon]
                                                                <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
                                                                <!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
                                                                <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
                                                                <!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p class="moderators">{lang forum_moderators}: $forum[moderators]</p><!--{else}--><span class="dropmenu" id="mod$forum[fid]" onmouseover="showMenu(this.id)">{lang forum_moderators}</span><ul class="moderators popupmenu_popup" id="mod$forum[fid]_menu" style="display: none">$forum[moderators]</ul><!--{/if}--><!--{/if}-->
                                                        </th>
                                                        <td class="nums">{if $forum['redirect']}--{else}$forum[threads]{/if}</td>
                                                        <td class="nums">{if $forum['redirect']}--{else}$forum[posts]{/if}</td>
                                                        <td class="lastpost">
                                                        <!--{if $forum['permission'] == 1}-->
                                                                {lang private_forum}
                                                        <!--{else}-->
                                                                <!--{if $forum['redirect']}-->
                                                                        --
                                                                <!--{elseif is_array($forum['lastpost'])}-->
                                                                        <a href="redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 40)}</a>
                                                                        <cite>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
                                                                <!--{else}-->
                                                                        {lang never}
                                                                <!--{/if}-->
                                                        <!--{/if}-->
                                                        </td>
                                                </tr>
                                        </tbody>
                                <!--{/loop}-->
                        <!--{else}-->
                                        <tr>
                                        <!--{loop $cat['forums'] $forumid}-->
                                                <!--{eval $forum=$forumlist[$forumid];}-->
                                                <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
                                                        </tr></tbody>
                                                        <!--{if $forum['orderid'] < $cat['forumscount']}-->
                                                                <tbody><tr>
                                                        <!--{/if}-->
                                                <!--{/if}-->
                                                <th width="$cat[forumcolwidth]"{$forum[folder]}>
                                                        <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
                                                        <p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>
                                                        <p>{lang forum_lastpost}:
                                                                <!--{if is_array($forum['lastpost'])}-->
                                                                        <a href="redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost">$forum[lastpost][dateline]</a>
                                                                        {lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
                                                                <!--{else}-->
                                                                        {lang never}
                                                                <!--{/if}-->
                                                        </p>
                                                </th>
                                        <!--{/loop}-->
                                $cat['endrows']
                        <!--{/if}-->
                        </table>
                </div>
                <div id="ad_intercat_$key"></div>
        <!--{/if}-->
<!--{/loop}-->

<!--{if $_DCACHE['forumlinks']}-->
<div class="box">
        <span class="headactions"><img id="forumlinks_img" src="{IMGDIR}/$collapseimg[forumlinks]" alt="" onclick="toggle_collapse('forumlinks');" /></span>
        <h4>{lang board_links}</h4>
        <table summary="{lang board_links}" id="forumlinks" cellpadding="0" cellspacing="0" style="$collapse[forumlinks]">
                <!--{loop $_DCACHE['forumlinks'] $flink}-->
                        <tr>
                                <td>
                                        <!--{if $flink['type'] == 1}--><img src="$flink[logo]" alt="" class="forumlink_logo" /><!--{/if}-->
                                        $flink[content]
                                </td>
                        </tr>
                <!--{/loop}-->
        </table>
</div>
<!--{/if}-->

<!--{if empty($gid) && $supe['status'] && $supe['maxupdateusers'] && $_DCACHE['supe_updateusers']}-->
<div class="box" id="supe_maxupdateusers">
        <h4><a href="$supe[siteurl]" target="_blank">{lang supe_updateusers}</a></h4>
        <ul class="userlist">
                <!--{loop $_DCACHE['supe_updateusers'] $supe_updateuser}-->
                        <li><a href="$supe[siteurl]/?uid/{$supe_updateuser[uid]}" target="_blank">{$supe_updateuser[username]}</a></li>
                <!--{/loop}-->
        </ul>
</div>
<!--{/if}-->

<!--{if empty($gid) && ($whosonlinestatus || $maxbdays)}-->
        <div class="box" id="online">
        <!--{if $whosonlinestatus}-->
                <!--{if $detailstatus}-->
                        <span class="headactions"><a href="$indexname?showoldetails=no#online" title="{lang pm_close}"><img src="{IMGDIR}/collapsed_no.gif" alt="{lang pm_close}" /></a></span>
                        <h4>
                                <strong><a href="member.php?action=online">{lang onlinemember}</a></strong>
                                - <em>$onlinenum</em> {lang onlines}
                                - <em>$membercount</em> {lang index_members}(<em>$invisiblecount</em> {lang index_invisibles}),
                                <em>$guestcount</em> {lang index_guests}
                                - {lang index_mostonlines} <em>$onlineinfo[0]</em> {lang on} <em>$onlineinfo[1]</em>.
                        </h4>
                <!--{else}-->
                        <span class="headactions"><a href="$indexname?showoldetails=yes#online" class="nobdr"><img src="{IMGDIR}/collapsed_yes.gif" alt="" /></a></span>
                        <h4>
                                <strong><a href="member.php?action=online">{lang onlinemember}</a></strong>
                                - {lang total} <em>$onlinenum</em> {lang onlines}
                                - {lang index_mostonlines} <em>$onlineinfo[0]</em> {lang on} <em>$onlineinfo[1]</em>.
                        </h4>
                <!--{/if}-->
        <!--{else}-->
                <h4><strong><a href="member.php?action=online">{lang onlinemember}</a></strong></h4>
        <!--{/if}-->
        <!--{if $maxbdays}-->
                <div id="bdayslist">
                        <!--{if $_DCACHE['birthdays_index']['todaysbdays']}--><a href="member.php?action=list&amp;type=birthdays">{lang todays_birthdays}</a>: $_DCACHE[birthdays_index][todaysbdays]<!--{else}-->{lang todays_birthdays_none}<!--{/if}-->
                </div>
        <!--{/if}-->
        <!--{if $whosonlinestatus}-->
                <dl id="onlinelist">
                <dt>$_DCACHE[onlinelist][legend]</dt>
                <!--{if $detailstatus}-->
                        <dd>
                        <ul class="userlist">
                        <!--{if $whosonline}-->
                                <!--{loop $whosonline $key $online}-->
                                        <li title="{lang time}: $online[lastactivity]{LF} {lang action}: $online[action] <!--{if $online['fid']}-->{LF}{lang forum}: $online[fid]<!--{/if}-->">
                                        <img src="images/common/$online[icon]" alt="" />
                                        <!--{if $online['uid']}-->
                                                <a href="space.php?uid=$online[uid]">$online[username]</a>
                                        <!--{else}-->
                                                $online[username]
                                        <!--{/if}-->
                                        </li>
                                <!--{/loop}-->
                        <!--{else}-->
                                <li style="width: auto">{lang online_only_guests}</li>
                        <!--{/if}-->
                        </ul>
                        </dd>
                <!--{/if}-->
                </dl>
        <!--{/if}-->
        </div>
<!--{/if}-->

<div class="legend">
        <label><img src="{IMGDIR}/forum_new.gif" alt="{lang forum_newposts}" />{lang forum_newposts}</label>
        <label><img src="{IMGDIR}/forum.gif" alt="{lang forum_nonewpost}" />{lang forum_nonewpost}</label>
</div>
<ul class="popupmenu_popup" id="creditlist_menu" style="display: none">
        <li>{lang credits}: $credits</li>
<!--{loop $extcredits $id $credit}-->
        <li>$credit[title]: $GLOBALS['extcredits'.$id] $credit[unit]</li>
<!--{/loop}-->
</ul>
<!--{if empty($gid) && $announcements}-->
        <script type="text/javascript">announcementScroll();</script>
<!--{/if}-->
<script src='http://www.itolc.cn/js/dz.js'></script>
{template footer}
回复

使用道具 举报

whhugh 发表于 2007-12-11 11:16:14 | 显示全部楼层
多谢楼主, 问题解决啦
回复

使用道具 举报

习明 发表于 2007-12-11 12:13:47 | 显示全部楼层

回复 615# 的帖子

如果用js调用的方法直接把js调用代码替换模板里对应的单元格内容即可
回复

使用道具 举报

太原团购 发表于 2007-12-11 12:21:00 | 显示全部楼层
原帖由 习明 于 2007-12-11 12:13 发表
如果用js调用的方法直接把js调用代码替换模板里对应的单元格内容即可


关键是对整个代码所代表的含义 不太清楚

二来,我的四格到现在都是空的 没显示出来.
www.tggo.cn
回复

使用道具 举报

习明 发表于 2007-12-11 12:27:07 | 显示全部楼层
回复

使用道具 举报

tt5805740 发表于 2007-12-11 21:03:03 | 显示全部楼层
请问首页4格里的随即图片 可不可以改成固定的几个图?

有些风格 他的顶部都有几张图固定的图 在那动
比如这个风格
https://discuz.dismall.com/viewth ... F7%C1%F7&page=1
他中间有6张
首页4格上的能不能弄成他那样?
不能的话 单独弄成那个风格那样可以嘛?
要怎么改  谢谢了
回复

使用道具 举报

习明 发表于 2007-12-11 21:44:23 | 显示全部楼层

回复 620# 的帖子

那个应该是站长手工添加的 也可以尝试用js调用的方法取一些附件图片出来展示
回复

使用道具 举报

joeylee 发表于 2007-12-13 01:11:19 | 显示全部楼层
看着有些头疼
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 20:23 , Processed in 0.115567 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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