From 67d441a0c134060e61f840d955b370145d1ac328 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Fri, 29 Jun 2007 18:22:01 +0200 Subject: NEW FEATURE: allow multiple comments you can now also comment, if it is not your turn, and up to 7 days after the game finished. doubled size of comments too --- db.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'db.php') diff --git a/db.php b/db.php index bae70cb..f883fff 100644 --- a/db.php +++ b/db.php @@ -484,7 +484,6 @@ function DB_get_max_trickid($gameid) $result = mysql_query("SELECT MAX(id) FROM Trick WHERE game_id=".DB_quote_smart($gameid)); $r = mysql_fetch_array($result,MYSQL_NUM) ; - return ($r?$r[0]:NULL); } @@ -591,6 +590,7 @@ function DB_get_user_timezone($userid) function DB_insert_comment($comment,$playid,$userid) { mysql_query("INSERT INTO Comment VALUES (NULL,NULL,NULL,$userid,$playid, ".DB_quote_smart($comment).")"); + return; } @@ -817,4 +817,19 @@ function DB_get_card_name($card) return "Error during get_card_name ".$card; } +function DB_get_current_playid($gameid) +{ + $trick = DB_get_max_trickid($gameid); + + if(!$trick) return NULL; + + $queryresult = mysql_query("SELECT id FROM Play WHERE trick_id='$trick' ORDER BY create_date DESC LIMIT 1"); + + $r = mysql_fetch_array($queryresult,MYSQL_NUM); + if($r) + return $r[0]; + + return ""; +} + ?> \ No newline at end of file -- cgit v1.2.3-18-g5258