Changeset 394 for trunk/admin/update.php
- Timestamp:
- Mar 26, 2004, 6:08:09 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/update.php
r393 r394 28 28 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 29 29 //------------------------------------------------------------------- functions 30 function ordering( $id_uppercat ) 31 { 32 $rank = 1; 33 34 $query = 'SELECT id'; 35 $query.= ' FROM '.CATEGORIES_TABLE; 36 if ( !is_numeric( $id_uppercat ) ) 37 { 38 $query.= ' WHERE id_uppercat IS NULL'; 39 } 40 else 41 { 42 $query.= ' WHERE id_uppercat = '.$id_uppercat; 43 } 44 $query.= ' ORDER BY rank ASC, dir ASC'; 45 $query.= ';'; 46 $result = mysql_query( $query ); 47 while ( $row = mysql_fetch_array( $result ) ) 48 { 49 $query = 'UPDATE '.CATEGORIES_TABLE; 50 $query.= ' SET rank = '.$rank; 51 $query.= ' WHERE id = '.$row['id']; 52 $query.= ';'; 53 mysql_query( $query ); 54 $rank++; 55 ordering( $row['id'] ); 56 } 57 } 58 30 59 function insert_local_category( $id_uppercat ) 31 60 { … … 678 707 )); 679 708 680 $tpl = array('remote_site');681 709 //-------------------------------------------- introduction : choices of update 682 710 // Display choice if "update" var is not specified … … 733 761 $start = get_moment(); 734 762 update_category( 'all' ); 763 ordering('NULL'); 735 764 $end = get_moment(); 736 765 echo get_elapsed_time( $start, $end ).' for update_category( all )<br />';
Note: See TracChangeset
for help on using the changeset viewer.