AL8 Forum » Discuz 2.0 及 2.2 插件發佈 » 【HACK】主題分類顯示+公告顯示 HACK


2004-2-26 17:55 bk0001
【HACK】主題分類顯示+公告顯示 HACK

[color=#990000]FROM: alan888
2.2F 版本已含此功能, 不用修改[/color]

【HACK】主題分類顯示+公告顯示 HACK


內容:
1、修改 forumdisplay.php 文件,查找:
[code] $threadlist = array(); [/code]
在這句之前加上:[code]// HACK BY BK
$query = $db->query("SELECT COUNT(*) FROM $table_announcements");
$anonnum = $db->result($query, 0);
$anonlist = array();
$query = $db->query("SELECT * FROM $table_announcements ORDER BY id DESC");
while($anon = $db->fetch_array($query)) {
        
        $anon['starttime'] = gmdate("$dateformat $timeformat", $thread['starttime'] + $timeoffset * 3600);

        $anonlist[] = $anon;

}
// HACK END[/code]
2、修改模版:forumdisplay ,查找代碼:
[code] <table cellspacing="0" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center" bgcolor="{BORDERCOLOR}"><tr><td>
<table border="0" cellspacing="{BORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" style="table-layout: fixed; word-wrap: break-word">
<tr class="header">
<td width="4%"> </td>
<td width="4%"> </td>
<td width="47%" align="center">{lang subject}</td>
<td width="14%" align="center">{lang author}</td>
<td width="6%" align="center">{lang replies}</td>
<td width="6%" align="center">{lang views}</td>
<td width="19%" align="center">{lang lastpost}</td>
</tr> [/code]

在之后加上:
[code] <!--{if $anonnum}-->
<!--{loop $anonlist $anon}-->
                <tr>
                <td bgcolor="{ALTBG2}" align="center"><a href="announcement.php?id=$anon['id']#$anon['id']" target="_blank"><img src="{IMGDIR}/anon.gif" border="0"></a></td>
                <td bgcolor="{ALTBG2}" colspan="2" >論壇公告:<a href="announcement.php?id=$anon['id']#$anon['id']">$anon[subject]</a>
                </td>
                <td bgcolor="{ALTBG1}" align="center">
                <a href="viewpro.php?username=$anon[author]">$anon[author]</a></td>
                <td bgcolor="{ALTBG2}" align="center">-</td>
                <td bgcolor="{ALTBG1}" align="center">-</td>
                <td bgcolor="{ALTBG2}" align="center">$anon['starttime']</td></tr>
        <!--{/loop}-->
<!--{/if}-->

<tr class="category">
<td colspan="7"><b>重要主題</b>
</td>
</tr>
{eval $endtop = 0;} [/code]  

接下來的代碼是:
[code] <!--{if $topicsnum}-->
        <!--{loop $threadlist $thread}-->[/code]   

在這之后加上下面代碼:
[code] <!--{if !$thread['topped']}-->
{eval $endtop=$endtop+1;}
<!--{/if}-->
<!--{if ($endtop == 1)}-->
<tr class="category">
<td colspan="7"><b>普通主題</b>
</td>
</tr>
<!--{/if}--> [/code]  

4、在你所使用的風格的圖片目錄里加上一個公告所用的圖片,名稱為:anon.gif
咪攪定囉~~

2004-2-26 17:58 bk0001
預覽圖~~:em21:

2004-2-26 17:58 KIA
讓我先看看

2004-2-26 19:49 supra8250
我住2樓~~~謝謝分享~~

2004-2-26 19:59 yin
*** 作者被禁止或刪除 內容自動屏蔽 ***

2004-2-26 21:54 bencwk
see see see^0^

2004-2-26 22:53 deadxp
看看看看看看

2004-2-26 23:45 DennisPang
看過別的論壇用這個 想用看看了 ! 謝謝老大 !

2004-2-27 01:10 小強
我來看看

2004-2-27 10:42 hang617
仲未知係咩黎 , 想試一試

2004-2-27 11:41 hang617
這個hack是將精華文章放在重要主題的位置 , 請問如可修改才可以將精華文章放回普通主題??thx

2004-2-27 22:28 whatlove
用用看

2004-2-28 01:56 lemon
正野

冇諗過可以咁

2004-2-28 03:33 laimay
不錯用的樣子我來看看

2004-2-28 17:16 Chiu_hk
thank !!
see see!!

2004-2-28 21:42 dicky32
這個HACK實在太給他實用了∼謝謝大大ㄌ!!

2004-2-28 22:55 ─≡☆藍天
GOOD !!

2004-2-28 23:11 musicguyguy
good~
thx wo~

2004-2-28 23:43 ─≡☆藍天
thxxxx

2004-2-29 10:10 shray
thanks ,see see

2004-3-1 10:59 physictim
看起來很實用謝謝

2004-3-1 13:54 yiyiyi
我耍try

2004-3-1 16:39 teddytcw
good la
hv to see

2004-3-1 17:24 jimmychim
THX!!!!!!!!!!!

2004-3-2 18:00 kyotim
THX~~~~~~~

2004-3-2 18:29 RPG
see mO(︶L︶)Om

2004-3-2 20:17 ghost427
這個插件好像不錯ㄜ
趕快來用在我的論壇謝謝分享囉

2004-3-3 12:45 54ajin
感謝大大

2004-3-3 17:42 tt2002
需然不太明~
多謝先~

2004-3-3 19:39 天強者
give me see see

2004-3-4 20:44 RINGOYAU
thankssss

thankssss

2004-3-7 16:42 pkpkcat
**** 沒回覆的訪客不能閱讀 *****

2004-3-7 17:10 hkmad
謝~:em49:

2004-3-9 11:23 tonnylkk
想問能不能用英文?:em32:

2004-3-9 16:24 ansom
看看先好像很好

2004-3-9 17:13 koshuchung
好東西呀!

2004-3-9 18:13 godandghost
回回回回

2004-3-13 15:18 ericericeric
這是甚麼來的??

2004-3-14 11:51 rex
see......

2004-3-14 18:30 fatal
Would like to have this hack, thanks...

頁: [1] 2 3 4 5 6 7 8 9 10


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