I have the "Admin New Topic Notifier" installed on here with a slight modification of my own to also notify moderators (well...moderator as I only have one

). With a few modifications you can make it work for your purposes as well. Here is the mod in its modified state:
Code: Select all
##############################################################
## MOD Title: Easy Topic Notifier
## MOD Author: DavidIQ (original by: StefanKausL < stefan@kuhlins.de > (Stefan Kuhlins) http://kuhlins.de/)
## MOD Description: This simple MOD notifies admins and moderators by email of new topics.
## MOD Version: 1.0
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: includes/functions_post.php
##
## Included Files: easy_admin_topic_notifier.tpl
##############################################################
## 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:
##
## This MOD is especially useful for seldom used forums.
##
## The template for the email is copied to the English directory.
## If you want to support different languages change the statement
## $emailer->use_template('easy_admin_topic_notifier', 'english');
## to
## $emailer->use_template('easy_admin_topic_notifier', $row['user_lang']);
## and copy localized versions of the template file
## easy_admin_topic_notifier.tpl in every language directory.
##############################################################
## MOD History:
##
## 2007-02-08 - Version 1.0
## Adaptation of easy admin topic notifier
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]---------------------------------------------
#
copy easy_admin_topic_notifier.tpl to language/lang_english/email/easy_admin_topic_notifier.tpl
#
#-----[ OPEN ]---------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]---------------------------------------------
#
$topic_id = $db->sql_nextid();
#
#-----[ AFTER, ADD ]---------------------------------------------
#
sk_send_mail_to_admins($topic_id, $post_subject);
#
#-----[ FIND ]---------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function sk_send_mail_to_admins($topic_id, $post_subject) {
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';
$sql = "SELECT user_email, user_lang FROM " . USERS_TABLE . " WHERE user_level IN(" . ADMIN . ", " . MOD . ")";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
$emailer->email_address(trim($row['user_email']));
$emailer->use_template('easy_admin_topic_notifier', 'english'); // See Notes!
$emailer->from($board_config['board_email']);
$emailer->set_subject($lang['New_post']);
$emailer->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'TOPIC_TITLE' => $post_subject,
'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . "=$topic_id",
'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '')
);
$emailer->send();
$emailer->reset();
}
$db->sql_freeresult($result);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
This is the only difference:
Code: Select all
$sql = "SELECT user_email, user_lang FROM " . USERS_TABLE . " WHERE user_level IN(" . ADMIN . ", " . MOD . ")";
This would notify all admin users and all moderators of new topics. If you wanted to have the notification only sent to moderators of a specific forum you can try manipulating the sql part a bit to achieve this. It would require a bit of research to figure it out but shouldn't be too hard especially since the post_id is already passed to the function. If this sounds like another language to you just reply and say so...