##############################################################
## MOD Title: No mass mail to banned members
## MOD Author: eviL3 < evil@phpbbmodders.net > (Igor Wiedler) http://phpbbmodders.net
## MOD Description: Name says it all.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 1 Minutes
## Files To Edit: admin/admin_mass_email.php
##
## Included Files: n/a
## 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:
## This MOD uses a LEFT JOIN to prevent mass email to be sent
## to banned users. They don't deserve to be notified :P
##############################################################
## MOD History:
##
##   2006-10-03 - Version 0.1.0
##      - First version
##
##   2006-11-06 - Version 0.2.0
##      - Totally new concept (uses LEFT JOIN)
##      - No longer requires the user banned column mod
##
##   2006-12-06 - Version 1.0.0
##      - Recommented, MODx'd
##      - Submitted to MODDB
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_mass_email.php
#
#-----[ FIND ]------------------------------------------
#
	$sql
#
#-----[ REPLACE WITH ]------------------------------------------
#
# Replace the whole line with this!

//-- mod : No mass mail to banned members ------------------------------------------------------------
//-- add
	if ( $group_id != -1 )
	{
		$sql = 'SELECT u.user_email FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug
			LEFT JOIN " . BANLIST_TABLE . " b ON u.user_id = b.ban_userid
				WHERE ug.group_id = $group_id
				AND ug.user_pending <> " . TRUE . '
				AND u.user_id = ug.user_id
				AND ISNULL( b.ban_userid )';
	}
	else
	{
		$sql = 'SELECT u.user_email FROM ' . USERS_TABLE . " u
			LEFT JOIN " . BANLIST_TABLE . " b ON u.user_id = b.ban_userid
				WHERE ISNULL( b.ban_userid )";
	}
//-- fin mod : No mass mail to banned members --------------------------------------------------------

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