diff options
Diffstat (limited to '')
-rw-r--r-- | admin/cat_modify.php | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 3cf8239c1..2b0f37833 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -172,21 +172,6 @@ UPDATE '.CATEGORIES_TABLE.' $_SESSION['page_infos'][] = l10n('Album updated successfully'); $redirect = true; } -elseif (isset($_POST['set_random_representant'])) -{ - set_random_representant(array($_GET['cat_id'])); - $redirect = true; -} -elseif (isset($_POST['delete_representant'])) -{ - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET representative_picture_id = NULL - WHERE id = '.$_GET['cat_id'].' -;'; - pwg_query($query); - $redirect = true; -} if (isset($redirect)) { @@ -336,8 +321,7 @@ else } // representant management -if ($category['has_images'] - or !empty($category['representative_picture_id'])) +if ($category['has_images'] or !empty($category['representative_picture_id'])) { $tpl_representant = array(); @@ -345,20 +329,7 @@ if ($category['has_images'] // representant ? if (!empty($category['representative_picture_id'])) { - $query = ' -SELECT id,representative_ext,path - FROM '.IMAGES_TABLE.' - WHERE id = '.$category['representative_picture_id'].' -;'; - $row = pwg_db_fetch_assoc(pwg_query($query)); - $src = DerivativeImage::thumb_url($row); - $url = get_root_url().'admin.php?page=photo-'.$category['representative_picture_id']; - - $tpl_representant['picture'] = - array( - 'SRC' => $src, - 'URL' => $url - ); + $tpl_representant['picture'] = get_category_representant_properties($category['representative_picture_id']); } // can the admin choose to set a new random representant ? |