############################################################## 
## MOD Title:          Custom mass PM 
## MOD Author:         Niels < ncr@db9.dk > (Niels Chr. Rd) http://mods.db9.dk
## MOD Description:    #1 Add mass PM functionnality to group members
##                     (or all forums members) for authorized users.
##                     #2 Add the possibility for all users to send ordinary
##                     PM to multiple users (usernames separated by a semi-colon)
## MOD Version:        1.4.5
## MOD Compatibility:  2.0.6 (prior release not tested) 
## 
## Installation Level: Intermediate
## Installation Time:  20 Minutes (1mn by EasyMOD of Nuttzy) 
## Files To Edit:      12
##      privmsg.php 
##      admin/admin_groups.php
##      includes/emailer.php
##      includes/functions_validate.php
##      includes/usercp_avatar.php
##      includes/usercp_register.php
##      templates/subSilver/posting_body.tpl
##      templates/subSilver/privmsgs_body.tpl
##      templates/subSilver/profile_add_body.tpl
##      templates/subSilver/search_username.tpl
##      templates/subSilver/subSilver.cfg
##      templates/subSilver/admin/group_edit_body.tpl
##
## Included Files:     5
##      groupmsgs.php
##      language/lang_english/lang_mass_pm.php
##      language/lang_french/lang_mass_pm.php
##      language/lang_italian/lang_mass_pm.php
##      language/lang_spanish/lang_mass_pm.php
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
## 
## 1. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or 
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 1.1 SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then delete it from the phpBB root directory.
##
## Please, do it NOW! Before editing phpBB files by EM or manually!!!
## Otherwise, you may have an error message during your next
## connection.
##
## 1.2 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
## For this MOD, copy lang_*.php file(s) manually from
## their root/language/lang_xxx directories to their respective
## language/lang_xxx directories in the phpBB root dir.
##
## 2. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=274
##
## 3. Misc.
## -----------
## Admin can choose to "force" or not users to receive a mass PM.
## By default, users can choose. If you want to change, open
## includes/usercp_register.php, find "Who can disable receiving
## mass PM ?" and change the variable value.
##
## You can as admin deside witch users can mass PM a specific
## usergroup, this is done inside the admin panel -> group
## management. Here is a opption about who may mass PM that
## specific group
##
## It is also posible to "personalize the PM with a username,
## use the tag [USERNAME] (capital letters).
## This will be replaced with the users nick name
##
############################################################## 
## MOD History: 
## 
##   2003-12-09 - version 1.4.5
##      - phpBB template & EasyMOD compliance enhancement
##      - Italian translation now provide with the MOD
##
##   2003-11-20 - version 1.4.4
##      - added modifications to file functions_validate.php
##
##   2003-10-04 - version 1.4.3
##      - corrections to privmsg.php (error handling)
##
##   2003-09-14 - version 1.4.2
##      - corrected that users inbox  was "empty"
##
##   2003-08-23 - version 1.4.1
##      - corrected that users with ' in the name could be
##        included in mass PM list
##
##   2003-08-20 - Version 1.4.0
##      - Part 1 & part 2 merge in a single how-to
##      - Add a switch to choose who can disable receiving mass PM
##      - Admin group entries displayed in lowercase except
##        the first letter
##      - Remove the link on the right of "Savebox" and add a
##        new link on the right of "Newpost", displayed only 
##        if mass PM is autorized for the member
##      - Fix failed sending multiple PM when 1 email notification failed
##      - Move lang_main.php & lang_admin.php entries to lang_mass_pm.php
##      - Use ' instead of " for language entries
##      - Add French translation file
##      - How-to rewrite to be EasyMOD compatible
##
##   ????-??-?? - Version 1.3.4
##      - made how-to more specific into usercp_register.php
##
##   ????-??-?? - Version 1.3.3
##      - changed privmsg.php
##
##   ????-??-?? - Version 1.3.2
##      - now includeds a link to the mass pm inside the users PM page
##
##   ????-??-?? - Version 1.3.1
##      - now support tag USERNAME
##
##   ????-??-?? - Version 1.3.0
##      - now support user level auth, admin can specify witch
##        types of users may PM a group
##
##   ????-??-?? - Version 1.2.0
##      - now test on phpBB2 ver 2.0.2 - going out of BETA fase
##
##   ????-??-?? - Version 0.9.2
##      - importent security update in usercp_register.php
##
##   ????-??-?? - Version 0.9.1
##      - now included a groupmsg2.php file witch works together
##        with autogroup mod
##
##   ????-??-?? - Version 0.9.0
##      - initial beta 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ COPY ]------------------------------------------------ 
# 
copy custom_mass_pm_db_update.php to custom_mass_pm_db_update.php
copy root/groupmsg.php to groupmsg.php
copy root/language/lang_english/lang_mass_pm.php to language/lang_english/lang_mass_pm.php

