Ignore:
Timestamp:
Nov 22, 2006, 5:41:25 AM (17 years ago)
Author:
rvelices
Message:

feature 440: send mail to admin when comment is entered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_comment.inc.php

    r1610 r1617  
    194194    $template->assign_block_vars('information',
    195195                                 array('INFORMATION'=>$message));
     196    if ( ($comment_action=='validate' and $conf['email_admin_on_comment'])
     197      or $conf['email_admin_on_comment_validation'] )
     198    {
     199      include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
     200
     201      $del_url = get_host_url().cookie_path()
     202        .'comments.php?delete='.$comm['id'];
     203
     204      $content =
     205        'Author: '.$comm['author']."\n"
     206        .'Comment: '.$comm['content']."\n"
     207        .'IP: '.$comm['ip']."\n"
     208        .'Browser: '.$comm['agent']."\n\n"
     209        .'Delete: '.$del_url."\n";
     210      if ($comment_action!='validate')
     211      {
     212        $content .=
     213          'Validate: '.get_host_url().cookie_path()
     214          .'comments.php?validate='.$comm['id'];
     215      }
     216      pwg_mail( get_webmaster_mail_address(), '',
     217          'PWG comment by '.$comm['author'],
     218          $content
     219          );
     220    }
    196221  }
    197222  else
Note: See TracChangeset for help on using the changeset viewer.