原帖發布在 Discuz! 官方論壇,我是作者,有人希望放出繁體版,便發到這裡來囉^^
鄭重聲明!!!
我極度不歡迎任何形式的轉載,包含你拿我的附件另外發帖(無論是不是在Discuz!發帖)
而且強烈不滿用自己網站做演示的人...
作者 jillyz 只在 Discuz官方 和 AL8 發布本橫排美化∼
若是整合多個修改後再發布出來的朋友,只要你用到我這橫排,
還請你務必註明 出處和網址,感謝配合!
請尊重他人的勞動成果
這個橫排在DZ官方已超過3000人次下載, 感謝大家的支持~
*再次強調,修改之前,一定要備份你原有的文件!
如果你改過之後,覺得這樣的橫排慢,那就別用了。 用你原先備份的文件覆蓋回去即可。
請勿以任何形式轉載 本內容 或 本下載包
要用的請直接貼個網址, 連過來這個主題~~~感謝~~~
======================================================
名稱:首頁橫排美化+最後發表主題(進化)+版主顯示依模式不同位置 for Dz6.0
http://www.discuz.net/thread-787565-1-1.html
http://www.discuz.net/viewthread ... &extra=page%3D1
(若有問題請統一到上面帖子發問~~ AL8這裡我沒負責定期查看囉)
美化修改作者:jillyz ( http://www.kimhaneul.net )
發佈日期:2007-11-15
參考來源:Maxspeed 5.2 (for Discuz 5.5) (http://bbs.maxspeeds.com)
======================================================
預覽圖:

圖片附件:
遊客無法下載或閱讀圖片附件
======================================================
修改方法:
1. 修改 論壇根目錄的 index.php (代碼來自 Maxspeed 5.2)
找
$rsshead = $rssstatus ? ('\n") : '';
上面添加:
(若要 修改顯示主題數量, 這裡修改有兩處, 請自行改. 而背景圖支援到7行, 超過7行請自再行修改背景圖了)
(主題 要顯示高亮 的加這段)--------------------------------------
//每版最新主題--開始
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
$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' AND t.closed NOT LIKE 'moved|%' AND t.displayorder>=0 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;
}
//每版最新主題--結束
(主題 不要 顯示高亮的加這段) -----------------------------------
//每版最新主題--開始
$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' AND t.closed NOT LIKE 'moved|%' AND t.displayorder>=0 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);
${'new_no'.$row['fid'].'_threadlist'}[] = $row;
}
//每版最新主題--結束
2. 修改 模板 discuz.htm ( 在 ./templates/default/discuz.htm 或是 ./templates/風格目錄/discuz.htm )
找
<!--{else}-->
<!--{loop $cat['forums'] $forumid}-->
<!--{eval $forum=$forumlist[$forumid];}-->
<!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
<!--{if $forum['orderid'] < $cat['forumscount']}-->
<!--{/if}-->
<!--{/if}-->
$forum[name]<!--{if $forum[todayposts]}--> ({lang index_today}: $forum[todayposts])<!--{/if}-->
{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]
{lang forum_lastpost}:
<!--{if is_array($forum['lastpost'])}-->
$forum[lastpost][dateline]
{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
<!--{else}-->
{lang never}
<!--{/if}-->
<!--{/loop}-->
$cat['endrows']
<!--{/if}-->
替換成下面的: (若 主題不要顯示高亮, 請把這一句拿掉
$row[highlight] )
------------------------------------------------------------
<!--{else}-->
<thead class="category" align="center">
<tr>
<th>{lang forum_name} / 最新主題</th>
<th>{lang forum_name} / 最新主題</th>
<th>{lang forum_name} / 最新主題</th>
</tr>
</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 width="$cat[forumcolwidth]" style="vertical-align: top; background-image: none; padding:10px !important;">
<div style="overflow: hidden; height:25px; width:100%; display:block">
<div style="float:left; height: 20px; width:90%; overflow:hidden;">
<h2 style="margin: 0 0 3px 0; "><a href="forumdisplay.php?fid=$forum[fid]" $row[highlight] title="$forum[name]">$forum[name]</a></h2>
</div>
<div style="float:right;">
<a href="forumdisplay.php?fid=$forum[fid]&filter=0&orderby=dateline&ascdesc=DESC" title="依發布時間排序主題"><img src="images/common/notice.gif"></a>
</div>
</div>
<div style="clear: both; width:100%">
<div style="float:left">$forum[icon]</div><div style="color:{LIGHTTEXT}; overflow:hidden;">$forum[description]<!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}--></div>
</div>
<ul class="list" style="background-image: url(images/listbg_li.gif); padding:1px 2px 0 10px; list-style-type: none; line-height: 20px; margin:6px 0 4px 0; clear: both;">
<!--{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 style="color:{LIGHTTEXT}; overflow: hidden; height:1.5em; 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="color:{LIGHTTEXT}; overflow: hidden; height:1.5em; width: 100%">
<!--{if $forum['moderators']}-->
<!--{if $moddisplay == 'flat'}-->
<span>{lang forum_moderators}: $forum[moderators]</span>
<!--{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; width: 80px;">$forum[moderators]</ul>
<!--{/if}-->
<!--{else}-->
<span style="color:{LIGHTTEXT}">無版主</span>
<!--{/if}-->
|
{lang forum_threads}:{if $forum['redirect']}--{else}$forum[threads]{/if} /
{lang forum_posts}:{if $forum['redirect']}--{else}$forum[posts]{/if} /
<!--{if $forum[todayposts] && !$forum['redirect']}--><em style="color:{HIGHLIGHTLINK}">{lang index_today}:$forum[todayposts]</em><!--{else}-->{lang index_today}:0<!--{/if}-->
</div>
</th>
<!--{/loop}-->
$cat['endrows']
<!--{/if}-->
------------------------------------------------------------
3. 上傳圖片 ./images/listbg_li.gif ....
[按此另存圖片, 請改名為 listbg_li.gif]

圖片附件:
遊客無法下載或閱讀圖片附件
4. 後台更新緩存,和更新CSS緩存
後台[系統工具>更新緩存]
後台[論壇管理>界面風格],更新CSS文件緩存
5. 設置論壇為橫排,建議一排2-4個。
後台[論壇管理>編輯版塊],點分區版塊的[編輯] 進入,設置"下級子版塊個數:"個數。
======================================================
修改時請注意
修改 discuz.htm 時, 請注意這一段:
<thead class="category" align="center">
<tr>
<th>{lang forum_name} / 最新主題</th>
<th>{lang forum_name} / 最新主題</th>
<th>{lang forum_name} / 最新主題</th>
</tr>
</thead>
其中這一句:
<th>{lang forum_name} / 最新主題</th>
你的橫排一行若設置 N 個版塊,那麼代碼中,這一句就要複製放 N 行。
比如一排4個版塊,這句就複製放4次. (我上面範例裡的是一排3個版塊)
如果你的論壇不固定一行版塊數,那請拿掉這一整段代碼 (<thread>到</thread>)
======================================================
若您的論壇 版塊名稱 有用到HTML,使得橫排出錯,例如下圖
試試看,您的版塊名稱裡,HTML代碼不要加引號。
比如原先是 <font color="red">版塊名稱</font>
引號拿掉變成 <font color=red>版塊名稱</font> 這樣
======================================================
備註:
若有問題請統一到Discuz下面的主題回覆發問~~ AL8這裡我沒負責定期查看囉
http://www.discuz.net/thread-787565-1-1.html
上面網址的
3樓 有寫了一些問答,您可以先參考看看
提問時,除了盡量描述明確點,若能附上您的網站網址或附個圖,會比較容易幫您看問題出在哪
======================================================
我首頁目前的橫排,
是確定不會發布出來, 也不會告知如何做的... 敬請見諒了. 所以請大家別再繼續問囉
原因請看此:
http://www.discuz.net/viewthread ... ;page=13#pid6659509
[
本帖最後由 jillyz 於 2008-1-13 22:00 編輯 ]