终于又见到可爱的横版了,呵呵,但是这个貌似是覆盖版,如果有修改了discuz.html和index.php文件的新手站长,可能不会改掉,覆盖又怕出错,下面,我附上手动修改代码,呵呵,只适合菜鸟站长,借鉴其他帖子,很简单的修改方法。
1。修改模板 discuz.htm 查找- <!--{loop $cat['forums'] $forumid}-->
复制代码 其上面的 前3行 會看到 <!--{else}-->
修改來了,找到下面這一段:- <!--{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>
- <!--{if $forum['permission'] == 1}-->
- <p>{lang private_forum}
- <!--{else}-->
- <p>{lang forum_lastpost}:
- <!--{if is_array($forum['lastpost'])}-->
- <a href="redirect.php?tid=$forum[lastpost][tid]&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>
- <!--{/if}-->
- </th>
- <!--{/loop}-->
- $cat['endrows']
- <!--{/if}-->
复制代码 替換為如下內容:- <!--{else}-->
- <thead class="category" align="center">
-
- </thead>
- <!--{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 class="forumlist" width="$cat[forumcolwidth]" style="vertical-align: top; background-image: none; padding:8px !important;">
- <div style="width:100%; "><div style="float:left; "><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a></div><div style="float:right; "><A title="依发布时间排序主题 [进入本版]"
- href="forumdisplay.php?fid=$forum[fid]&filter=0&orderby=dateline&ascdesc=DESC&sid=7A2NNH"><IMG
- src="images/dateline_url.gif"></A>
- <IMG class=hand title="最后发表.版主 [收/展]"
- onclick="toggle_collapse('lastpost_$forum[fid]');"
- src="images/master.gif"> <IMG
- class=hand title="查看版主 [展/收]" onclick="toggle_collapse('dateline_$forum[fid]');"
- src="images/dateline.gif">
- <!--{if $forum[todayposts]}-->
-
- <!--{else}-->
- <!--{/if}--></div></div>
- <span style="float:left">$forum[icon]</span><span style="float:left; color:{LIGHTTEXT}">$forum[description]</span>
- <ul class="list" style="background-image: url(images/listbg_li.gif); padding:1px 2px 0px 10px; list-style-type: none; line-height: 20px; clear: both; margin:8px 0; ">
- <!--{loop ${"new_no".$forum[fid]."_threadlist"} $row}-->
- <div style="overflow: hidden; height:20px; width:100%"><small style="float:right; color:#9C8B88; margin: 0 0 0 5px">$row['date']</small><a href="viewthread.php?tid=$row[tid]" title="$row[subject]" target='_self'>$row[view_subject]</a></div>
- <!--{/loop}-->
- </ul>
- <div id="lastpost_$forum[fid]">
- <div style="color:{LIGHTTEXT}; overflow: hidden; height: 20px; width: 100%" >
- <!--{if is_array($forum['lastpost'])}-->
- {lang forum_lastpost}: <a style="color:{LIGHTTEXT}" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost" title="$forum[lastpost][subject] ($forum[lastpost][dateline])">{echo cutstr($forum[lastpost][subject], 35)}</a>
- ({lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author'])<!--{else}-->{lang anonymous}<!--{/if}-->
- <!--{else}-->
- {lang never}
- <!--{/if}-->
- </div>
- <div style="text-align: left; color:{LIGHTTEXT}">
- {lang forum_threads}:{if $forum['redirect']}--{else}$forum[threads]{/if},
- {lang forum_posts}:{if $forum['redirect']}--{else}$forum[posts]{/if},
- <!--{if $forum[todayposts]}-->{lang index_today}:$forum[todayposts],<!--{else}-->{lang index_today}:0<!--{/if}-->
- </div></div>
-
- <ul id="dateline_$forum[fid]" style="DISPLAY: none; background-image: url(images/listbg_lz.gif); padding:1px 2px 0px 10px; list-style-type: none; line-height: 20px; clear: both; margin:8px 0; ">
- <div style="overflow: hidden; height:35px; width:100%">
- <!--{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}-->
- </div>
-
- </ul>
- </th>
- <!--{/loop}-->
- $cat['endrows']
-
- <!--{/if}-->
复制代码 2。修改程序 index.php
找到- $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码 在下面加上:- //帖子调用开始
- $hack_cut_str =60; // 这里修改标题长度
- $fids = array();
- if (file_exists("./forumdata/cache/cache_forums.php")){
- require_once "./forumdata/cache/cache_forums.php";
- if (is_array($_DCACHE['forums'])){
- foreach ($_DCACHE['forums'] as $k => $v){
- if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
- $fids[$k] = 5; // 这里是第一处调用条数需要和后面的设置一样。
- }
- }
- }
- if (count($fids) < 1){
- $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
- while ($row = $db->fetch_array($query)){
- $fids[$row['fid']] = 5; // 这里是第二处调用条数需要和前面的设置一样。
- }
- }
- $limit_counts = 0;
- foreach ($fids as $k => $v){
- $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' ORDER BY t.dateline DESC LIMIT $v) UNION ";
- }
- if ($sql){
- $sql = substr($sql,0,strlen($sql)-6);
- }
- $query = $db->query($sql);
- while ($row = $db->fetch_array($query)){
- $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
- $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
- if($row['highlight']) {
- $string = sprintf('%02d', $row['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $row['highlight'] = 'style="';
- $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $row['highlight'] .= '"';
- } else {
- $row['highlight'] = '';
- }
- ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
- }
- //帖子调用结束
复制代码 最后,将附件里面的images目录上传到你论坛目录的images目录下,就可以了,呵呵,看过之后是不是很简单呢,终于可以免去你覆盖的烦恼了,好的话,就顶一下作者吧,哈,谢谢作者给我们带来这么好的插件。 |