From d8eac0035f97a64371557e7da8b9730fe28d8788 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 29 Jul 2007 18:54:14 -0700 Subject: LAYOUT: address game by session.gamenr don't use gameid, but use session.gamenumber instead. needs this for tournaments later. new games will get a session number now by default. --- db.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'db.php') diff --git a/db.php b/db.php index 41e4479..867be16 100644 --- a/db.php +++ b/db.php @@ -902,4 +902,17 @@ function DB_get_partner_hash_by_hash($hash) return NULL; } +function DB_format_gameid($gameid) +{ + $session = DB_get_session_by_gameid($gameid); + + /* get number of game */ + $result = mysql_query("SELECT COUNT(*),create_date FROM Game WHERE session='$session' ". + " GROUP by session". + " HAVING TIMEDIFF(create_date, (SELECT create_date FROM Game WHERE id='$gameid'))<=0"); + $r = mysql_fetch_array($result,MYSQL_NUM); + + return $session.".".$r[0]; +} + ?> \ No newline at end of file -- cgit v1.2.3-18-g5258