Changeset 383 for trunk/admin
- Timestamp:
- Mar 5, 2004, 12:56:02 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r364 r383 45 45 "ý" => "y", "ÿ" => "y"); 46 46 //------------------------------ verification and registration of modifications 47 $conf_infos = 48 array( 'prefix_thumbnail','webmaster','mail_webmaster','access', 49 'session_id_size','session_time','session_keyword','max_user_listbox', 50 'show_comments','nb_comment_page','upload_available', 51 'upload_maxfilesize', 'upload_maxwidth','upload_maxheight', 52 'upload_maxwidth_thumbnail','upload_maxheight_thumbnail','log', 53 'comments_validation','comments_forall','authorize_cookies', 54 'mail_notification' ); 47 $conf_infos = array(); 48 $query = 'SELECT param'; 49 $query.= ' FROM '.CONFIG_TABLE; 50 $query.= ';'; 51 $result = mysql_query( $query ); 52 while ( $row = mysql_fetch_array( $result ) ) 53 { 54 array_push( $conf_infos, $row['param'] ); 55 } 56 55 57 $default_user_infos = 56 58 array( 'nb_image_line','nb_line_page','language','maxwidth', … … 199 201 if ( count( $error ) == 0 ) 200 202 { 201 mysql_query( 'DELETE FROM '.PREFIX_TABLE.'config;' ); 202 $query = 'INSERT INTO '.PREFIX_TABLE.'config'; 203 $query.= ' ('; 204 foreach ( $conf_infos as $i => $conf_info ) { 205 if ( $i > 0 ) $query.= ','; 206 $query.= $conf_info; 203 foreach ( $conf_infos as $conf_info ) { 204 if ( isset( $_POST[$conf_info] ) ) 205 { 206 $query = 'UPDATE '.CONFIG_TABLE; 207 $query.= ' SET value = '; 208 if ( $_POST[$conf_info] == '' ) 209 { 210 $query.= 'NULL'; 211 } 212 else 213 { 214 $query.= "'".$_POST[$conf_info]."'"; 215 } 216 $query.= " WHERE param = '".$conf_info."'"; 217 $query.= ';'; 218 mysql_query( $query ); 219 } 207 220 } 208 $query.= ')';209 $query.= ' VALUES';210 $query.= ' (';211 foreach ( $conf_infos as $i => $conf_info ) {212 if ( $i > 0 ) $query.= ',';213 if ( $_POST[$conf_info] == '' ) $query.= 'NULL';214 else $query.= "'".$_POST[$conf_info]."'";215 }216 $query.= ')';217 $query.= ';';218 mysql_query( $query );219 221 220 222 $query = 'UPDATE '.USERS_TABLE; … … 249 251 { 250 252 //--------------------------------------------------------- data initialization 251 $query = 'SELECT '.implode( ',', $conf_infos ); 252 $query .= ' FROM '.PREFIX_TABLE.'config;'; 253 $row = mysql_fetch_array( mysql_query( $query ) ); 254 foreach ( $conf_infos as $info ) { 255 if ( isset( $row[$info] ) ) $$info = $row[$info]; 256 else $$info = ''; 253 $query = 'SELECT param,value'; 254 $query.= ' FROM '.CONFIG_TABLE; 255 $query.= ';'; 256 $result = mysql_query( $query ); 257 while ( $row =mysql_fetch_array( $result ) ) 258 { 259 if ( isset( $row['value'] ) ) 260 { 261 $$row['param'] = $row['value']; 262 } 263 else 264 { 265 $$row['param'] = ''; 266 } 257 267 } 258 268
Note: See TracChangeset
for help on using the changeset viewer.