######################################################## 
## MOD Title: Support Announcement MOD
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: This mod allow admin to show support status and details on forum. Most useful for webmasters hosting support forums
## MOD Version:	1.2.4
## 
## Installation Level: Easy 
## Installation Time: 3 Minutes 
##
## Files To Edit: 4
##	language/lang_english/lang_admin.php
##	language/lang_english/lang_main.php
##	includes/page_header.php
##	templates/subSilver/overall_header.tpl
##
## Included Files: 3
##	root/images/support.gif
##	root/admin/admin_support.php
##	root/templates/subSilver/admin/admin_support.tpl
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
## 	Tested on 2.0.20. Can be installed using EasyMOD 0.3.0
##	MOD screenshots inclused in screenshots folder
##	Dutch translation provided by carloclaessen, phpBB (dutch translation.txt)
## 
############################################################## 
## MOD History: 
##
##   2004-01-18 - Version 1.0.0
##      - Initial Release
##
##   2004-01-23 - Version 1.1.0
##      - Dutch translation provided by carloclaessen
##	- Submit to phpBB MOD DB
##
##   2004-01-30 - Version 1.2.0
##      - Added Offline and Online Support Officers
##
##   2004-03-15 - Version 1.2.1
##      - phpBB 2.0.7 Compliance
##	- A few code changes & fix
##	- Submit to phpBB MOD DB again
##
##   2004-05-21 - Version 1.2.2
##      - phpBB 2.0.8 Compliance
##	- Slight changes in the MOD template recommended by phpBB Validation Team
##	- Change MOD version declaration from template into language varible
##
##   2005-08-14 - Version 1.2.3
##      - Re-submitted to MOD DB
##	- Tested on 2.0.17 and use the latest MOD template
##
##   2006-05-20 - Version 1.2.4
##	- Added an option to disable/enable Support Announcement panel.
##	- Tested on 2.0.20
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
# 
#-----[ COPY ]------------------------------------------ 
#
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 ]------------------------------------------ 
#
# Remember to change the table prefix used on your database
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');

# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
// Support Announcement MOD
$lang['Support'] = 'Support Config';
$lang['Support_config_updated'] = 'Support configurations have been updated';
$lang['Click_return_support_config'] = 'Click %sHere%s to return to Support Announcement Admin Panel';
$lang['Support_config'] = 'Support Announcement Admin Panel';
$lang['Support_config_explain'] = 'The form below will allow you to customize the Support Announcement MOD options';
$lang['Support_settings'] = 'Support Announcement Settings';
$lang['Support_display'] = 'Show Support Announcement Panel';
$lang['Support_display_explain'] = 'Enable this option to show Support Announcement panel on forum header';
$lang['Support_status'] = 'Support Status';
$lang['Support_status_explain'] = 'This will indicate your current support status on the forum';
$lang['Support_online_admin'] = '<b>Online</b> Support Officer(s)';
$lang['Support_offline_admin'] = '<b>Offline</b> Support Officer(s)';
$lang['Support_online_admin_explain'] = 'The name of the person offering support during ONLINE status, i.e. forum admin or webmaster<BR>Can user HTML tags and max. 255 characters';
$lang['Support_offline_admin_explain'] = 'The name of the person offering support during OFFLINE status, i.e. forum admin or webmaster<BR>Can user HTML tags and max. 255 characters';
$lang['Support_online_detail'] = 'Support Details during ONLINE status';
$lang['Support_offline_detail'] = 'Support Details during OFFLINE status';
$lang['Support_deatil_explain'] = 'Can user HTML tags and max. 255 characters';

$lang['Support_onlinetext'] = '<b>Online</b> Support Text';
$lang['Support_onlinetext_explain'] = 'The text to be displayed on forum';
$lang['Support_offlinetext'] = '<b>Offline</b> Support Text';
$lang['Support_offlinetext_explain'] = 'The text to be displayed on forum"';
$lang['Support_onlinecontact'] = '<b>Online</b> Contact details';
$lang['Support_onlinecontact_explain'] = 'The contact detail of the person offering support';
$lang['Support_offlinecontact'] = '<b>Offline</b> Contact details';
$lang['Support_offlinecontact_explain'] = 'The contact detail of the person offering support';
$lang['Support_image'] = 'Support Image Path';
$lang['Support_image_explain'] = 'Path under your phpBB root dir, e.g. images/support.gif';
$lang['Support_version'] = 'Support Announcement MOD Version 1.2.4 (2006-05-20)';

# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
// Support Announcement MOD
$lang['support_na'] = 'n/a';
$lang['Support_status_f'] = 'Support Status';
$lang['Support_admin_name_f'] = 'Support Officer';
$lang['Support_text_f'] = 'Details';
$lang['Support_contact_f'] = 'How to Contact';
$lang['On'] = 'On';
$lang['Off'] = 'Off';

# 
#-----[ OPEN ]------------------------------------------ 
#
includes/page_header.php

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

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
$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

# 
#-----[ FIND ]------------------------------------------ 
#
	'PRIVMSG_IMG' => $icon_pm,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	// 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

# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/overall_header.tpl

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
<!-- 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 -->

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM