From 5610b8163ade4ebaf7a91e9452a8c31d9b71b1fe Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Mon, 15 Jun 2009 14:06:14 +0200 Subject: Humm... big big bug onto mysql queries.. --- BigLine.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/BigLine.php b/BigLine.php index ac6a2be..b61a429 100644 --- a/BigLine.php +++ b/BigLine.php @@ -92,8 +92,7 @@ else if ( !is_file($Cache) OR (filemtime($Cache) < $data['lastupdate']) - OR !filesize($Cache) - OR $username == "gugusse") + OR !filesize($Cache)) { $duration = $_SERVER['REQUEST_TIME'] - $statsstart; @@ -203,7 +202,7 @@ else imagepng($img, $Cache); imagedestroy($img); - $QUERY=sprintf("REPLACE INTO badges (username, type, style, color, lastupdate, png) VALUES ('\$s','\$s','\$s','\$s', \$s, '\$s');", + $QUERY=sprintf("REPLACE INTO badges (username, type, style, color, lastupdate, png) VALUES ('%s','%s','%s','%s', %s, '%s');", $username, $type, $style, @@ -256,7 +255,7 @@ function make_db_cache($username){ if ($data['playcount'] != 0) { - $QUERY=(sprintf("REPLACE INTO users (statsstart,playcount,lastupdate,username) VALUES ('\$s',\$s,'\$s','\$s');", + $QUERY=(sprintf("REPLACE INTO users (statsstart,playcount,lastupdate,username) VALUES ('%s',%s,'%s','%s');", time(), $data['playcount'], gpc_addslashes($data['statsstart']), gpc_addslashes(strtolower($username)))); mysql_query($QUERY); } @@ -272,7 +271,7 @@ function touch_badge($username, $type, $style, $color) $hits = $data["hits"]; $hits++; - $QUERY=sprintf("UPDATE badges SET hits=\$s, lasthit='\$s' WHERE username='\$s' AND type='$type' AND style='$style' AND color='$color';", + $QUERY=sprintf("UPDATE badges SET hits=%s, lasthit='%s' WHERE username='%s' AND type='$type' AND style='$style' AND color='$color';", $hits, time(), gpc_addslashes(strtolower($username))); //echo $QUERY; mysql_query($QUERY); -- cgit v1.2.3