Welcome to Geeklog, Anonymous Saturday, November 23 2024 @ 02:18 pm EST
Geeklog Forums
hmmmmm???
Page navigation
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
first, you know that you can enable notification for submissions via config.php, right? ...see $_CONF['notification'].
if you want notification to go to more than just $_CONF['site_mail'], which it goes to by default, then you have just to replace that setting with an array of to addresses like the code above does.
find the funciton sendNotification() in submit.php. Look for this line near the end:
insert a few lines and edit that line as well to take the array--like this:
//get user ids of group 'root'
$resultA = DB_query("SELECT ug_uid FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id='1'");
if(DB_numRows($resultA) >= 1){
//for each of your admins add their email addy to $to
//mail.php can take an array or list of comma separated recipients...
while($A = DB_fetchArray($resultA)){
$resultB = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = {$A['ug_uid']}");
$B = DB_fetchArray($resultB);
if (!empty ($B['fullname'])) {
$to[] = COM_formatEmailAddress ($B['fullname'], $B['email']);
} else {
$to[] = COM_formatEmailAddress ($B['username'], $B['email']);
}
}
}
COM_mail ($to, $mailsubject, $mailbody);
you can take this further and throw a setting in config.php that will be checked to see if you want notifications to go to admin only or the moderator or group thereof.
Untested
if you want notification to go to more than just $_CONF['site_mail'], which it goes to by default, then you have just to replace that setting with an array of to addresses like the code above does.
find the funciton sendNotification() in submit.php. Look for this line near the end:
Text Formatted Code
COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);Text Formatted Code
$to = array();//get user ids of group 'root'
$resultA = DB_query("SELECT ug_uid FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id='1'");
if(DB_numRows($resultA) >= 1){
//for each of your admins add their email addy to $to
//mail.php can take an array or list of comma separated recipients...
while($A = DB_fetchArray($resultA)){
$resultB = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = {$A['ug_uid']}");
$B = DB_fetchArray($resultB);
if (!empty ($B['fullname'])) {
$to[] = COM_formatEmailAddress ($B['fullname'], $B['email']);
} else {
$to[] = COM_formatEmailAddress ($B['username'], $B['email']);
}
}
}
COM_mail ($to, $mailsubject, $mailbody);
Untested
19
18
Quote
Page navigation
All times are EST. The time is now 02:18 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content