Changeset 635 for trunk/admin/cat_list.php
- Timestamp:
- Dec 5, 2004, 10:28:40 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r632 r635 63 63 // As we don't create a virtual category every day, let's do (far) too 64 64 // much queries 65 if ($parent_id != 'NULL') 66 { 67 $query = ' 68 SELECT uppercats 69 FROM '.CATEGORIES_TABLE.' 70 WHERE id = '.$parent_id.' 71 ;'; 72 $parent_uppercats = array_pop(mysql_fetch_array(pwg_query($query))); 73 } 74 65 75 66 // we have then to add the virtual category 76 67 $query = ' … … 88 79 ;'; 89 80 $my_id = array_pop(mysql_fetch_array(pwg_query($query))); 90 91 $query = ' 92 UPDATE '.CATEGORIES_TABLE.' 93 SET uppercats = \''; 81 82 if ($parent_id != 'NULL') 83 { 84 $query = ' 85 SELECT uppercats, global_rank 86 FROM '.CATEGORIES_TABLE.' 87 WHERE id = '.$parent_id.' 88 ;'; 89 $result = pwg_query($query); 90 $row = mysql_fetch_array($result); 91 92 $parent_uppercats = $row['uppercats']; 93 $parent_global_rank = $row['global_rank']; 94 } 95 96 $query = ' 97 UPDATE '.CATEGORIES_TABLE.' 98 '; 94 99 if (!empty($parent_uppercats)) 95 100 { 96 $query.= $parent_uppercats.','; 97 } 98 $query.= $my_id; 99 $query.= '\' 101 $query.= " SET uppercats = CONCAT('".$parent_uppercats."',',',id)"; 102 } 103 else 104 { 105 $query.= ' SET uppercats = id'; 106 } 107 if (!empty($parent_global_rank)) 108 { 109 $query.= " , global_rank = CONCAT('".$parent_global_rank."','.',rank)"; 110 } 111 else 112 { 113 $query.= ' , uppercats = id'; 114 } 115 $query.= ' 100 116 WHERE id = '.$my_id.' 101 117 ;'; … … 277 293 $template->set_filenames(array('categories'=>'admin/cat_list.tpl')); 278 294 295 $form_action = PHPWG_ROOT_PATH.'admin.php?page=cat_list'; 296 if (isset($_GET['parent_id'])) 297 { 298 $form_action.= '&parent_id='.$_GET['parent_id']; 299 } 300 279 301 $template->assign_vars(array( 280 302 'CATEGORIES_NAV'=>$navigation, 281 'NEXT_RANK'=>count($categories)+1, 303 'NEXT_RANK'=>max(array_keys($categories))+1, 304 'F_ACTION'=>$form_action, 282 305 283 306 'L_ADD_VIRTUAL'=>$lang['cat_add'],
Note: See TracChangeset
for help on using the changeset viewer.