Changeset 18747


Ignore:
Timestamp:
Oct 25, 2012, 10:01:14 PM (11 years ago)
Author:
rvelices
Message:

related categories on picture page contain status and visible db fields (useful for example for "social" plugins to know if a photo is public or not)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_comment.inc.php

    r18164 r18747  
    3232foreach ($related_categories as $category)
    3333{
    34   if ($category['commentable'])
     34  if ($category['commentable']=='true')
    3535  {
    3636    $page['show_comments'] = true;
  • trunk/picture.php

    r18637 r18747  
    454454//---------------------------------------------------------- related categories
    455455$query = '
    456 SELECT category_id,uppercats,commentable,global_rank
     456SELECT id,uppercats,commentable,visible,status,global_rank
    457457  FROM '.IMAGE_CATEGORY_TABLE.'
    458458    INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id
     
    462462    array
    463463      (
    464         'forbidden_categories' => 'category_id',
    465         'visible_categories' => 'category_id'
     464        'forbidden_categories' => 'id',
     465        'visible_categories' => 'id'
    466466      ),
    467467    'AND'
    468468  ).'
    469469;';
    470 $result = pwg_query($query);
    471 $related_categories = array();
    472 while ($row = pwg_db_fetch_assoc($result))
    473 {
    474   $row['commentable'] = get_boolean($row['commentable']);
    475   array_push($related_categories, $row);
    476 }
     470$related_categories = array_from_query($query);
    477471usort($related_categories, 'global_rank_compare');
    478472//-------------------------first, prev, current, next & last picture management
Note: See TracChangeset for help on using the changeset viewer.