aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-03-12 23:10:35 +0000
committerrub <rub@piwigo.org>2007-03-12 23:10:35 +0000
commit17246da0890c27a4598db4b808daba2362a48a4b (patch)
treea3845b41249f8cc968abe1dba536a21f67726210 /include
parent4577278acc361facfbd70c6172355ee12e1b80e4 (diff)
Add notification when a picture is loaded.
Change little translations. Improve mail sent. git-svn-id: http://piwigo.org/svn/trunk@1901 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_comment.inc.php12
-rw-r--r--include/functions_mail.inc.php20
2 files changed, 25 insertions, 7 deletions
diff --git a/include/functions_comment.inc.php b/include/functions_comment.inc.php
index c5ff60fc7..9db0a4c17 100644
--- a/include/functions_comment.inc.php
+++ b/include/functions_comment.inc.php
@@ -194,20 +194,20 @@ INSERT INTO '.COMMENTS_TABLE.'
{
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
- $del_url = get_absolute_root_url().'comments.php?delete='.$comm['id'];
+ $del_url =
+ get_absolute_root_url().'comments.php?delete='.$comm['id'];
$content =
- 'Author: '.$comm['author']."\n"
+ 'Author: '.$comm['author']."\n"
.'Comment: '.$comm['content']."\n"
- .'IP: '.$comm['ip']."\n"
- .'Browser: '.$comm['agent']."\n\n"
+ .get_block_mail_admin_info()
.'Delete: '.$del_url."\n";
if ($comment_action!='validate')
{
$content .=
- 'Validate: '.get_absolute_root_url()
- .'comments.php?validate='.$comm['id'];
+ 'Validate: '
+ .get_absolute_root_url().'comments.php?validate='.$comm['id'];
}
pwg_mail
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 7307781f2..61a637fcf 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -196,6 +196,19 @@ order by
return $result;
}
+/* Return a standard block useful for admin mail */
+function get_block_mail_admin_info()
+{
+ global $user;
+
+ return
+ "\n"
+ .'Connected user: '.$user['username']."\n"
+ .'IP: '.$_SERVER['REMOTE_ADDR']."\n"
+ .'Browser: '.$_SERVER['HTTP_USER_AGENT']."\n"
+ ."\n";
+}
+
/**
* sends an email, using PhpWebGallery specific informations
*
@@ -373,7 +386,12 @@ function pwg_mail($to, $args = array())
// Content
if (($args['content_format'] == 'text/plain') and ($args['email_format'] == 'text/html'))
{
- $content.= '<p>'.nl2br(htmlentities($args['content'])).'</p>';
+ $content.= '<p>'.
+ nl2br(
+ preg_replace("/(http:\/\/)([^\s,]*)/i",
+ "<a href='$1$2'>$1$2</a>",
+ htmlentities($args['content']))).
+ '</p>';
}
else
{