diff options
author | plegall <plg@piwigo.org> | 2005-01-23 15:27:20 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2005-01-23 15:27:20 +0000 |
commit | cf48bf46e3390c3132001dc0f9ef355c0142497b (patch) | |
tree | 1653a8fa2a503d8b33410591075b3b01429f4cc0 | |
parent | 7eb2d433b754b0f91d97046961ca3f16e566774a (diff) |
- bug fixed : same comments displayed as many times as element categories
git-svn-id: http://piwigo.org/svn/trunk@721 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | comments.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/comments.php b/comments.php index 144149e05..0be4f454d 100644 --- a/comments.php +++ b/comments.php @@ -111,9 +111,11 @@ foreach ($conf['last_days'] as $option) $maxdate = date('Y-m-d', strtotime('-'.MAX_DAYS.' day')); $query = ' -SELECT DISTINCT(ic.image_id) AS image_id,(ic.category_id) AS category_id +SELECT DISTINCT(ic.image_id) AS image_id,ic.category_id, uppercats FROM '.COMMENTS_TABLE.' AS c, '.IMAGE_CATEGORY_TABLE.' AS ic + , '.CATEGORIES_TABLE.' AS cat WHERE c.image_id = ic.image_id + AND ic.category_id = cat.id AND date >= \''.$maxdate.'\''; if ($user['status'] != 'admin') { @@ -127,6 +129,7 @@ if ($user['status'] != 'admin') } } $query.= ' + GROUP BY ic.image_id ORDER BY ic.image_id DESC ;'; $result = pwg_query($query); @@ -148,15 +151,9 @@ SELECT name,file,storage_category_id as cat_id,tn_ext,path $subresult = pwg_query($query); $subrow = mysql_fetch_array($subresult); - if (!isset($array_cat_names[$subrow['cat_id']])) - { - $cat_result = get_cat_info($subrow['cat_id']); - $array_cat_names[$subrow['cat_id']] = - get_cat_display_name($cat_result['name'], ''); - } - // name of the picture - $name = $array_cat_names[$category_id].' > '; + $name = get_cat_display_name_cache($row['uppercats'], '', false); + $name.= $conf['level_separator']; if (!empty($subrow['name'])) { $name.= $subrow['name']; @@ -165,7 +162,7 @@ SELECT name,file,storage_category_id as cat_id,tn_ext,path { $name.= str_replace('_',' ',get_filename_wo_extension($subrow['file'])); } - $name.= ' [ '.$subrow['file'].' ]'; + // source of the thumbnail picture $thumbnail_src = get_thumbnail_src($subrow['path'], @$subrow['tn_ext']); // link to the full size picture |