Changeset 568


Ignore:
Timestamp:
Oct 21, 2004, 11:17:07 PM (20 years ago)
Author:
z0rglub
Message:

new feature : related categories are displayed under the picture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r563 r568  
    715715      ));
    716716}
    717 
    718 //metadata
    719 
     717// related categories
     718$query = '
     719SELECT category_id
     720  FROM '.IMAGE_CATEGORY_TABLE.'
     721  WHERE image_id = '.$_GET['image_id'];
     722if ($user['forbidden_categories'] != '')
     723{
     724  $query.= '
     725    AND category_id NOT IN ('.$user['forbidden_categories'].')';
     726}
     727$query.= '
     728;';
     729$result = mysql_query($query);
     730$categories = '';
     731while ($row = mysql_fetch_array($result))
     732{
     733  if ($categories != '')
     734  {
     735    $categories.= '<br />';
     736  }
     737  $cat_info = get_cat_info($row['category_id']);
     738  $categories .= get_cat_display_name($cat_info['name'], ' &gt;');
     739}
     740$template->assign_block_vars(
     741  'info_line',
     742  array(
     743    'INFO'  => $lang['categories'],
     744    'VALUE' => $categories
     745    ));
     746// metadata
    720747if ($metadata_showable and isset($_GET['show_metadata']))
    721748{
Note: See TracChangeset for help on using the changeset viewer.