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
This commit is contained in:
z0rglub
2004-08-31 21:32:58 +00:00
parent 0e2436f50a
commit a8cb550b92

View File

@@ -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')
{