diff options
author | plegall <plg@piwigo.org> | 2005-05-14 13:39:00 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2005-05-14 13:39:00 +0000 |
commit | b15c91743dcf2ee0ad1717f8bd0fce6aa1969c81 (patch) | |
tree | 2c05a2f64a09148ed7388eb81872c63805ec6fee /admin/picture_modify.php | |
parent | 06dbb3790190144202df48f6f6265810b8d0f63d (diff) |
This commit was manufactured by cvs2svn to create tag1.4.1
'release-1_4_1'.
git-svn-id: http://piwigo.org/svn/tags/release-1_4_1@790 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/picture_modify.php')
-rw-r--r-- | admin/picture_modify.php | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php index fc2e2eb51..fffb6ff5c 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -159,7 +159,33 @@ else $thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']); $url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id']; -$url_img .= '&cat='.$row['storage_category_id']; + +$query = ' +SELECT category_id + FROM '.IMAGE_CATEGORY_TABLE.' + WHERE image_id = '.$_GET['image_id']; + +if (isset($user['forbidden_categories']) + and !empty($user['forbidden_categories'])) +{ + $query.= ' + AND category_id NOT IN ('.$user['forbidden_categories'].')'; +} +$query.= ' + ORDER BY RAND() +;'; +$result = pwg_query($query); + +if (mysql_num_rows($result) > 0) +{ + list($category_id) = mysql_fetch_array($result); + $url_img .= '&cat='.$category_id; +} +else +{ + $url_img .= '&cat='.$row['storage_category_id']; +} + $date = isset($_POST['date_creation']) && empty($errors) ?$_POST['date_creation']:date_convert_back(@$row['date_creation']); |