From 86ae4d8b3ae8d1a4b3f78567dd8f67aa48ef43a8 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 2 Aug 2011 19:20:50 +0000 Subject: rename #images.average_rate to rating_score git-svn-id: http://piwigo.org/svn/trunk@11893 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/section_init.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/section_init.inc.php') diff --git a/include/section_init.inc.php b/include/section_init.inc.php index da064cb68..a3f617e41 100644 --- a/include/section_init.inc.php +++ b/include/section_init.inc.php @@ -61,10 +61,10 @@ else $rewritten = $key; break; } - + // the $_GET keys are not protected in include/common.inc.php, only the values $rewritten = pwg_db_real_escape_string($rewritten); - + $page['root_path'] = PHPWG_ROOT_PATH; } @@ -463,9 +463,9 @@ SELECT DISTINCT(id) else if ($page['section'] == 'most_visited') { $page['super_order_by'] = true; - $conf['order_by'] = ' ORDER BY hit DESC, file ASC'; + $conf['order_by'] = ' ORDER BY hit DESC, id DESC'; $query = ' -SELECT DISTINCT(id), hit, file +SELECT DISTINCT(id) FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id WHERE hit > 0 @@ -489,13 +489,13 @@ SELECT DISTINCT(id), hit, file else if ($page['section'] == 'best_rated') { $page['super_order_by'] = true; - $conf['order_by'] = ' ORDER BY average_rate DESC, id ASC'; + $conf['order_by'] = ' ORDER BY rating_score DESC, id DESC'; $query =' -SELECT DISTINCT(id), average_rate +SELECT DISTINCT(id) FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id - WHERE average_rate IS NOT NULL + WHERE rating_score IS NOT NULL '.$forbidden.' '.$conf['order_by'].' LIMIT '.$conf['top_number'].' -- cgit v1.2.3