From 656ac54090c1cc516955c59ac752bf99ac7abf6f Mon Sep 17 00:00:00 2001 From: rvelices Date: Sun, 16 Feb 2014 07:39:19 +0000 Subject: more query2array and remove unnecessary tests in often called url functions git-svn-id: http://piwigo.org/svn/trunk@27388 68402e56-0260-453c-a942-63ccdbb3a9ee --- comments.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'comments.php') diff --git a/comments.php b/comments.php index a41e0c57a..9230d41ca 100644 --- a/comments.php +++ b/comments.php @@ -69,7 +69,7 @@ if (!in_array($conf['comments_page_nb_comments'], $items_number)) $items_number_new[] = $conf['comments_page_nb_comments']; $is_inserted = true; } - + $items_number_new[] = $number; } @@ -88,7 +88,7 @@ $since_options = array( 4 => array('label' => l10n('the beginning'), 'clause' => '1=1') // stupid but generic ); - + trigger_action('loc_begin_comments'); if (!empty($_GET['since']) && is_numeric($_GET['since'])) @@ -265,7 +265,7 @@ if (isset($action)) ), $_POST['key'] ); - + switch ($comment_action) { case 'moderate': @@ -281,7 +281,7 @@ if (isset($action)) trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING); } } - + $edit_comment = $_GET['edit']; } @@ -437,13 +437,13 @@ SELECT * FROM '.IMAGES_TABLE.' WHERE id IN ('.implode(',', $element_ids).') ;'; - $elements = hash_from_query($query, 'id'); + $elements = query2array($query, 'id'); // retrieving category informations - $query = 'SELECT id, name, permalink, uppercats + $query = 'SELECT id, name, permalink, uppercats FROM '.CATEGORIES_TABLE.' WHERE id IN ('.implode(',', $category_ids).')'; - $categories = hash_from_query($query, 'id'); + $categories = query2array($query, 'id'); foreach ($comments as $comment) { @@ -467,7 +467,7 @@ SELECT * 'image_file' => $elements[$comment['image_id']]['file'], ) ); - + $email = null; if (!empty($comment['user_email'])) { @@ -488,7 +488,7 @@ SELECT * 'DATE'=>format_date($comment['date'], true), 'CONTENT'=>trigger_event('render_comment_content',$comment['content']), ); - + if (is_admin()) { $tpl_comment['EMAIL'] = $email; -- cgit v1.2.3