Ignore:
Timestamp:
Dec 4, 2004, 6:42:07 PM (19 years ago)
Author:
plg
Message:
  • 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r632 r633  
    8080
    8181  $template->assign_block_vars('confirmation' ,array());
     82}
     83else if (isset($_POST['set_random_representant']))
     84{
     85  set_random_representant(array($_GET['cat_id']));
    8286}
    8387
     
    158162  'L_NO'=>$lang['no'],
    159163  'L_SUBMIT'=>$lang['submit'],
     164  'L_SET_RANDOM_REPRESENTANT'=>$lang['set_random_representant'],
    160165   
    161166  'F_ACTION'=>add_session_id($form_action)
    162167  ));
    163  
     168
     169if ($category['nb_images'] > 0)
     170{
     171  $query = '
     172SELECT tn_ext,path
     173  FROM '.IMAGES_TABLE.'
     174  WHERE id = '.$category['representative_picture_id'].'
     175;';
     176  $row = mysql_fetch_array(pwg_query($query));
     177  $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
     178  $url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
     179  $url.= '&image_id='.$category['representative_picture_id'];
     180  $template->assign_block_vars('representant',
     181                               array('SRC' => $src,
     182                                     'URL' => $url));
     183}
     184
    164185if (!empty($category['dir']))
    165186{
Note: See TracChangeset for help on using the changeset viewer.