aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-06-10 20:11:28 +0000
committernikrou <nikrou@piwigo.org>2009-06-10 20:11:28 +0000
commit1e8ae9e88b0b2c3959ae8b64343c1f5edc1b4fec (patch)
tree208c92bface99de522a5f7ed1f5c43b6b9947017 /include
parent0ace0450a61636066d3728205a6425c2b241a002 (diff)
feature 1028 : Allow admin to validate comment from picture page
git-svn-id: http://piwigo.org/svn/trunk@3409 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/picture_comment.inc.php24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php
index 2682d9dab..9a120e355 100644
--- a/include/picture_comment.inc.php
+++ b/include/picture_comment.inc.php
@@ -118,11 +118,20 @@ SELECT COUNT(*) AS nb_comments
if ($row['nb_comments'] > 0)
{
+ if ( !is_admin() )
+ {
+ $validated_clause = ' AND validated = \'true\'';
+ }
+ else
+ {
+ $validated_clause = '';
+ }
+
$query = '
-SELECT id,author,date,image_id,content
+SELECT id,author,date,image_id,content,validated
FROM '.COMMENTS_TABLE.'
- WHERE image_id = '.$page['image_id'].'
- AND validated = \'true\'
+ WHERE image_id = '.$page['image_id'].
+$validated_clause.'
ORDER BY date ASC
LIMIT '.$page['start'].', '.$conf['nb_comment_page'].'
;';
@@ -152,6 +161,15 @@ SELECT id,author,date,image_id,content
'comment_to_delete'=>$row['id']
)
);
+ if ($row['validated'] != 'true')
+ {
+ $tpl_comment['U_VALIDATE'] =
+ add_url_params($url_self,
+ array('action' => 'validate_comment',
+ 'comment_to_validate' => $row['id']
+ )
+ );
+ }
}
$template->append('comments', $tpl_comment);
}