- Timestamp:
- Jan 3, 2004, 10:39:52 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/release-1_3/admin/update.php
r160 r259 24 24 global $conf, $page, $user, $lang; 25 25 26 $ site_id = 1;26 $uppercats = ''; 27 27 28 28 // 0. retrieving informations on the category to display … … 33 33 $cat_directory.= '/'.get_local_dir( $cat_id ); 34 34 $result = get_cat_info( $cat_id ); 35 $uppercats = $result['uppercats']; 35 36 // 1. display the category name to update 36 37 $src = '../template/'.$user['template'].'/admin/images/puce.gif'; 37 38 $output = '<img src="'.$src.'" alt=">" />'; 38 $output.= '<span style="font-weight:bold;">'.$result['name'][0].'</span>'; 39 $output.= '<span style="font-weight:bold;">'; 40 $output.= $result['name'][count($result['name'])-1]; 41 $output.= '</span>'; 39 42 $output.= ' [ '.$result['dir'].' ]'; 40 43 $output.= '<div class="retrait">'; … … 51 54 $query = 'SELECT id'; 52 55 $query.= ' FROM '.PREFIX_TABLE.'categories'; 53 $query.= ' WHERE site_id = '.$site_id; 54 if ( !is_numeric( $cat_id ) ) 55 { 56 $query.= ' AND id_uppercat IS NULL'; 57 } 58 else 59 { 60 $query.= ' AND id_uppercat = '.$cat_id; 61 } 56 $query.= ' WHERE site_id = 1'; 57 if ( !is_numeric( $cat_id ) ) $query.= ' AND id_uppercat IS NULL'; 58 else $query.= ' AND id_uppercat = '.$cat_id; 62 59 $query.= ';'; 63 60 $result = mysql_query( $query ); … … 78 75 if ( $file != '.' 79 76 and $file != '..' 80 and is_dir 77 and is_dir( $cat_directory.'/'.$file ) 81 78 and $file != 'thumbnail' ) 82 79 { … … 91 88 $query = 'SELECT id'; 92 89 $query.= ' FROM '.PREFIX_TABLE.'categories'; 93 $query.= ' WHERE site_id = '.$site_id;90 $query.= ' WHERE site_id = 1'; 94 91 $query.= " AND dir = '".$file."'"; 95 92 $query.= ' AND id_uppercat'; … … 112 109 $query = 'SELECT id'; 113 110 $query.= ' FROM '.PREFIX_TABLE.'categories'; 114 $query.= ' WHERE site_id = '.$site_id;111 $query.= ' WHERE site_id = 1'; 115 112 $query.= " AND dir = '".$subdir."'"; 116 113 $query.= ' AND id_uppercat'; … … 125 122 $query = 'INSERT INTO '.PREFIX_TABLE.'categories'; 126 123 $query.= ' (dir,name,site_id,id_uppercat) VALUES'; 127 $query.= " ('".$subdir."','".$name."', '".$site_id."'";124 $query.= " ('".$subdir."','".$name."',1"; 128 125 if ( !is_numeric( $cat_id ) ) $query.= ',NULL'; 129 126 else $query.= ",'".$cat_id."'"; … … 131 128 mysql_query( $query ); 132 129 $category_id = mysql_insert_id(); 133 // regeneration of the plain_structure to integrate the new category134 $page['plain_structure'] = get_plain_structure();135 130 } 136 131 else … … 150 145 return $output; 151 146 } 152 147 153 148 function insert_local_image( $rep, $category_id ) 154 149 { … … 570 565 templatize_array( $tpl, 'lang', $sub ); 571 566 $vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); 572 //-------------------------------------------------------- categories structure573 $page['plain_structure'] = get_plain_structure();574 567 //-------------------------------------------- introduction : choices of update 575 568 // Display choice if "update" var is not specified … … 622 615 } 623 616 //---------------------------------------- update informations about categories 624 update_category( 'all' ); 617 if ( isset( $_GET['update'] ) 618 or isset( $page['cat'] ) 619 or @is_file( './listing.xml' ) ) 620 { 621 update_category( 'all' ); 622 synchronize_all_users(); 623 } 625 624 //----------------------------------------------------------- sending html code 626 625 $vtp->Parse( $handle , 'sub', $sub );
Note: See TracChangeset
for help on using the changeset viewer.