aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_modify.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-12-04 17:42:07 +0000
committerplegall <plg@piwigo.org>2004-12-04 17:42:07 +0000
commitb3336f57d5d61eaa5d465b816962b12ea16c24ae (patch)
treefcaba01eccc65bfdec84fce49c6c4faf54a0fad1 /admin/cat_modify.php
parenta383f3148cb7c9a23dadbdcd12ede4e1de274af5 (diff)
- shows the element representing a non empty category in cat_modify
- possibility to set a random representing element for a category - bug fixed : update_category function could not update nb_images - bug fixed : mass_updates was inserting in the wrong table git-svn-id: http://piwigo.org/svn/trunk@633 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/cat_modify.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 00f52abd4..fc54301d1 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -80,6 +80,10 @@ if ( isset( $_POST['submit'] ) )
$template->assign_block_vars('confirmation' ,array());
}
+else if (isset($_POST['set_random_representant']))
+{
+ set_random_representant(array($_GET['cat_id']));
+}
$query = '
SELECT *
@@ -157,10 +161,27 @@ $template->assign_vars(array(
'L_YES'=>$lang['yes'],
'L_NO'=>$lang['no'],
'L_SUBMIT'=>$lang['submit'],
+ 'L_SET_RANDOM_REPRESENTANT'=>$lang['set_random_representant'],
'F_ACTION'=>add_session_id($form_action)
));
-
+
+if ($category['nb_images'] > 0)
+{
+ $query = '
+SELECT tn_ext,path
+ FROM '.IMAGES_TABLE.'
+ WHERE id = '.$category['representative_picture_id'].'
+;';
+ $row = mysql_fetch_array(pwg_query($query));
+ $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
+ $url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
+ $url.= '&amp;image_id='.$category['representative_picture_id'];
+ $template->assign_block_vars('representant',
+ array('SRC' => $src,
+ 'URL' => $url));
+}
+
if (!empty($category['dir']))
{
$template->assign_block_vars('storage' ,array());