Changeset 721


Ignore:
Timestamp:
Jan 23, 2005, 4:27:20 PM (19 years ago)
Author:
plg
Message:
  • bug fixed : same comments displayed as many times as element categories
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r688 r721  
    112112
    113113$query = '
    114 SELECT DISTINCT(ic.image_id) AS image_id,(ic.category_id) AS category_id
     114SELECT DISTINCT(ic.image_id) AS image_id,ic.category_id, uppercats
    115115  FROM '.COMMENTS_TABLE.' AS c, '.IMAGE_CATEGORY_TABLE.' AS ic
     116    , '.CATEGORIES_TABLE.' AS cat
    116117  WHERE c.image_id = ic.image_id
     118    AND ic.category_id = cat.id
    117119    AND date >= \''.$maxdate.'\'';
    118120if ($user['status'] != 'admin')
     
    128130}
    129131$query.= '
     132  GROUP BY ic.image_id
    130133  ORDER BY ic.image_id DESC
    131134;';
     
    149152  $subrow = mysql_fetch_array($subresult);
    150153
    151   if (!isset($array_cat_names[$subrow['cat_id']]))
    152   {
    153     $cat_result = get_cat_info($subrow['cat_id']);
    154     $array_cat_names[$subrow['cat_id']] =
    155       get_cat_display_name($cat_result['name'], '');
    156   }
    157  
    158154  // name of the picture
    159   $name = $array_cat_names[$category_id].' > ';
     155  $name = get_cat_display_name_cache($row['uppercats'], '', false);
     156  $name.= $conf['level_separator'];
    160157  if (!empty($subrow['name']))
    161158  {
     
    166163    $name.= str_replace('_',' ',get_filename_wo_extension($subrow['file']));
    167164  }
    168   $name.= ' [ '.$subrow['file'].' ]';
     165
    169166  // source of the thumbnail picture
    170167  $thumbnail_src = get_thumbnail_src($subrow['path'], @$subrow['tn_ext']);
Note: See TracChangeset for help on using the changeset viewer.