AL8 Forum » Discuz 6.0 RC 版本區 » 首頁橫排美化(版塊圖標、最後發表標題、版主、版塊介紹等8.1更新)


2007-8-2 12:10 hideyoki
首頁橫排美化(版塊圖標、最後發表標題、版主、版塊介紹等8.1更新)

轉貼
***********************************************************************************************
*   本插在gbk版本測試無錯,其他版本未知。(big5也用到。)
*   HACK名稱:首頁橫排美化(版塊圖標、最後發表標題、版主、版塊介紹等...)For DZ6.0RC1
*   適用版本:DZ6.0RC1
*   作       者: Poplong
*   安裝難度: 簡單
*   數  據 表: 無
*   修改文件:include/forum.func.php、discuz.htm
*   演示:見圖片附件
*   QQ:不想留
*   轉載務必請保留所有版權信息
************************************************************************************************

廢話不多說,本美化只做拋磚引玉之用,想做出適合自己的橫排美化,請自己多琢磨!

本美化是以默認風格模板為例子的基礎上修改的!

============================修改開始==========================

編輯論壇templates\default\目錄下的discuz.htm文件找
[code]<!--{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]&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}-->[/code]

換成

[code]<!--{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[icon]}
       <h2><b><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a></b><!--{if $forum[todayposts]}--><!--{/if}--></h2>
       <p>┌{lang forum_lastpost}:
        <!--{if is_array($forum['lastpost'])}-->
         <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"  title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}">$forum[lastpost][subject1]</a>
         {lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
        <!--{else}-->
         {lang never}
        <!--{/if}-->
       <p>├<em>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts], {lang index_today}: $forum[todayposts]</em></p>
       <p>└{lang forum_moderators}: $forum[moderators]   </p>
       <p>$forum[description]</p>
       </p>
      </th>
     <!--{/loop}-->[/code]

修改論壇 include/目錄下的forum.func.php文件找

[code]list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = is_array($forum['lastpost']) ? $forum['lastpost'] : explode("\t", $forum['lastpost']);[/code]

後加上
[code]$lastpost['subject1'] = cutstr($lastpost['subject'], 20, $dot = ' ...');[/code]
注:這個20是代表標題的長度,自己控制!

[img]http://www.discuz.net/attachments/month_0707/20070730_64ac4eb5fdd884ab74051TEObXbTZiDB.jpg[/img]

[[i] 本帖最後由 1224 於 2007-8-2 13:05 編輯 [/i]]

2007-8-2 12:15 harial
forumdisplay_subforum.htm 的修改呢,看不到

2007-8-2 12:30 hideyoki
謝謝你提我,可以不用改。
因為果個係子論壇版。原創者說的。

2007-8-2 12:50 Eric03
澄清: UTF-8繁/簡一樣用到
本人沒有試過也知

2007-8-2 12:53 wai312
純支持:em21: :em21:

2007-8-2 13:06 1224
講明左
主題分類唔好亂用

2007-8-2 13:20 hideyoki
回覆 #6 1224 的帖子

對不起...

2007-8-4 13:38 Lbilly
我的最後是:
最後發表: 2007-7-30 13:27 byxxxx

點可以由日期轉做題目

2007-8-22 22:32 過眼雲煙
找不到
[code]<!--{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]&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}-->[/code]
:em40:

2007-8-24 22:17 snc.calvin
還不錯!不過把有新帖與無新帖的圖片拿掉會更好看!:em21:

2007-8-26 13:57 62567211
我想問....5.0這樣改可以嗎??

2007-8-26 16:08 Mickey0804
轉不到@@???點解....改完之後同之前既野一樣既

2007-10-24 17:57 jediskdy
找不到


list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = is_array($forum['lastpost']) ? $forum['lastpost'] : explode("\t", $forum['lastpost']);

2007-10-27 23:53 ericiphk
Thanks for sharing

2007-11-24 12:11 frankieyim
有問題...移左位..

2007-11-24 20:23 frankieyim
回覆 #15 frankieyim 的帖子

點解移晒位既- -

2007-12-9 00:46 龍心輝
多謝分享
下載試用

2008-3-4 21:32 上官燕
回覆 #1 hideyoki 的帖子

一般咁啦....
         不過都支持下啦:em37:

2008-3-15 11:02 eddiefong
「版主:」果度嚴重移位
仲係個版主個名前加左個"•" 救命:em01:

2008-8-2 14:26 rickywing
[quote]原帖由 [i]eddiefong[/i] 於 2008-3-15 11:02 發表 [url=http://www.alan888.com/Discuz/redirect.php?goto=findpost&pid=1179334&ptid=120817][img=13,13]http://www.alan888.com/Discuz/images/common/back.gif[/img][/url]
「版主:」果度嚴重移位
仲係個版主個名前加左個"•" 救命:em01: [/quote]
有冇相睇睇?

[[i] 本帖最後由 rickywing 於 2008-8-2 14:27 編輯 [/i]]

頁: [1]


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.