Welcome to Geeklog, Anonymous Tuesday, February 27 2024 @ 07:47 pm EST

Geeklog Forums

hmmmmm???

Page navigation


Status: offline

dewdoo

Forum User
Chatty
Registered: 01/03/04
Posts: 65
just a thought. I would like to be able have this work with submissions with articles/news.
 Quote

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:
Text Formatted Code
    COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);

 
insert a few lines and edit that line as well to take the array--like this:
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);

 
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
 Quote

Status: offline

dewdoo

Forum User
Chatty
Registered: 01/03/04
Posts: 65
I will try once I finish some home improvement stuff my wife wants me to get finished Rolling EyesBlah Blah Blah Blah ...

machinari: I envy your talents. Thanx for your quick response and help!!!!
 Quote

Status: offline

Mikez

Forum User
Regular Poster
Registered: 06/17/05
Posts: 87
I think this needs to be moved to Cool Hacks now.
Cuz that is what this is. lol Big Celebration
 Quote

Page navigation

All times are EST. The time is now 07:47 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