Changeset 26 for trunk/include/functions.inc.php
- Timestamp:
- Jul 21, 2003, 9:47:14 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r21 r26 67 67 function array_remove( $array, $value ) 68 68 { 69 $i = 0;70 69 $output = array(); 71 foreach ( $array as $v ) 72 { 73 if ( $v != $value ) 74 { 75 $output[$i++] = $v; 76 } 77 } 78 return implode( ',', $output ); 70 foreach ( $array as $v ) { 71 if ( $v != $value ) 72 { 73 array_push( $output, $v ); 74 } 75 } 76 return $output; 79 77 } 80 78 … … 321 319 function database_connection() 322 320 { 323 // $xml_content = getXmlCode( PREFIXE_INCLUDE.'./include/database_config.xml' );324 // $mysql_conf = getChild( $xml_content, 'mysql' );325 326 // $cfgHote = getAttribute( $mysql_conf, 'host' );327 // $cfgUser = getAttribute( $mysql_conf, 'user' );328 // $cfgPassword = getAttribute( $mysql_conf, 'password' );329 // $cfgBase = getAttribute( $mysql_conf, 'base' );330 // define( PREFIX_TABLE, getAttribute( $mysql_conf, 'tablePrefix' ) );331 332 321 include( PREFIX_INCLUDE.'./include/mysql.inc.php' ); 333 322 define( PREFIX_TABLE, $prefix_table ); … … 347 336 $query = 'insert into '.PREFIX_TABLE.'history'; 348 337 $query.= ' (date,login,IP,file,category,picture) values'; 349 $query.= " (".time().", '".$user[' pseudo']."'";338 $query.= " (".time().", '".$user['username']."'"; 350 339 $query.= ",'".$_SERVER['REMOTE_ADDR']."'"; 351 340 $query.= ",'".$file."','".$category."','".$picture."');"; … … 358 347 global $vtp, $lang, $page, $user, $conf; 359 348 360 for( $i = 0; $i < sizeof( $array ); $i++ ) 361 { 362 $vtp->setGlobalVar( $handle, $array[$i], 363 ${$global_array_name}[$array[$i]] ); 349 foreach ( $array as $value ) { 350 $vtp->setGlobalVar( $handle, $value, ${$global_array_name}[$value] ); 364 351 } 365 352 }
Note: See TracChangeset
for help on using the changeset viewer.