Changeset 745 for trunk/picture.php
- Timestamp:
- Mar 12, 2005, 11:27:43 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r738 r745 75 75 exit(); 76 76 } 77 //---------------------------------------------------------- related categories 78 $query = ' 79 SELECT category_id,uppercats,commentable,global_rank 80 FROM '.IMAGE_CATEGORY_TABLE.' 81 INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id 82 WHERE image_id = '.$_GET['image_id']; 83 if ($user['forbidden_categories'] != '') 84 { 85 $query.= ' 86 AND category_id NOT IN ('.$user['forbidden_categories'].')'; 87 } 88 $query.= ' 89 ;'; 90 $result = pwg_query($query); 91 $related_categories = array(); 92 while ($row = mysql_fetch_array($result)) 93 { 94 array_push($related_categories, $row); 95 } 96 usort($related_categories, 'global_rank_compare'); 77 97 //------------------------------------- prev, current & next picture management 78 98 $picture = array(); … … 349 369 if ( $conf['mail_notification'] ) 350 370 { 371 // find any related category (can be unreachable to this admin) 372 $category = $related_categories[0]; 351 373 // locally, we change the $conf['level_separator'] 352 374 $conf_separator = $conf['level_separator']; 353 375 $conf['level_separator'] = ' > '; 354 $cat_name = get_cat_display_name($page['cat_name'], ''); 376 $cat_name = get_cat_display_name_cache($category['uppercats'], 377 '', 378 false); 355 379 $conf['level_separator'] = $conf_separator; 356 380 … … 584 608 'legend', 585 609 array( 586 'COMMENT_IMG' => $picture['current']['comment']610 'COMMENT_IMG' => nl2br($picture['current']['comment']) 587 611 )); 588 612 } … … 746 770 } 747 771 // related categories 748 $query = '749 SELECT category_id,uppercats,commentable,global_rank750 FROM '.IMAGE_CATEGORY_TABLE.'751 INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id752 WHERE image_id = '.$_GET['image_id'];753 if ($user['forbidden_categories'] != '')754 {755 $query.= '756 AND category_id NOT IN ('.$user['forbidden_categories'].')';757 }758 $query.= '759 ;';760 $result = pwg_query($query);761 $cat_array = array();762 while ($row = mysql_fetch_array($result))763 {764 array_push($cat_array, $row);765 }766 usort($cat_array, 'global_rank_compare');767 768 772 $cat_output = ''; 769 773 $page['show_comments'] = false; 770 foreach ($ cat_arrayas $category)774 foreach ($related_categories as $category) 771 775 { 772 776 if ($cat_output != '') … … 775 779 } 776 780 777 if (count($ cat_array) > 3)781 if (count($related_categories) > 3) 778 782 { 779 783 $cat_output .= get_cat_display_name_cache($category['uppercats']);
Note: See TracChangeset
for help on using the changeset viewer.