From 6c92ade174238e18ed22f6f95234ab9604e3b445 Mon Sep 17 00:00:00 2001 From: rvelices Date: Sat, 14 Feb 2009 02:24:10 +0000 Subject: Last (I hope) paranoic optims ... - move get_uysername and get_groupname from public to admin/functions.inc.php - optim in index.php - tags.tpl does not need smarty modifier included - move func get_comment_post_key from functions_comment to functions (avoid extra inclusion every time on picture page) git-svn-id: http://piwigo.org/svn/trunk@3145 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/picture_comment.inc.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include/picture_comment.inc.php') diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php index eb2cd710b..73b245b6b 100644 --- a/include/picture_comment.inc.php +++ b/include/picture_comment.inc.php @@ -88,11 +88,11 @@ elseif ( isset($_POST['content']) ) if ($page['show_comments']) { - // number of comment for this picture - $query = 'SELECT COUNT(*) AS nb_comments'; - $query.= ' FROM '.COMMENTS_TABLE.' WHERE image_id = '.$page['image_id']; - $query.= " AND validated = 'true'"; - $query.= ';'; + // number of comments for this picture + $query = ' +SELECT COUNT(*) AS nb_comments + FROM '.COMMENTS_TABLE.' + WHERE image_id='.$page['image_id']." AND validated = 'true'"; $row = mysql_fetch_array( pwg_query( $query ) ); // navigation bar creation @@ -160,7 +160,6 @@ SELECT id,author,date,image_id,content if (!is_a_guest() or (is_a_guest() and $conf['comments_forall'])) { - include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); $key = get_comment_post_key($page['image_id']); $content = ''; if ('reject'===@$comment_action) -- cgit v1.2.3