- 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
This commit is contained in:
plegall
2004-12-04 17:42:07 +00:00
parent a383f3148c
commit b3336f57d5
5 changed files with 67 additions and 22 deletions
+22 -1
View File
@@ -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.= '&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());