aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-10-25 20:01:14 +0000
committerrvelices <rv-github@modusoptimus.com>2012-10-25 20:01:14 +0000
commitb57ab43510656863f6e8303115a03a0479808f9b (patch)
tree2e71d2e985097700a4c5180bf64d322f70009cc2 /picture.php
parentf609713578c2c3d9cdd0531bf0b39a7952e06ce8 (diff)
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)
git-svn-id: http://piwigo.org/svn/trunk@18747 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/picture.php b/picture.php
index d291de151..e394ddf96 100644
--- a/picture.php
+++ b/picture.php
@@ -453,7 +453,7 @@ UPDATE
//---------------------------------------------------------- related categories
$query = '
-SELECT category_id,uppercats,commentable,global_rank
+SELECT id,uppercats,commentable,visible,status,global_rank
FROM '.IMAGE_CATEGORY_TABLE.'
INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id
WHERE image_id = '.$page['image_id'].'
@@ -461,19 +461,13 @@ SELECT category_id,uppercats,commentable,global_rank
(
array
(
- 'forbidden_categories' => 'category_id',
- 'visible_categories' => 'category_id'
+ 'forbidden_categories' => 'id',
+ 'visible_categories' => 'id'
),
'AND'
).'
;';
-$result = pwg_query($query);
-$related_categories = array();
-while ($row = pwg_db_fetch_assoc($result))
-{
- $row['commentable'] = get_boolean($row['commentable']);
- array_push($related_categories, $row);
-}
+$related_categories = array_from_query($query);
usort($related_categories, 'global_rank_compare');
//-------------------------first, prev, current, next & last picture management
$picture = array();