######################################################## 
## 外挂名称: Support Announcement MOD
## 外挂作者: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## 外挂描述: This mod allow admin to show support status and details on forum. Most useful for webmasters hosting support forums
## 外挂版本: 1.2.4
## 
## 安装难度: 简单 
## 安装时间: 3 分钟 
##
## 需要编辑的档案: 4
##	language/lang_chinese_traditional_taiwan/lang_admin.php
##	language/lang_chinese_traditional_taiwan/lang_main.php
##	includes/page_header.php
##	templates/subSilver/overall_header.tpl
##
## 附加的档案: 3
##	root/images/support.gif
##	root/admin/admin_support.php
##	root/templates/subSilver/admin/admin_support.tpl
##
## 版权声明: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## 由于安全上的考量, 请检查: http://www.phpbb.com/mods/
## 是否有此外挂的最新版本. 虽然在加入外挂资料库前，外挂已经经过检查
## 但是这并不保证外挂中完全没有安全上的问题. 
## 对于不在外挂资料库 (http://www.phpbb.com/mods/) 内的外挂
## 将不会在 phpbb.com 的讨论板内给予支援 
############################################################## 
## 作者留言:
##	此外挂在 2.0.20 上测试过. 可以用 EasyMOD 0.3.0 来安装此外挂
##	外挂图例可以在 screenshots 文件夹中找到
##	荷兰语系翻译由 carloclaessen, phpBB 提供 (dutch translation.txt)
## 
############################################################## 
## 版本历史: 
##
##   2004-01-18 - 版本 1.0.0
##      - 首次发布
##
##   2004-01-23 - 版本 1.1.0
##      - 荷兰语系翻译由 carloclaessen 提供
##	- 提交到 phpBB 外挂资料库
##
##   2004-01-30 - 版本 1.2.0
##      - 增加离线服务和在线服务时的服务员
##
##   2004-03-15 - 版本 1.2.1
##      - 可在 phpBB 2.0.7 上使用
##	- 一些程式修改和修正
##	- 再次提交到 phpBB 外挂资料库
##
##   2004-05-21 - 版本 1.2.2
##      - 可在 phpBB 2.0.8 上使用
##	- 修正了由 phpBB 检验小组指出的外挂说明问题
##	- 修改了本在 template 里的版本声明至语系档内
##
##   2005-08-14 - 版本 1.2.3
##      - 重新提交 phpbb.com 认证
##	- 在 2.0.17 上测试并且使用最新的 MOD template
##
##   2006-05-20 - 版本 1.2.4
##	- 增加了是否显示服务状态区块的选项
##	- 在 2.0.20 上测试
## 
############################################################## 
## 在增加此外挂前, 请务必备份所有需要修改的档案
##############################################################
# 
#-----[ 复制 ]------------------------------------------ 
#
copy root/images/support.gif to images/support.gif
copy root/admin/admin_support.php to admin/admin_support.php
copy root/templates/subSilver/admin/admin_support.tpl to templates/subSilver/admin/admin_support.tpl

# 
#-----[ SQL ]------------------------------------------ 
#
# 请记得修改成你的资料表名称
INSERT INTO `phpbb_config` VALUES ('support_display','1');
INSERT INTO `phpbb_config` VALUES ('support_status','0');
INSERT INTO `phpbb_config` VALUES ('support_online_admin','');
INSERT INTO `phpbb_config` VALUES ('support_offline_admin','');
INSERT INTO `phpbb_config` VALUES ('support_onlinetext','');
INSERT INTO `phpbb_config` VALUES ('support_onlinecontact','');
INSERT INTO `phpbb_config` VALUES ('support_offlinetext','');
INSERT INTO `phpbb_config` VALUES ('support_offlinecontact','');
INSERT INTO `phpbb_config` VALUES ('support_image','images/support.gif');

# 
#-----[ 打开 ]------------------------------------------ 
#
language/lang_chinese_traditional_taiwan/lang_admin.php

