diff options
Diffstat (limited to '')
-rw-r--r-- | include/functions.inc.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index 457fa0a82..77be51606 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -333,14 +333,20 @@ function pwg_log( $file, $category, $picture = '' ) { global $conf, $user; - if ( $conf['log'] ) + if ($conf['log']) { - $query = 'insert into '.HISTORY_TABLE; - $query.= ' (date,login,IP,file,category,picture) values'; - $query.= " (NOW(), '".$user['username']."'"; - $query.= ",'".$_SERVER['REMOTE_ADDR']."'"; - $query.= ",'".$file."','".$category."','".$picture."');"; - pwg_query( $query ); + $query = ' +INSERT INTO '.HISTORY_TABLE.' + (date,login,IP,file,category,picture) + VALUES + (NOW(), + \''.(($user['id'] == 2) ? 'guest' : $user['username']).'\', + \''.$_SERVER['REMOTE_ADDR'].'\', + \''.$file.'\', + \''.$category.'\', + \''.$picture.'\') +;'; + pwg_query($query); } } |