From e5e776a263ba63407893a28df379f2ac8152680c Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 8 Nov 2006 04:28:30 +0000 Subject: - comments.php improvements: - unvalidated comments are shown only for administrators - added delete/validate icons for admins - removed some unused code - display of comment content performed through an event - replace some get_thumbnail_src with get_thumbnail_url git-svn-id: http://piwigo.org/svn/trunk@1598 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/comments.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'admin/comments.php') diff --git a/admin/comments.php b/admin/comments.php index 3debab9d0..1371f72f2 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -47,7 +47,7 @@ if (isset($_POST)) $to_reject = array(); if (isset($_POST['submit']) and !is_adviser()) - { + { foreach (explode(',', $_POST['list']) as $comment_id) { if (isset($_POST['action-'.$comment_id])) @@ -141,8 +141,15 @@ SELECT c.id, c.image_id, c.date, c.author, c.content, i.path, i.tn_ext WHERE validated = \'false\' ;'; $result = pwg_query($query); -while ($row = mysql_fetch_array($result)) +while ($row = mysql_fetch_assoc($result)) { + $thumb = get_thumbnail_url( + array( + 'id'=>$row['image_id'], + 'path'=>$row['path'], + 'tn_ext'=>@$row['tn_ext'] + ) + ); $template->assign_block_vars( 'comment', array( @@ -150,10 +157,10 @@ while ($row = mysql_fetch_array($result)) PHPWG_ROOT_PATH.'admin.php?page=picture_modify'. '&image_id='.$row['image_id'], 'ID' => $row['id'], - 'TN_SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']), + 'TN_SRC' => $thumb, 'AUTHOR' => $row['author'], 'DATE' => format_date($row['date'],'mysql_datetime',true), - 'CONTENT' => parse_comment_content($row['content']) + 'CONTENT' => trigger_event('render_comment_content',$row['content']) ) ); -- cgit v1.2.3