diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-10-21 21:17:07 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-10-21 21:17:07 +0000 |
commit | e22eb49fec3e82a49cefc9a90d5a39e4453fa58f (patch) | |
tree | c70388fa9695cae5ef99bd9320ce6de16cb425d7 | |
parent | 3e09d2579f04fa6a03c2bbd8273fee0418d57562 (diff) |
new feature : related categories are displayed under the picture
git-svn-id: http://piwigo.org/svn/trunk@568 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | picture.php | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/picture.php b/picture.php index a94b7ff68..94bba0c0c 100644 --- a/picture.php +++ b/picture.php @@ -714,9 +714,36 @@ SELECT COUNT(rate) AS count 'VALUE' => $value )); } - -//metadata - +// related categories +$query = ' +SELECT category_id + FROM '.IMAGE_CATEGORY_TABLE.' + WHERE image_id = '.$_GET['image_id']; +if ($user['forbidden_categories'] != '') +{ + $query.= ' + AND category_id NOT IN ('.$user['forbidden_categories'].')'; +} +$query.= ' +;'; +$result = mysql_query($query); +$categories = ''; +while ($row = mysql_fetch_array($result)) +{ + if ($categories != '') + { + $categories.= '<br />'; + } + $cat_info = get_cat_info($row['category_id']); + $categories .= get_cat_display_name($cat_info['name'], ' >'); +} +$template->assign_block_vars( + 'info_line', + array( + 'INFO' => $lang['categories'], + 'VALUE' => $categories + )); +// metadata if ($metadata_showable and isset($_GET['show_metadata'])) { include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php'); |