aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-07-21 19:47:14 +0000
committerz0rglub <z0rglub@piwigo.org>2003-07-21 19:47:14 +0000
commit2fa9252446a78d349ca2f50096430591cc5e012f (patch)
treebbf5cd282c8b9424b05d970c70e30610ea8b0e4f /include/functions.inc.php
parent55a0a61aaf58a02e2ac5d2c489f81b1be4730cd8 (diff)
*** empty log message ***
git-svn-id: http://piwigo.org/svn/trunk@26 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php29
1 files changed, 8 insertions, 21 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index ec9081dce..5a672a0d4 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -66,16 +66,14 @@ function get_boolean( $string )
// this array.
function array_remove( $array, $value )
{
- $i = 0;
$output = array();
- foreach ( $array as $v )
+ foreach ( $array as $v ) {
+ if ( $v != $value )
{
- if ( $v != $value )
- {
- $output[$i++] = $v;
- }
+ array_push( $output, $v );
}
- return implode( ',', $output );
+ }
+ return $output;
}
// The function get_moment returns a float value coresponding to the number
@@ -320,15 +318,6 @@ function replace_search( $string, $search )
function database_connection()
{
-// $xml_content = getXmlCode( PREFIXE_INCLUDE.'./include/database_config.xml' );
-// $mysql_conf = getChild( $xml_content, 'mysql' );
-
-// $cfgHote = getAttribute( $mysql_conf, 'host' );
-// $cfgUser = getAttribute( $mysql_conf, 'user' );
-// $cfgPassword = getAttribute( $mysql_conf, 'password' );
-// $cfgBase = getAttribute( $mysql_conf, 'base' );
-// define( PREFIX_TABLE, getAttribute( $mysql_conf, 'tablePrefix' ) );
-
include( PREFIX_INCLUDE.'./include/mysql.inc.php' );
define( PREFIX_TABLE, $prefix_table );
@@ -346,7 +335,7 @@ function pwg_log( $file, $category, $picture = '' )
{
$query = 'insert into '.PREFIX_TABLE.'history';
$query.= ' (date,login,IP,file,category,picture) values';
- $query.= " (".time().", '".$user['pseudo']."'";
+ $query.= " (".time().", '".$user['username']."'";
$query.= ",'".$_SERVER['REMOTE_ADDR']."'";
$query.= ",'".$file."','".$category."','".$picture."');";
mysql_query( $query );
@@ -357,10 +346,8 @@ function templatize_array( $array, $global_array_name, $handle )
{
global $vtp, $lang, $page, $user, $conf;
- for( $i = 0; $i < sizeof( $array ); $i++ )
- {
- $vtp->setGlobalVar( $handle, $array[$i],
- ${$global_array_name}[$array[$i]] );
+ foreach ( $array as $value ) {
+ $vtp->setGlobalVar( $handle, $value, ${$global_array_name}[$value] );
}
}
?> \ No newline at end of file