[外掛]Board Message MOD 1.0.6

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
頭像
godbless
竹貓忠實會員
竹貓忠實會員
文章: 647
註冊時間: 2002-05-17 06:02
來自: 台北市南京東路4段
聯繫:

[外掛]Board Message MOD 1.0.6

文章 godbless »

這個版本只是簡易版,另外作者還有個XL版,過陣子再來試試看!
剛剛發現1.0.6版
作者同時因為工作等問題將會暫停研發新的版本,這個版本應該就是phpbb2.0.4下最終的版本了!
原始檔案:
http://www.shannado.nl/forumorg/
下載點:
http://www.shannado.nl/forumorg/board_msg.zip
[php]<?php
## EasyMod 0.0.7 compliant
#################################################################
## Mod Title: Board Message MOD
## 模組名稱:論壇公告模組
## Mod Version: 1.0.6
## 模組版本:1.0.6
## 作者 Author: Shannado - <sven@shannado.nl> - Sven - http://www.shannado.nl/forumorg
## Description: With this MOD the admin is able to set a message at the top of the board.
## He/She can choose in the board configuaration, if the message appear on ALL pages or on the Index ONLY or
## not at all.
##
## Installation Level: Easy
## 安裝難易度:簡單\r
## Installation Time: 10 - 20 Minutes
## 安裝時間:10 - 20分鐘
## 需要編輯的檔案 Files To Edit: page_header.php, lang_admin.php, admin_board.php, board_config_body.tpl, index.php, index_body.tpl, overall_header_tpl
## Included Files: N/A
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
##
## Author Note:
##
##
## Upload the 'board_msg_big.gif' to templates/subSilver/images.
## 上傳 'board_msg_big.gif' 到 templates/subSilver/images裡面去,或是\r
## 上傳到你的版面風格裡的images/資料夾下
##
## If you don't like the icons:
## 假使你不喜歡這個icon,你可以依循下列步驟拿掉它
## ---- [ FIND ] -----
## <img src="{BOARD_MSG_IMG}" />
##
## ---- [ REPLACE WITH ] -----
##
##
## The icon included is made by Alabama
##
## Compliant with phpBB v2.0.x
##
## History:
## ------------
## 0.9.0 beta
## - Beta
##
## 1.0.0 Final
## - Added title to the messagebox
##
## 1.0.1 Final
## - Fixed small typo (I left out a space in ['BOARD_MSG' => $board_msg,])
##
## 1.0.2 Final\r
## - Fixed small typo (was: $lang['board_msg'] = 'Board Message';
## must be: $lang['board_msg_title'] = 'Board Message';
##
## 1.0.3 Final
## - phpBB v2.0.1 compliant. No changes since v1.0.2
## - correct a small typo in the HOW TO (FIND), doesnt effect the MOD.
##
## 1.0.4 Final
## - added icons (made by Alabama) to the board message
##
## 1.0.5 Final
## - Changed some code regarding the images
##
## 1.0.6 Final
## - Made phpBB v2.0.2 complaint and EasyMod complaint
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ SQL ]-------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_msg_enable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_msg', '<center> This is an example message of the Board Message MOD.<br /><br /><a href=http://www.shannado.nl>Site of the Author</a><br /><a href=mailto:sven@shannado.nl>Sven Ansem</a></center>');
#
#-----[ COPY ]------------------------------------------
#
copy board_msg_big.gif to templates/subSilver/images

#
#-----[ OPEN ]------------------------------------------
#

language/lang_english/lang_admin.php


#
#-----[ FIND ]------------------------------------------
#

//
// That's all Folks!


#
#-----[ BEFORE, ADD ]------------------------------------------
#

//board msg MOD
$lang['Enable_board_msg'] = 'Enable Board Message';
$lang['board_msg'] = 'Board Message';
$lang['board_msg_explain'] = 'Enter the message that you will show. Max. 255 characters (including HTML - tags)';
$lang['board_msg_none'] = 'No message';
$lang['board_msg_index'] = 'Index ONLY';
$lang['board_msg_all'] = 'ALL pages';


#
#-----[ OPEN ]------------------------------------------
#

language/lang_english/lang_main.php


#
#-----[ FIND ]------------------------------------------
#

//
// That's all Folks!


#
#-----[ BEFORE, ADD ]------------------------------------------
#

//board msg MOD
$lang['board_msg_title'] = 'Board Message';
#
#-----[ OPEN ]------------------------------------------
#

language/lang_chinese_traditional_taiwan/lang_admin.php