#
# This MOD need a database update.
# Then, as you must have now copied the custom_mass_pm_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir/custom_mass_pm_db_update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#
#
# Moreover, because EM 0.0.10a can not already manage files for not
# necessarily existing language, language provide with this MOD can
# not be automatically installed (if I add the above instruction it
# can cause an installation error). So, if you need this language
# copy this file manually.
#
# copy root/language/lang_french/lang_mass_pm.php to language/lang_french/lang_mass_pm.php
# copy root/language/lang_italian/lang_mass_pm.php to language/lang_italian/lang_mass_pm.php
# copy root/language/lang_spanish/lang_mass_pm.php to language/lang_spanish/lang_mass_pm.php
#

# 
#-----[ OPEN ]------------------------------------------------ 
# 
privmsg.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
$to_username = $HTTP_POST_VARS['username']; 

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Custom mass PM MOD
$to_username_array = explode (";", $HTTP_POST_VARS['username']);
sort ($to_username_array);
foreach ($to_username_array as $name) $to_usernames .= "'".htmlspecialchars(trim($name))."',";
$to_usernames[strlen($to_usernames)-1]=" ";
// End replacement - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "SELECT user_id
FROM
WHERE username =
AND

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
SELECT user_id

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
, username

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
WHERE username = '" . str_replace("\'", "''", $to_username) . "'

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
# 
WHERE username IN ($to_usernames)

#
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
ANONYMOUS

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
 . " ORDER BY username ASC" 

