Ignore:
Timestamp:
Jul 21, 2003, 9:47:14 PM (21 years ago)
Author:
z0rglub
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r21 r26  
    6767function array_remove( $array, $value )
    6868{
    69   $i = 0;
    7069  $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;
    7977}
    8078
     
    321319function database_connection()
    322320{
    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 
    332321  include( PREFIX_INCLUDE.'./include/mysql.inc.php' );
    333322  define( PREFIX_TABLE, $prefix_table );
     
    347336    $query = 'insert into '.PREFIX_TABLE.'history';
    348337    $query.= ' (date,login,IP,file,category,picture) values';
    349     $query.= " (".time().", '".$user['pseudo']."'";
     338    $query.= " (".time().", '".$user['username']."'";
    350339    $query.= ",'".$_SERVER['REMOTE_ADDR']."'";
    351340    $query.= ",'".$file."','".$category."','".$picture."');";
     
    358347  global $vtp, $lang, $page, $user, $conf;
    359348
    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] );
    364351  }
    365352}
Note: See TracChangeset for help on using the changeset viewer.