代碼: 選擇全部
########################################################
## Mod Title: 跑馬燈公告
## Mod Version: 1.0
## Mod Date: 2003 11月 17日
##
## By: Martinet Oaf < oafwork@hotmail.com >
##
## Description:
## 這可以讓你的首頁有一個跑馬燈式的公告喔~
## 而且 , 公告的編增刪都是在後台作的~
#
## Installation Level: 簡單
## Installation Time: 1 分鐘不到 ^^"
## Files To Edit: 2
## 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
########################################################
## Author Notes:
## 我的站 : http://oafwork.sytes.net/letstalk/
## Demo : 同上^^"
########################################################
檔案下載 : http://oafwork.sytes.net/ofdb/download.php?fileid=1
先執行下面的SQL語法喔~
===================================
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` )
);
===================================
來複製檔案吧
===================================
/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/announce.gif 到 /images/announce.gif
===================================
打開 language/your_language/lang_main.php
找到
前面加上
//Martinet Announce
$lang['Announce_no_announce'] = "目前沒有公告";
打開index.php
找到
===================================
//
// Start output of page
===================================
在上面加上
========================================================================================
// 跑馬燈公告 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'];
// 跑馬燈公告結束
===========================================================================================
找到
==================================
'FORUM_LOCKED_IMG' => $images['forum_locked'],
==================================
在下面加上
==================================
'ANNOUNCEMENT'=>$marque,
==================================
打開index_body.tpl
找到
===================================
{L_INDEX}</a></span>
===================================
在後面加上
===================================
<br><img src="images/announce.gif"><marquee scrollamount=3 scrolldelay=75 width="50%" onmouseover=this.stop(); onmouseout=this.start();>{ANNOUNCEMENT}</marquee>
===================================
完畢囉~ 請享受~
[問題]跑馬燈的問題(已解決)
http://phpbb-tw.net/phpbb/viewtopic.php ... A%E6%81%AF
也就是說請你將 '指令' 更改一下而已.
我的岐黃論壇要用上面的語法
代碼: 選擇全部
CREATE TABLE `phpbb_announce` (
`id` MEDIUMINT( 8 ) 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` )
)
可在公告前加上動畫圖示,會帶領著跑,我的檔名dog.gif
代碼: 選擇全部
<br><img src="images/announce.gif"><marquee scrollamount=3 scrolldelay=75 width="50%" onmouseover=this.stop(); onmouseout=this.start();>{ANNOUNCEMENT}</marquee>
找到{ANNOUNCEMENT}
取代<img src="images/dog.gif">{ANNOUNCEMENT}<img src="images/dog.gif">