# 
#-----[ 寻找 ]------------------------------------------ 
#
?>

# 
#-----[ 之前, 加上 ]------------------------------------------ 
#
// Support Announcement MOD
$lang['Support'] = '服务组态';
$lang['Support_config_updated'] = '服务组态更新完成';
$lang['Click_return_support_config'] = '点选 %这里%s 返回服务状态显示控制台';
$lang['Support_config'] = '服务状态显示控制台';
$lang['Support_config_explain'] = '以下表格可以让你编辑服务状态显示的设定';
$lang['Support_settings'] = '服务状态显示设定';
$lang['Support_display'] = '显示服务状态区块';
$lang['Support_display_explain'] = '启用这个选项让服务状态区块显示在讨论版上方';
$lang['Support_status'] = '服务状态';
$lang['Support_status_explain'] = '您目前的服务状态';
$lang['Support_online_admin'] = '<b>服务中</b> 的服务人员';
$lang['Support_offline_admin'] = '<b>暂停服务</b> 的服务人员';
$lang['Support_online_admin_explain'] = '服务中时将提供服务的人员名称, i.e. 系统管理员或网管<BR>可以使用 HTML 代码, 最大限制 255 个字元';
$lang['Support_offline_admin_explain'] = '暂停服务时将提供服务的人员名称, i.e. 系统管理员或网管<BR>可以使用 HTML 代码, 最大限制 255 个字元';
$lang['Support_online_detail'] = '服务中的资讯';
$lang['Support_offline_detail'] = '暂停服务的资讯';
$lang['Support_deatil_explain'] = '可以使用 HTML 代码, 最大限制 255 个字元';

$lang['Support_onlinetext'] = '<b>服务中</b>的详情';
$lang['Support_onlinetext_explain'] = '在讨论版中显示服务的讯息';
$lang['Support_offlinetext'] = '<b>暂停服务</b>的详情';
$lang['Support_offlinetext_explain'] = '在讨论版中显示服务的讯息"';
$lang['Support_onlinecontact'] = '<b>服务中</b>联络方式';
$lang['Support_onlinecontact_explain'] = '在讨论版中显示联络的方式';
$lang['Support_offlinecontact'] = '<b>暂停服务</b>的联络方式';
$lang['Support_offlinecontact_explain'] = '在讨论版中显示联络的方式';
$lang['Support_image'] = '服务图示路径';
$lang['Support_image_explain'] = '在您 phpBB 2 根目录底下的路径, e.g. images/support.gif';
$lang['Support_version'] = 'Support Announcement MOD 版本 1.2.4 (2006-05-20)';

# 
#-----[ 打开 ]------------------------------------------ 
#
language/lang_chinese_traditional_taiwan/lang_main.php

# 
#-----[ 寻找 ]------------------------------------------ 
#
?>

# 
#-----[ 之前, 加上 ]------------------------------------------ 
#
// Support Announcement MOD
$lang['support_na'] = 'n/a';
$lang['Support_status_f'] = '服务状态';
$lang['Support_admin_name_f'] = '服务人员';
$lang['Support_text_f'] = '详情';
$lang['Support_contact_f'] = '联络方式';
$lang['On'] = '服务中';
$lang['Off'] = '服务暂停';

# 
#-----[ 打开 ]------------------------------------------ 
#
includes/page_header.php

# 
#-----[ 寻找 ]------------------------------------------ 
#
//
// Generate HTML required for Mozilla Navigation bar
//

# 
#-----[ 之前, 加上 ]------------------------------------------ 
#
$support_display = $board_config['support_display'];
$support_status = $board_config['support_status'];
$support_online_admin = ($board_config['support_online_admin']) ? $board_config['support_online_admin'] : $lang['support_online_admin'];
$support_offline_admin = ($board_config['support_offline_admin']) ? $board_config['support_offline_admin'] : $lang['support_offline_admin'];
$support_image = ($board_config['support_image']) ? '<img src="' . $phpbb_root_path. '/' . $board_config['support_image'] . '" border="0" />' : $lang['support_na'];
$online_text = ($board_config['support_onlinetext']) ? $board_config['support_onlinetext'] : $lang['support_na'];
$online_contact = ($board_config['support_onlinecontact']) ? $board_config['support_onlinecontact'] : $lang['support_na'];
$offline_text = ($board_config['support_offlinetext']) ? $board_config['support_offlinetext'] : $lang['support_na'];
$offline_contact = ($board_config['support_offlinecontact']) ? $board_config['support_offlinecontact'] : $lang['support_na'];

