Changeset 635 for trunk/picture.php
- Timestamp:
- Dec 5, 2004, 10:28:40 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r613 r635 739 739 // related categories 740 740 $query = ' 741 SELECT category_id 741 SELECT category_id,uppercats,commentable,global_rank 742 742 FROM '.IMAGE_CATEGORY_TABLE.' 743 INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id 743 744 WHERE image_id = '.$_GET['image_id']; 744 745 if ($user['forbidden_categories'] != '') … … 750 751 ;'; 751 752 $result = pwg_query($query); 752 $categories = ''; 753 $cat_array = array(); 754 while ($row = mysql_fetch_array($result)) 755 { 756 array_push($cat_array, $row); 757 } 758 usort($cat_array, 'global_rank_compare'); 759 760 $cat_output = ''; 753 761 $page['show_comments'] = false; 754 while ($row = mysql_fetch_array($result)) 755 { 756 if ($categories != '') 757 { 758 $categories.= '<br />'; 759 } 760 $cat_info = get_cat_info($row['category_id']); 761 $categories .= get_cat_display_name($cat_info['name'], ' >'); 762 foreach ($cat_array as $category) 763 { 764 if ($cat_output != '') 765 { 766 $cat_output.= '<br />'; 767 } 768 769 if (count($cat_array) > 3) 770 { 771 $cat_output .= get_cat_display_name_cache($category['uppercats'], 772 ' → '); 773 } 774 else 775 { 776 $cat_info = get_cat_info($category['category_id']); 777 $cat_output .= get_cat_display_name($cat_info['name'], ' → '); 778 } 762 779 // the picture is commentable if it belongs at least to one category which 763 780 // is commentable 764 if ($cat _info['commentable'])781 if ($category['commentable']) 765 782 { 766 783 $page['show_comments'] = true; … … 771 788 array( 772 789 'INFO' => $lang['categories'], 773 'VALUE' => $cat egories790 'VALUE' => $cat_output 774 791 )); 775 792 // metadata
Note: See TracChangeset
for help on using the changeset viewer.