add('all', l10n('hit_onglet_all'), $my_base_url.'&tab=all'); $tabsheet->add('photo', l10n('hit_onglet_photo'), $my_base_url.'&tab=photo'); $tabsheet->add('categorie', l10n('hit_onglet_categorie'), $my_base_url.'&tab=categorie'); $tabsheet->select($page['tab']); $tabsheet->assign(); // Onglet gestion par photo switch ($page['tab']) { case 'all': $template->assign( 'gestion', array( )); //purge photo if (isset($_POST['submitchoixall']) and !is_adviser()) { $query = ' UPDATE ' . IMAGES_TABLE . ' SET hit= \'0\' ;'; $result = pwg_query($query); } break; case 'photo': //charge la liste des photos $groups = array(); $query = ' select id,name FROM ' . IMAGES_TABLE . ' ORDER BY id ASC;'; $result = pwg_query($query); while ($row = mysql_fetch_array($result)) { $groups[$row['id']] = $row['id'].' : '.$row['name']; } $selected = 0; $options[] = l10n('hit_select_photo'); $options['a'] = '----------------------'; foreach($groups as $listid => $listid2) { $options[$listid] = $listid2; } $template->assign( 'gestionA', array( 'OPTIONS' => $options, 'SELECTED' => $selected )); //purge photo if (isset($_POST['submitchoixphoto']) and is_numeric($_POST['delhitphoto'])and (!$_POST['delhitphoto'])==0 and !is_adviser()) { $lire=$_POST['delhitphoto']; $query = ' UPDATE ' . IMAGES_TABLE . ' SET hit= \'0\' WHERE id = \''.$lire.'\' ;'; $result = pwg_query($query); } break; // Onglet gestion des meta categorie case 'categorie': //charge la liste des catégories $groups = array(); $query = ' select id,name FROM ' . CATEGORIES_TABLE . ' ORDER BY id ASC;'; $result = pwg_query($query); while ($row = mysql_fetch_array($result)) { $groups[$row['id']] = $row['id'].' : '.$row['name']; } $selected = 0; $options[] = l10n('hit_select_cat'); $options['a'] = '----------------------'; foreach($groups as $listid => $listid2) { $options[$listid] = $listid2; } $template->assign( 'gestionB', array( 'OPTIONS' => $options, 'SELECTED' => $selected )); //purge categorie if (isset($_POST['submitchoixcat']) and is_numeric($_POST['delhitcat'])and (!$_POST['delhitcat'])==0 and !is_adviser()) { $lire=$_POST['delhitcat']; $query = ' UPDATE ' . IMAGES_TABLE . ' SET hit= \'0\' WHERE storage_category_id = \''.$lire.'\' ;'; $result = pwg_query($query); } break; } $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); ?>