From a8cb550b92ff3230b5b062d85bebccdca75580de Mon Sep 17 00:00:00 2001 From: z0rglub Date: Tue, 31 Aug 2004 21:32:58 +0000 Subject: if category is best_rated : displays the average rate of the element before its name git-svn-id: http://piwigo.org/svn/trunk@508 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_default.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/category_default.inc.php b/include/category_default.inc.php index 73ad7af37..409829282 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -39,7 +39,7 @@ $array_cat_directories = array(); $query = ' SELECT DISTINCT(id),file,date_available - ,tn_ext,name,filesize,storage_category_id + ,tn_ext,name,filesize,storage_category_id,average_rate FROM '.IMAGES_TABLE.' AS i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=ic.image_id '.$page['where'].' @@ -79,6 +79,10 @@ while ($row = mysql_fetch_array($result)) { $name = str_replace('_', ' ', $file); } + if ($page['cat'] == 'best_rated') + { + $name = '('.$row['average_rate'].') '.$name; + } if ($page['cat'] == 'search') { -- cgit v1.2.3