aboutsummaryrefslogtreecommitdiffstats
path: root/comments.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-09-23 09:34:30 +0000
committermistic100 <mistic@piwigo.org>2012-09-23 09:34:30 +0000
commit7e33b84e770ddab61ef1d5c67061cd41c189f20e (patch)
tree6ffa8d888072108bcf05d0901fa22434dacecdc6 /comments.php
parentb6d2db8600871cd72094a0c3043865b75357ef9b (diff)
feature 2754: Add "Email" field for user comments + mandatory "Author"
git-svn-id: http://piwigo.org/svn/trunk@18164 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'comments.php')
-rw-r--r--comments.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/comments.php b/comments.php
index f695cebaa..1cd19890d 100644
--- a/comments.php
+++ b/comments.php
@@ -383,6 +383,8 @@ SELECT com.id AS comment_id,
com.image_id,
com.author,
com.author_id,
+ u.'.$conf['user_fields']['email'].' AS user_email,
+ com.email,
com.date,
com.website_url,
com.content,
@@ -473,6 +475,16 @@ SELECT c.id, name, permalink, uppercats, com.id as comment_id
'image_file' => $elements[$comment['image_id']]['file'],
)
);
+
+ $email = null;
+ if (!empty($comment['user_email']))
+ {
+ $email = $comment['user_email'];
+ }
+ else if (!empty($comment['email']))
+ {
+ $email = $comment['email'];
+ }
$tpl_comment = array(
'ID' => $comment['comment_id'],
@@ -484,6 +496,11 @@ SELECT c.id, name, permalink, uppercats, com.id as comment_id
'DATE'=>format_date($comment['date'], true),
'CONTENT'=>trigger_event('render_comment_content',$comment['content']),
);
+
+ if (is_admin())
+ {
+ $tpl_comment['EMAIL'] = $email;
+ }
if (can_manage_comment('delete', $comment['author_id']))
{