代碼: 選擇全部
########################################################
## 外掛名稱: Forum Background (版面背景圖案)
## 外掛作者: wang5555 < admin@wang5555.dyndns.org > (心靈捕手) http://wang5555.dyndns.org/
## 外掛描述: 這個外掛, 可以讓管理員在控制台中, 設定討論區首頁, 各個版面的背景圖案.
## 外掛版本: 1.0.0
##
## 安裝難度: 簡單
## 安裝時間: 10 分鐘內
##
## 需要編輯的檔案: 6
## index.php
## admin/admin_forums.php
## language/lang_chinese_traditional_taiwan/lang_admin.php
## templates/subSilver/admin/forum_admin_body.tpl
## templates/subSilver/admin/forum_edit_body.tpl
## templates/subSilver/index_body.tpl
##
## 附加的檔案: n/a
##
## 版權聲明: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
#################################################################
## 由於安全上的考量, 請檢查: http://phpbb-tw.net/phpbb/index.php
## 是否有此外掛的最新版本.
##
##############################################################
## 作者留言:
## 此外掛在 2.0.21 上測試過.
##此外掛編寫, 參考 Forum Icon (版面圖示) -by- yc16 (Y.C. LIN) http://macphpbbmod.sourceforge.net/
##特此銘謝! 參考連結: http://phpbb-tw.net/phpbb/viewtopic.php?t=20622
##
##############################################################
## 版本歷史:
##
## 2006 - 06 - 28 版本 1.0.0
## - 首次發佈
##
##############################################################
## 在增加此外掛前, 請務必備份所有需要修改的檔案
##############################################################
#
#-----[ SQL ]------------------------------------------
#
# 請記得修改成你的資料表頭名稱
ALTER TABLE phpbb_forums ADD forum_bg VARCHAR(255) DEFAULT NULL;
#
#-----[ 打開 ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_admin.php
#
#-----[ 尋找 ]------------------------------------------
#
$lang['Forum_status']
#
#-----[ 之後, 加上 ]------------------------------------------
#
$lang['Forum_bg'] = '版面背景圖案'; // Forum bg MOD
$lang['Forum_bg_explain'] = 'e.g. 如果您的圖片在 <b>phpBBRoot/images/forum_bg/test.gif</b><br /> 那麼路徑設定為 <b>images/forum_bg/test.gif</b>'; // Forum bg MOD
#
#-----[ 打開 ]------------------------------------------
#
admin/admin_forums.php
#
#-----[ 尋找 ]------------------------------------------
#
$forumstatus = $row['forum_status'];
#
#-----[ 之後, 加上 ]------------------------------------------
#
$forumbg = $row['forum_bg']; // Forum bg MOD
#
#-----[ 尋找 ]------------------------------------------
#
$forumstatus = FORUM_UNLOCKED;
#
#-----[ 之後, 加上 ]------------------------------------------
#
$forumbg = ''; // Forum bg MOD
#
#-----[ 尋找 ]------------------------------------------
#
'L_FORUM_STATUS' => $lang['Forum_status'],
#
#-----[ 之後, 加上 ]------------------------------------------
#
'L_FORUM_BG' => $lang['Forum_bg'], // Forum bg MOD
'L_FORUM_BG_EXPLAIN' => $lang['Forum_bg_explain'], // Forum bg MOD
#
#-----[ 尋找 ]------------------------------------------
#
'DESCRIPTION' => $forumdesc)
#
#-----[ 之前, 加上 ]------------------------------------------
#
'BG' => ( $forumbg ) ? $forumbg : '', // Forum bg MOD
'BG_DISPLAY' => ( $forumbg ) ? '<img src="' . $phpbb_root_path . $forumbg . '" />' : '', // Forum bg MOD
#
#-----[ 尋找 ]------------------------------------------
#
$sql = "INSERT INTO " . FORUMS_TABLE
#
#-----[ 在該行內尋找 ]------------------------------------------
#
, forum_status
#
#-----[ 在該行後, 加上 ]------------------------------------------
#
, forum_bg
#
#-----[ 尋找 ]------------------------------------------
#
VALUES ('" . $next_id . "', '" .
#
#-----[ 在該行內尋找 ]------------------------------------------
#
, " . intval($HTTP_POST_VARS['forumstatus']) . "
#
#-----[ 在該行後, 加上 ]------------------------------------------
#
, '" . str_replace("\'", "''", $HTTP_POST_VARS['forumbg']) . "'
#
#-----[ 尋找 ]------------------------------------------
#
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "'
#
#-----[ 在該行內尋找 ]------------------------------------------
#
, forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . "
#
#-----[ 在該行後, 加上 ]------------------------------------------
#
, forum_bg = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumbg']) . "'
#
#-----[ 尋找 ]------------------------------------------
#
$template->assign_block_vars("catrow.forumrow", array(
#
#-----[ 之前, 加上 ]------------------------------------------
#
$forum_bg_img = ( $forum_rows[$j]['forum_bg'] ) ? 'background="' . $phpbb_root_path . $forum_rows[$j]['forum_bg'] . '"' : ''; // Forum bg Mod
#
#-----[ 尋找 ]------------------------------------------
#
'FORUM_DESC' => $forum_rows[$j]['forum_desc'],
#
#-----[ 之後, 加上 ]------------------------------------------
#
'FORUM_BG_IMG' => $forum_bg_img, // Forum bg Mod
#
#-----[ 打開 ]------------------------------------------
#
index.php
#
#-----[ 尋找 ]------------------------------------------
#
$posts = $forum_data[$j]['forum_posts'];
$topics = $forum_data[$j]['forum_topics'];
#
#-----[ 之後, 加上 ]------------------------------------------
#
$bg = $forum_data[$j]['forum_bg']; // Forum bg Mod
#
#-----[ 尋找 ]------------------------------------------
#
$template->assign_block_vars('catrow.forumrow', array(
#
#-----[ 之前, 加上 ]------------------------------------------
#
$forum_bg_img = ($bg) ? 'background="' . $phpbb_root_path . $bg . '" title="'.$forum_data[$j]['forum_name'].'"' : ''; // Forum bg Mod
#
#-----[ 尋找 ]------------------------------------------
#
'FORUM_FOLDER_IMG' => $folder_image,
#
#-----[ 之後, 加上 ]------------------------------------------
#
'FORUM_BG_IMG' => $forum_bg_img, // Forum bg Mod
#
#-----[ 打開 ]------------------------------------------
#
templates/subSilver/admin/forum_edit_body.tpl
#
#-----[ 尋找 ]------------------------------------------
#
<td class="row2"><input type="text" size="25" name="forumname" value="{FORUM_NAME}" class="post" /></td>
</tr>
#
#-----[ 之後, 加上 ]------------------------------------------
#
<tr>
<td class="row1">{L_FORUM_BG}<br /><span class="gensmall">{L_FORUM_BG_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="35" name="forumbg" value="{BG}" class="post" /><br />{BG_DISPLAY}</td>
</tr>
#
#-----[ 打開 ]------------------------------------------
#
templates/subSilver/admin/forum_admin_body.tpl
#
#-----[ 尋找 ]------------------------------------------
#
<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>
#
#-----[ 取代成 ]------------------------------------------
#
<td {catrow.forumrow.FORUM_BG_IMG} class="row2" height="50"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>
#
#-----[ 打開 ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ 尋找 ]------------------------------------------
#
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
#
#-----[ 取代為 ]------------------------------------------
#
<td {catrow.forumrow.FORUM_BG_IMG} class="row1" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
#
#-----[ 儲存/關閉所有檔案 ]------------------------------------------
#
#
# 外掛修正結束
1. 版面背景圖案, 請自行設定好寬度以及高度, 並且於 index_body.tpl 中指定之
此外掛, 僅預設高度為 50 像素 (height="50"), 寬度請自行斟酌.
2. 版面背景圖案, 不宜太過花俏, 以免叫人眼花撩亂, 而適得其反;
建議用 '影像處理' 軟體將其 '淡化'.
展示圖片:
1. 首頁

2. 版面管理

3. 版面編輯
