1. 已針對 PLUS 1.5.x 作特別的修改以符合版面需求, 若非使用 PLUS 的請自行調整
2. 若已經安裝過並調整過版面不想再更動版面的話, 請下載檔案覆蓋原先的舊檔即可!!
原始參考來源: http://phpbb-tw.net/phpbb/viewtopic.php?t=30652
原始版本下載: http://hosted.filefront.com/wang5555
我將原始 MOD 修改並命名為 1.2 PLUS 版
2006-08-25 - Version 1.2 PLUS
- 後台管理介面畫面重新編排
- 後台會出現目前的跑馬燈公告預覽
代碼: 選擇全部
#############################################################
## Mod Title: 跑馬燈公告
## Mod Version: 1.2 PLUS
## Mod Date: 2006/08/25
##
## By: Martinet Oaf < oafwork@hotmail.com >
## PLUS Version : 2006/08/25 Powered By DAVID <>
##
## Description:
## 這可以讓你的首頁有一個跑馬燈式的公告喔~
## 而且 , 公告的編增刪都是在後台作的~
#
## Installation Level: 簡單
## Installation Time: 1 分鐘不到 ^^"
## Files To Edit: 3
## Included Files:
## /admin/admin_announce.php
## /templates/subsilver/AnnounceMarq_add.tpl
## /templates/subsilver/AnnounceMarq_body.tpl
## /lang/your_language/lang_announce.php
## /images/announce.gif
## /images/bu_event.gif
## /images/bu_g.gif
## /images/bu_ne.gif
## /images/bu_news.gif
## /images/bu_s.gif
#############################################################
## Author Notes:
## 有蟲的話回報一下,感謝~
## 我的站 : http://oafwork.sytes.net/letstalk/
## Demo : 同上^^"
#############################################################
## MOD History:
##
## 2006-08-25 - Version 1.2 PLUS
## - 後台管理介面畫面重新編排
## - 後台會出現目前的跑馬燈公告預覽
##
## 跑馬燈公告 1.2 版更新
## 1.修補Global變數相關錯誤。
## 2.修補sid值為空的錯誤。
## 3.修補ob_start 問題 (感謝 Webspirit 會員)
##
## Martinet說:
## 以前的寫程式技術尚未成熟..現在看那程式碼狂搖頭.. = =
## 目前只修改小部分到能夠運作,不出錯誤訊息,不清楚還有沒有其他問題~
## 有的話麻煩回報下囉
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
# Remember to change the table prefix used on your database
CREATE TABLE `phpbb_announce` (
`id` MEDIUMINT( 8 ) DEFAULT '0' NOT NULL AUTO_INCREMENT,
`a_name` VARCHAR( 255 ) NOT NULL ,
`a_url` VARCHAR( 255 ) NOT NULL ,
`a_order` INT( 8 ) DEFAULT '1' NOT NULL ,
PRIMARY KEY ( `id` )
);
#
#-----[ COPY ]------------------------------------------
#
/admin/admin_announce.php 到 /admin/admin_announce.php
/templates/你的風格名稱/AnnounceMarq_add.tpl 到 /templates/你的風格名稱/admin/AnnounceMarq_add.tpl
/templates/你的風格名稱/AnnounceMarq_body.tpl 到 /templates/你的風格名稱/admin/AnnounceMarq_body.tpl
/lang/你的語言/lang_announce.php 到 /lang/你的語言/lang_announce.php
/images/*.gif 到 /images/*.gif
#
#-----[ OPEN ]------------------------------------------
#
language/your_language/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// 跑馬燈公告
$lang['Announce_no_announce'] = "目前沒有公告";
#
#-----[ OPEN ]------------------------------------------
#
language/your_language/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// 跑馬燈公告
$lang['Announce_main'] = "跑馬燈公告";
$lang['Announce_a_manage']="公告管理";
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
//
// Start output of page
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// 跑馬燈公告 By Martinet Oaf~
$sql = "SELECT * FROM phpbb_announce ORDER BY a_order";
if(!$a_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not query Announce information", "", __LINE__, __FILE__, $sql);
}
$i=0;
while ($a_row = $db->sql_fetchrow($a_result))
{
$i++;
$a_name = $a_row['a_name'];
$a_url = $a_row['a_url'];
$marque .= "<span class=\"genmed\"><b><a href=\"$a_url\">[$i]$a_name</a></b>       </span>";
}
if($i == 0)
$marque = $lang['Announce_no_announce'];
// 跑馬燈公告結束
#
#-----[ FIND ]------------------------------------------
#
'L_FORUM' => $lang['Forum'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ANNOUNCEMENT'=>$marque,
#
#-----[ OPEN ]------------------------------------------
# PS: 若是 PLUS 的, 請再修改 portal.php
portal.php
#
#-----[ FIND ]------------------------------------------
#
//
// Start output of page
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// 跑馬燈公告 By Martinet Oaf~
$sql = "SELECT * FROM phpbb_announce ORDER BY a_order";
if(!$a_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not query Announce information", "", __LINE__, __FILE__, $sql);
}
$i=0;
while ($a_row = $db->sql_fetchrow($a_result))
{
$i++;
$a_name = $a_row['a_name'];
$a_url = $a_row['a_url'];
$marque .= "<span class=\"genmed\"><b><a href=\"$a_url\">[$i]$a_name</a></b>       </span>";
}
if($i == 0)
$marque = $lang['Announce_no_announce'];
// 跑馬燈公告結束
#
#-----[ FIND ]------------------------------------------
#
'L_FORUM' => $lang['Forum'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ANNOUNCEMENT'=>$marque,
#
#-----[ OPEN ]------------------------------------------
#
templates\your_templates\index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- 中間跑馬燈廣告 by DAVID -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="row1" width="100%" height="20" onMouseOver="this.style.backgroundColor='yellow'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='';" >
<img src="images/announce.gif" alt="{L_ANNOUNCE_MAIN}">{L_ANNOUNCE_MAIN}™
<marquee scrollamount=3 scrolldelay=75 width="85%" onmouseover=this.stop(); onmouseout=this.start();>{ANNOUNCEMENT}</marquee>
</td>
</tr>
</table>
<!-- 中間跑馬燈廣告 by DAVID -->
#
#-----[ OPEN ]------------------------------------------
# PS: 若是 PLUS 的, 請再修改 index_body_plus.tpl
templates\your_templates\index_body_plus.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- 中間跑馬燈廣告 by DAVID -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="row1" width="100%" height="20" onMouseOver="this.style.backgroundColor='yellow'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='';" >
<img src="images/announce.gif" alt="{L_ANNOUNCE_MAIN}">{L_ANNOUNCE_MAIN}™
<marquee scrollamount=3 scrolldelay=75 width="85%" onmouseover=this.stop(); onmouseout=this.start();>{ANNOUNCEMENT}</marquee>
</td>
</tr>
</table>
<!-- 中間跑馬燈廣告 by DAVID -->
#
#-----[ OPEN ]------------------------------------------
# PS: 若是 PLUS 的, 請再修改 portal_body.tpl
templates\your_templates\portal_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- 中間跑馬燈廣告 by DAVID -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="row1" width="100%" height="20" onMouseOver="this.style.backgroundColor='yellow'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='';" >
<img src="images/announce.gif" alt="{L_ANNOUNCE_MAIN}">{L_ANNOUNCE_MAIN}™
<marquee scrollamount=3 scrolldelay=75 width="85%" onmouseover=this.stop(); onmouseout=this.start();>{ANNOUNCEMENT}</marquee>
</td>
</tr>
</table>
<!-- 中間跑馬燈廣告 by DAVID -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
檔案下載