mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-11 11:13:02 +02:00
feature 440: send mail to admin when comment is entered
git-svn-id: http://piwigo.org/svn/trunk@1617 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -193,6 +193,31 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
|
||||
}
|
||||
$template->assign_block_vars('information',
|
||||
array('INFORMATION'=>$message));
|
||||
if ( ($comment_action=='validate' and $conf['email_admin_on_comment'])
|
||||
or $conf['email_admin_on_comment_validation'] )
|
||||
{
|
||||
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
|
||||
|
||||
$del_url = get_host_url().cookie_path()
|
||||
.'comments.php?delete='.$comm['id'];
|
||||
|
||||
$content =
|
||||
'Author: '.$comm['author']."\n"
|
||||
.'Comment: '.$comm['content']."\n"
|
||||
.'IP: '.$comm['ip']."\n"
|
||||
.'Browser: '.$comm['agent']."\n\n"
|
||||
.'Delete: '.$del_url."\n";
|
||||
if ($comment_action!='validate')
|
||||
{
|
||||
$content .=
|
||||
'Validate: '.get_host_url().cookie_path()
|
||||
.'comments.php?validate='.$comm['id'];
|
||||
}
|
||||
pwg_mail( get_webmaster_mail_address(), '',
|
||||
'PWG comment by '.$comm['author'],
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user