diff options
author | Arun Persaud <arun@nubati.net> | 2007-06-29 18:22:01 +0200 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2007-07-01 19:23:16 +0200 |
commit | 67d441a0c134060e61f840d955b370145d1ac328 (patch) | |
tree | 6b03e8d58c05ab39a06a11e9ec74b623a50700f4 /db.php | |
parent | 90c9f0ee729d1960df96989b2b38d77f16ec1284 (diff) | |
download | e-DoKo-67d441a0c134060e61f840d955b370145d1ac328.tar.gz e-DoKo-67d441a0c134060e61f840d955b370145d1ac328.tar.bz2 e-DoKo-67d441a0c134060e61f840d955b370145d1ac328.zip |
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
Diffstat (limited to 'db.php')
-rw-r--r-- | db.php | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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 |