// Check status
if ($support_display == 1)
{
	$template->assign_block_vars('switch_support_display_block', array() );

	if ($support_status == 1) 
	{
		$support_status = $lang['On'];
		$support_text = $online_text;
		$support_contact = $online_contact;
		$support_admin_name = $support_online_admin;
	}
	else
	{
		$support_status = $lang['Off'];
		$support_text = $offline_text;
		$support_contact = $offline_contact;
		$support_admin_name = $support_offline_admin;		
	}
	$support_admin_name = ($support_admin_name) ? $support_admin_name : $lang['support_na'];
}
// END Support Announcement MOD

# 
#-----[ 寻找 ]------------------------------------------ 
#
	'PRIVMSG_IMG' => $icon_pm,

# 
#-----[ 之后, 加上 ]------------------------------------------ 
#
	// BEGIN Support Announcement MOD
	'SUPPORT_STATUS' => $support_status,
	'SUPPORT_ADMIN_NAME' => $support_admin_name,
	'SUPPORT_TEXT' => $support_text,
	'SUPPORT_CONTACT' => $support_contact,
	'SUPPORT_IMAGE' => $support_image,

	'L_SUPPORT_STATUS' => $lang['Support_status_f'],
	'L_SUPPORT_ADMIN_NAME' => $lang['Support_admin_name_f'],
	'L_SUPPORT_TEXT' => $lang['Support_text_f'],
	'L_SUPPORT_CONTACT' => $lang['Support_contact_f'],
	// END Support Announcement MOD

# 
#-----[ 打开 ]------------------------------------------ 
#
templates/subSilver/overall_header.tpl

# 
#-----[ 寻找 ]------------------------------------------ 
#
					</tr>
				</table></td>
			</tr>
		</table>

# 
#-----[ 之后, 加上 ]------------------------------------------ 
#
<!-- BEGIN switch_support_display_block -->
<br />

<table width="100%" border="0" class="forumline">
	<tr> 
		<td class="row1" rowspan="2" align="center" nowrap="nowrap"><span class="gensmall">{SUPPORT_IMAGE}</span></th>
		<td class="row1" align="center" height="28"><span class="topictitle">&nbsp;{L_SUPPORT_STATUS}&nbsp;</span></td>
		<td class="row1" align="center" height="28"><span class="topictitle">&nbsp;{L_SUPPORT_ADMIN_NAME}&nbsp;</span></td>
		<td class="row1" align="center" height="28"><span class="topictitle">&nbsp;{L_SUPPORT_TEXT}&nbsp;</span></td> 
		<td class="row1" align="center" height="28"><span class="topictitle">&nbsp;{L_SUPPORT_CONTACT}&nbsp;</span></td> 
	</tr>
	<tr> 
		<td class="row2" align="center" valign="middle" height="28"><span class="gensmall">{SUPPORT_STATUS}</span></td>
		<td class="row2" align="center" valign="middle" height="28"><span class="gensmall">{SUPPORT_ADMIN_NAME}</span></td>
		<td class="row2" align="center" valign="middle" height="28"><span class="gensmall">{SUPPORT_TEXT}</span></td>
		<td class="row2" align="center" valign="middle" height="28"><span class="gensmall">{SUPPORT_CONTACT}</span></td>
	</tr>
</table>
<!-- END switch_support_display_block -->

# 
#-----[ 储存/关闭所有档案 ]------------------------------------------ 
# 
# 外挂修正结束