diff options
author | rvelices <rv-github@modusoptimus.com> | 2009-02-14 02:28:21 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2009-02-14 02:28:21 +0000 |
commit | 368059d5353209ddad495081bc9d5d9218a9de23 (patch) | |
tree | 18c0de692f0102d0275b254f82756a3fa00c4e7f /include/picture_comment.inc.php | |
parent | 35e9af66be0b6da3055d032123bd38100b58bca9 (diff) |
merge 3145-3146 from trunk
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/branches/2.0@3147 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/picture_comment.inc.php')
-rw-r--r-- | include/picture_comment.inc.php | 11 |
1 files changed, 5 insertions, 6 deletions
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) |