# 
#-----[ FIND ]------------------------------------------------ 
# 
			if ( !($result = $db->sql_query($sql)) )
			{
				$error = TRUE;
				$error_msg = $lang['No_such_user'];
			}

			$to_userdata = $db->sql_fetchrow($result);
		}
		else
		{

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Custom mass PM MOD
	if( !($result2 = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
	}
	$to_users = $db->sql_fetchrowset($result2);
	$n=0;
	while ($to_username_array[$n] && !$error)
	{
		if (strcasecmp($to_users[$n]['username'], str_replace("\'", "'",$to_username_array[$n]))) 
		{ 
			$error = TRUE; 
			$error_msg .= $lang['No_such_user']." '".str_replace("\'", "'", $to_username_array[$n]);
		}
		$n++;
	}
}
else
{
// End replacement - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
if ( !$userdata['user_allow_pm'] )
{
$message =
message_die(
}

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

// Start add - Custom mass PM MOD
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
foreach($to_users as $to_userdata)
{
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer =

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
include($phpbb_root_path . 'includes/emailer.'.$phpEx);

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
#
// 1 line deleted for Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$emailer->send();

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Custom mass PM MOD
if (!($emailer_result=$emailer->send(1)))
{
	message_die(GENERAL_ERROR, 'Failed sending email :: ' . $emailer_result, '', __LINE__, __FILE__);
}
// End replacement - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$emailer->reset(
}
}

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

// Start add - Custom mass PM MOD
}
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$post_pm_img = '<a href=

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
 
// Start add - Custom mass PM MOD
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_mass_pm.' . $phpEx);
if ( $userdata['user_level'] == ADMIN )
{
	$mass_pm_img = '<a href="' . append_sid("groupmsg.$phpEx") . '"><img src="' . $images['mass_pm'] . '" border="0" alt="' . $lang['Mass_pm'] . '" /></a>';
} else
{
	$sql_g = "SELECT DISTINCT g.group_id
	FROM ".GROUPS_TABLE . " g, ".USER_GROUP_TABLE . " ug 
	WHERE g.group_single_user <> 1
		AND (
			(g.group_allow_pm='".AUTH_MOD."' AND g.group_moderator = '" . $userdata['user_id']."') OR  
			(g.group_allow_pm='".AUTH_ACL."' AND ug.user_id = " . $userdata['user_id'] . " AND ug.group_id = g.group_id ) OR
			(g.group_allow_pm='".AUTH_REG."') 		
		)" ;
	if( !$g_result = $db->sql_query($sql_g) )
	{
		message_die(GENERAL_ERROR, "Could not select group names!", __LINE__, __FILE__, $sql_g);
	}
	if( $db->sql_numrows($g_result))
	{
		$mass_pm_img = '<a href="' . append_sid("groupmsg.$phpEx") . '"><img src="' . $images['mass_pm'] . '" border="0" alt="' . $lang['Mass_pm'] . '" /></a>';
	}
}
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'POST_PM_IMG' =>

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

// Start add - Custom mass PM MOD
'MASS_PM_IMG' => $mass_pm_img,
// End add - Custom mass PM MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
admin/admin_groups.php

# 
#-----[ FIND ]------------------------------------------------
# 
require('./pagestart.' . $phpEx);

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

// Start add - Custom mass PM MOD
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_mass_pm.' . $phpEx);
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'group_moderator' => '',

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

// Start add - Custom mass PM MOD
'group_allow_pm' => AUTH_ADMIN,
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$group_hidden = ( $group_info['group_type'] == GROUP_HIDDEN )

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

// Start add - Custom mass PM MOD
$group_allow_pm_all = ( $group_info['group_allow_pm'] == AUTH_ALL ) ? ' checked="checked"' : '';
$group_allow_pm_reg = ( $group_info['group_allow_pm'] == AUTH_REG ) ? ' checked="checked"' : '';
$group_allow_pm_private = ( $group_info['group_allow_pm'] == AUTH_ACL ) ? ' checked="checked"' : '';
$group_allow_pm_mod = ( $group_info['group_allow_pm'] == AUTH_MOD ) ? ' checked="checked"' : '';
$group_allow_pm_admin = ( $group_info['group_allow_pm'] == AUTH_ADMIN ) ? ' checked="checked"' : '';
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'GROUP_MODERATOR' => $group_moderator, 

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

// Start add - Custom mass PM MOD
'GROUP_ALLOW_PM' => $group_info['group_allow_pm'],

'L_GROUP_ALLOW_PM' => $lang['group_allow_pm'],
'L_GROUP_ALLOW_PM_EXPLAIN' => $lang['group_allow_pm_explain'],
'L_GROUP_ALL_ALLOW_PM' => ucfirst(strtolower($lang['Forum_ALL'])),
'L_GROUP_REG_ALLOW_PM' => ucfirst(strtolower($lang['Forum_REG'])),
'L_GROUP_PRIVATE_ALLOW_PM' => ucfirst(strtolower($lang['Forum_PRIVATE'])),
'L_GROUP_MOD_ALLOW_PM' => ucfirst(strtolower($lang['Forum_MOD'])),
'L_GROUP_ADMIN_ALLOW_PM' => ucfirst(strtolower($lang['Forum_ADMIN'])),

'S_GROUP_ALL_ALLOW_PM_CHECKED' => $group_allow_pm_all,
'S_GROUP_REG_ALLOW_PM_CHECKED' => $group_allow_pm_reg,
'S_GROUP_PRIVATE_ALLOW_PM_CHECKED' => $group_allow_pm_private,
'S_GROUP_MOD_ALLOW_PM_CHECKED' => $group_allow_pm_mod,
'S_GROUP_ADMIN_ALLOW_PM_CHECKED' => $group_allow_pm_admin,
'S_GROUP_ALL_ALLOW_PM' => AUTH_ALL,
'S_GROUP_REG_ALLOW_PM' => AUTH_REG,
'S_GROUP_PRIVATE_ALLOW_PM' => AUTH_ACL,
'S_GROUP_MOD_ALLOW_PM' => AUTH_MOD,
'S_GROUP_ADMIN_ALLOW_PM' => AUTH_ADMIN,
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$delete_old_moderator = isset(

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

// Start add - Custom mass PM MOD
$group_allow_pm = isset($HTTP_POST_VARS['group_allow_pm']) ? intval($HTTP_POST_VARS['group_allow_pm']) : AUTH_ADMIN;
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "UPDATE " . GROUPS_TABLE . "
SET

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
$group_moderator

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, group_allow_pm = '$group_allow_pm'

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "INSERT INTO " . GROUPS_TABLE
VALUES (

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, group_moderator

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, group_allow_pm

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, $group_moderator

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, '$group_allow_pm'

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
function send()

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Custom mass PM MOD
function send($error_level=0)
// End replacement - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
// Did it work?
if (!$result

#
#-----[ IN-LINE FIND ]----------------------------------------
#
)

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
#
&& !$error_level

# 
#-----[ FIND ]------------------------------------------------ 
# 
return true;

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Custom mass PM MOD
return $result;
// End replacement - Custom mass PM MOD

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
// Don't allow 
if (strstr(

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, chr(160))

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
 || strstr($username, ';')

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
function display_avatar_gallery(

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
&$notifypm

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, &$allow_mass_pm

# 
#-----[ FIND ]------------------------------------------------ 
# 
$params = array(
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, 'notifypm'

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, 'allow_mass_pm'

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

# 
#-----[ FIND ]------------------------------------------------
# 
// Check and initialize some variables if needed
//

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

// Start add - Custom mass PM MOD
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_mass_pm.' . $phpEx);
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$signature = str_replace(

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

// Start add - Custom mass PM MOD
$allow_mass_pm = ( isset($HTTP_POST_VARS['allow_mass_pm']) ) ? intval ($HTTP_POST_VARS['allow_mass_pm']) : 2;
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "UPDATE " . USERS_TABLE . " 
SET

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
$notifypm 

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_allow_mass_pm = $allow_mass_pm

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "INSERT INTO " . USERS_TABLE
VALUES (

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
user_notify_pm

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_allow_mass_pm

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
$notifypm

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, $allow_mass_pm

# 
#-----[ FIND ]------------------------------------------------ 
# 
$interests = $userdata['user_interests'];

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

// Start add - Custom mass PM MOD
$allow_mass_pm=$userdata['user_allow_mass_pm'];
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
display_avatar_gallery( 

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
$notifypm

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, $allow_mass_pm

# 
#-----[ FIND ]------------------------------------------------ 
# 
$smilies_status = (

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

// Start add - Custom mass PM MOD
switch ($allow_mass_pm) 
{ 
   case 2: $allow_mass_pm_checked="checked=\"checked\"";break; 
   case 4: $allow_mass_pm_notify_checked="checked=\"checked\"";break; 
   default:$disable_mass_pm_checked="checked=\"checked\""; 
} 
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'body' => 'profile_add_body.tpl')
);

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

// Start add - Custom mass PM MOD
//------------------------------------------------------------
// Who can disable receiving mass PM ?
// Set 'A' for Admins, 'M' for admins+Mods or 'U' for all Users
//
$can_disable_mass_pm = 'U';
//
//------------------------------------------------------------

switch ( $can_disable_mass_pm ) 
{ 
	case A:
		if ( $userdata['user_level'] == ADMIN ) 
		{ 
			$template->assign_block_vars('switch_can_disable_mass_pm', array()); 
		} else 
		{ 
			$template->assign_block_vars('switch_can_not_disable_mass_pm', array()); 
		} 
		break;

	case M:
		if ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) 
		{ 
			$template->assign_block_vars('switch_can_disable_mass_pm', array()); 
		} else 
		{ 
			$template->assign_block_vars('switch_can_not_disable_mass_pm', array()); 
		} 
		break;

	default:
		$template->assign_block_vars('switch_can_disable_mass_pm', array()); 
		break;
}
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
#
'OCCUPATION' =>
'INTERESTS' =>

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

// Start add - Custom mass PM MOD
'ALLOW_MASS_PM' =>$allow_mass_pm,
'ALLOW_MASS_PM_CHECKED' => $allow_mass_pm_checked,
'ALLOW_MASS_PM_NOTIFY_CHECKED' => $allow_mass_pm_notify_checked,
'DISABLE_MASS_PM_CHECKED' => $disable_mass_pm_checked,
// End add - Custom mass PM MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'L_INTERESTS' =>

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

// Start add - Custom mass PM MOD
'L_ENABLE_MASS_PM' =>$lang['Enable_mass_pm'],
'L_ENABLE_MASS_PM_EXPLAIN' =>$lang['Enable_mass_pm_explain'],
'L_NO_MASS_PM' => $lang['No_mass_pm'],
// End add - Custom mass PM MOD

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

# 
#-----[ FIND ]------------------------------------------------ 
#
<input type="text"  class="post" name="username" maxlength="25"

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
name="username" maxlength="25"

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
#
name="username"

# 
#-----[ FIND ]------------------------------------------------ 
# 
<!-- END switch_privmsg -->

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

<!-- Start add - Custom mass PM MOD -->
<!-- BEGIN switch_groupmsg -->
<tr> 
	<td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
	<td class="row2"><span class="genmed">{USERNAME}</span></td>
</tr>
<!-- END switch_groupmsg -->
<!-- End add - Custom mass PM MOD -->

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
	<tr> 
	  <td align="left" valign="middle">{POST_PM_IMG}</td>

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

<!-- Start add - Custom mass PM MOD -->
	  <td align="left" valign="middle">{MASS_PM_IMG}</td>
<!-- End add - Custom mass PM MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
# 
	<tr> 
	  <td align="left" valign="middle"><span class="nav">{POST_PM_IMG}</span></td>

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

<!-- Start add - Custom mass PM MOD -->
	  <td align="left" valign="middle"><span class="nav">{MASS_PM_IMG}</span></td>
<!-- End add - Custom mass PM MOD -->

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
{NOTIFY_PM_NO}
{L_NO}
</tr>

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

<!-- Start add - Custom mass PM MOD -->
<!-- BEGIN switch_can_disable_mass_pm --> 
<tr> 
	<td class="row1"><span class="gen">{L_ENABLE_MASS_PM}:</span><br /> 
	<span class="gensmall">{L_ENABLE_MASS_PM_EXPLAIN}</span></td> 
	<td class="row2"> 
	<input type="radio" name="allow_mass_pm" value="4" {ALLOW_MASS_PM_NOTIFY_CHECKED}/> 
	<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
	<input type="radio" name="allow_mass_pm" value="2" {ALLOW_MASS_PM_CHECKED}/> 
	<span class="gen">{L_NO}</span>&nbsp;&nbsp; 
	<input type="radio" name="allow_mass_pm" value="0" {DISABLE_MASS_PM_CHECKED}/> 
	<span class="gen">{L_NO_MASS_PM}</span></td> 
</tr>
<!-- END switch_can_disable_mass_pm --> 

<!-- BEGIN switch_can_not_disable_mass_pm --> 
<tr> 
	<td class="row1"><span class="gen">{L_ENABLE_MASS_PM}:</span><br /> 
	<span class="gensmall">{L_ENABLE_MASS_PM_EXPLAIN}</span></td> 
	<td class="row2"> 
	<input type="radio" name="allow_mass_pm" value="4" {ALLOW_MASS_PM_NOTIFY_CHECKED}/> 
	<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
	<input type="radio" name="allow_mass_pm" value="2" {ALLOW_MASS_PM_CHECKED}/> 
	<span class="gen">{L_NO}</span></td> 
</tr>
<!-- END switch_can_not_disable_mass_pm --> 
<!-- End add - Custom mass PM MOD -->

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

# 
#-----[ FIND ]------------------------------------------------ 
#
opener.document.forms['post'].username.value = selected_username;

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

<!-- Start replacement - Custom mass PM MOD -->
if (opener.document.forms['post'].username.value)
{
	opener.document.forms['post'].username.value = opener.document.forms['post'].username.value + ', ' + selected_username;
}
else
{
	opener.document.forms['post'].username.value = selected_username;
}
<!-- End replacement - Custom mass PM MOD -->

# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/subSilver.cfg

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

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

// Start add - Custom mass PM MOD
$images['mass_pm'] = "$current_template_images/msg_outbox.gif";
// End add - Custom mass PM MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/admin/group_edit_body.tpl

# 
#-----[ FIND ]------------------------------------------------ 
# 
{L_GROUP_HIDDEN}</td> 
</tr>

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

<!-- Start add - Custom mass PM MOD -->
<tr> 
  <td class="row1" width="38%"><span class="gen">{L_GROUP_ALLOW_PM}:</span><br/>
  <span class="gensmall">{L_GROUP_ALLOW_PM_EXPLAIN}</span></td>
  <td class="row2" width="62%">
	<input type="radio" name="group_allow_pm" value="{S_GROUP_ALL_ALLOW_PM}" {S_GROUP_ALL_ALLOW_PM_CHECKED} /> {L_GROUP_ALL_ALLOW_PM} &nbsp;&nbsp;
	<input type="radio" name="group_allow_pm" value="{S_GROUP_REG_ALLOW_PM}" {S_GROUP_REG_ALLOW_PM_CHECKED} /> {L_GROUP_REG_ALLOW_PM} &nbsp;&nbsp;
	<input type="radio" name="group_allow_pm" value="{S_GROUP_PRIVATE_ALLOW_PM}" {S_GROUP_PRIVATE_ALLOW_PM_CHECKED} /> {L_GROUP_PRIVATE_ALLOW_PM} &nbsp;&nbsp;
	<input type="radio" name="group_allow_pm" value="{S_GROUP_MOD_ALLOW_PM}" {S_GROUP_MOD_ALLOW_PM_CHECKED} /> {L_GROUP_MOD_ALLOW_PM} &nbsp;&nbsp;
	<input type="radio" name="group_allow_pm" value="{S_GROUP_ADMIN_ALLOW_PM}" {S_GROUP_ADMIN_ALLOW_PM_CHECKED} /> {L_GROUP_ADMIN_ALLOW_PM} 
  </td> 
</tr>
<!-- End add - Custom mass PM MOD -->

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