#
#-----[ FIND ]------------------------------------------
#

//
// That's all Folks!


#
#-----[ BEFORE, ADD ]------------------------------------------
#

//board msg MOD
$lang['Enable_board_msg'] = '廣告看板狀態';
$lang['board_msg'] = '廣告看板';
$lang['board_msg_explain'] = '輸入你要顯示的文字,最多255字限制 (包含 HTML - 標籤語法)';
$lang['board_msg_none'] = '廣告關閉';
$lang['board_msg_index'] = '首頁';
$lang['board_msg_all'] = '所有頁面';


#
#-----[ OPEN ]------------------------------------------
#

language/lang_chinese_traditional_taiwan/lang_main.php


#
#-----[ FIND ]------------------------------------------
#

//
// That's all Folks!


#
#-----[ BEFORE, ADD ]------------------------------------------
#

//board msg MOD
$lang['board_msg_title'] = '廣告看板';

#
#-----[ OPEN ]------------------------------------------
#

include/page_header.php

#
#-----[ FIND ]------------------------------------------
#


//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//
// BEGIN - Board msg MOD\r
//
if ( $board_config['board_msg_enable'] )
{
$board_msg = $board_config['board_msg'];
}
else
{
$board_msg ='';
}
//
// END - Board msg MOD
//


#
#-----[ FIND ]------------------------------------------
#

$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

'BOARD_MSG' => $board_msg,
'BOARD_MSG_IMG' => $images['board_msg_img'],

#
#-----[ FIND ]------------------------------------------
#

'L_USERNAME' => $lang['Username'],

#
#-----[ BEFORE, ADD ]------------------------------------------
#

'L_BOARD_MSG' => $lang['board_msg_title'],

#
#-----[ FIND ]------------------------------------------
#

header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//
// BEGIN - board msg MOD
//
if ($board_config['board_msg_enable'] == '2')
{
$template->assign_block_vars('switch_enable_board_msg', array());
}
//
// END - board msg MOD
//
#
#-----[ OPEN ]------------------------------------------
#

templates/SubSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
#
</table></td>
</tr>
</table>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- BEGIN switch_enable_board_msg -->
<br />
<center>
<table border="0" class="forumline">
<tr>
<th colspan="3" class="thCornerL" height="25" nowrap="nowrap"> {L_BOARD_MSG} </th>
</tr>
<tr>
<td class="row1"><img src="{BOARD_MSG_IMG}" /></td>
<td class="row1"><span class="gen">{BOARD_MSG}</a></span></td>
<td class="row1"><img src="{BOARD_MSG_IMG}" /></td>
</tr>
</table>
</center>
<!-- END switch_enable_board_msg -->
#
#-----[ OPEN ]------------------------------------------
#

templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------
#

?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

$images['board_msg_img'] = "$current_template_images/board_msg_big.gif";

#
#-----[ OPEN ]------------------------------------------
#

index.php

#
#-----[ FIND ]------------------------------------------
#

//
// Generate the page
//

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//
// BEGIN - board msg MOD
//

if ($board_config['board_msg_enable'] == '1')
{
$template->assign_block_vars('switch_enable_board_msg_index', array());
}

//
// END - board msg MOD
//



#
#-----[ OPEN ]------------------------------------------
#

templates/SubSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="bottom"><span class="gensmall">
<!-- BEGIN switch_user_logged_in -->

#
#-----[ BEFORE, ADD ]------------------------------------------
#

<!-- BEGIN switch_enable_board_msg_index -->
<center>
<table border="0" class="forumline">
<tr>
<th colspan="3" class="thCornerL" height="25" nowrap="nowrap"> {L_BOARD_MSG} </th>
</tr>
<tr>
<td class="row1"><img src="{BOARD_MSG_IMG}" /></td>
<td class="row1"><span class="gen">{BOARD_MSG}</a></span></td>
<td class="row1"><img src="{BOARD_MSG_IMG}" /></td>
</tr>
</table>
<br />
</center>

<!-- END switch_enable_board_msg_index -->

#
#-----[ OPEN ]------------------------------------------
#

admin/admin_board.php

#
#-----[ FIND ]------------------------------------------
#

$prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";

#
#-----[ AFTER, ADD ]------------------------------------------
#

$board_msg_none = ( $new['board_msg_enable'] == '0' ) ? "checked=\"checked\"" : "";
$board_msg_index = ( $new['board_msg_enable'] == '1') ? "checked=\"checked\"" : "";
$board_msg_all = ( $new['board_msg_enable'] == '2') ? "checked=\"checked\"" : "";

#
#-----[ FIND ]------------------------------------------
#

"L_ENABLE_PRUNE" => $lang['Enable_prune'],
\n
#
#-----[ AFTER, ADD ]------------------------------------------
#

"L_ENABLE_BOARD_MSG" => $lang['Enable_board_msg'],
"L_BOARD_MSG_NONE" => $lang['board_msg_none'],
"L_BOARD_MSG_INDEX" => $lang['board_msg_index'],
"L_BOARD_MSG_ALL" => $lang['board_msg_all'],
"L_BOARD_MSG" => $lang['board_msg'],
"L_BOARD_MSG_EXPLAIN" => $lang['board_msg_explain'],

#
#-----[ FIND ]------------------------------------------
#

"PRUNE_NO" => $prune_no,

#
#-----[ AFTER, ADD ]------------------------------------------
#

"BOARD_MSG_NONE" => $board_msg_none,
"BOARD_MSG_INDEX" => $board_msg_index,
"BOARD_MSG_ALL" => $board_msg_all,
"BOARD_MSG" => $new['board_msg'],

#
#-----[ OPEN ]------------------------------------------
#

templates/SubSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<td class="row2"><input type="radio" name="board_disable" value="1" {S_DISABLE_BOARD_YES} /> {L_YES} <input type="radio" name="board_disable" value="0" {S_DISABLE_BOARD_NO} /> {L_NO}</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<tr>
<td class="row1">{L_ENABLE_BOARD_MSG}</td>
<td class="row2"><input type="radio" name="board_msg_enable" value="0" {BOARD_MSG_NONE} />{L_BOARD_MSG_NONE} <input type="radio" name="board_msg_enable" value="1" {BOARD_MSG_INDEX} />{L_BOARD_MSG_INDEX} <input type="radio" name="board_msg_enable" value="2" {BOARD_MSG_ALL} />{L_BOARD_MSG_ALL}</td>
</tr>
<tr>
<td class="row1">{L_BOARD_MSG}<br /><span class="gensmall">{L_BOARD_MSG_EXPLAIN}</span></td>
<td class="row2"><textarea name="board_msg" rows="5" cols="45">{BOARD_MSG}</textarea></td>
</tr>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
?>[/php]

另外,裝上後會有字元大小的限制,如果要解除,請再做以下動作
[php]<?php
#
#-----[ 打開 ]------------------------------------------
#

templates/SubSilver/admin/board_config_body.tpl

#
#-----[ 尋找下面語法 ]------------------------------------------
#

<tr>
<td class="row1">{L_ENABLE_BOARD_MSG}</td>
<td class="row2"><input type="radio" name="board_msg_enable" value="0" {BOARD_MSG_NONE} />{L_BOARD_MSG_NONE} <input type="radio" name="board_msg_enable" value="1" {BOARD_MSG_INDEX} />{L_BOARD_MSG_INDEX} <input type="radio" name="board_msg_enable" value="2" {BOARD_MSG_ALL} />{L_BOARD_MSG_ALL}</td>
</tr>
<tr>
<td class="row1">{L_BOARD_MSG}<br /><span class="gensmall">{L_BOARD_MSG_EXPLAIN}</span></td>
<td class="row2"><textarea name="board_msg" rows="5" cols="45">{BOARD_MSG}</textarea></td>
</tr>
#
#-----[ 其中的rows="5" cols="45" 是決定你的公告文字欄的最多字數=>5*45=>255]------------------------------------------
#
#
#-----[ 存檔 ]------------------------------------------
#
?>[/php]
同時進入phpMyAdmin介面

選XXX_config(如phpbb_config)

按config_value右邊的「修改」

將型態改成字元數較長的(我是改成TEXT)

按儲存。

相關修改資訊來自於:
http://phpbb-tw.net/phpbb/viewtopic.php?t=9527
外掛問題區發問格式就在這裡,請務必一定照著格式來~!
你不照著規則來,就算是也搞不清楚你的問題在哪裡!
新手問問題不是罪惡
罪惡的是自己沒有先做好本分和功課,說話的口氣也不好,再加上態度有好像我們這群人欠你多少似的~~!!
竹貓星球發問規則:
http://phpbb-tw.net/phpbb/viewtopic.php?t=16149
發問比率最高的句子翻譯:
Please ensure both the install/ and contrib/ directories are deleted
請確認install和contrib資料夾已被刪除(奇怪,翻一下英漢字典有這麼困難嗎)
主題已鎖定

回到「非官方認證外掛」