From 3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Tue, 11 Mar 2008 22:21:09 -0700 Subject: NEW FEATURE: Ability to add personal notes for each game In case a player is involed in too many games it can get quite confusing with whom your playing, etc. so now the player can add notes on the side that only show up on his/her screen. Signed-off-by: Arun Persaud --- db.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'db.php') diff --git a/db.php b/db.php index 7b95ae7..7934781 100644 --- a/db.php +++ b/db.php @@ -641,6 +641,27 @@ function DB_insert_comment($comment,$playid,$userid) return; } +function DB_insert_note($comment,$gameid,$userid) +{ + mysql_query("INSERT INTO Notes VALUES (NULL,NULL,NULL,$userid,$gameid, ".DB_quote_smart($comment).")"); + + return; +} + +function DB_get_notes_by_userid_and_gameid($userid,$gameid) +{ + $notes = array(); + + $result = mysql_query("SELECT comment FROM Notes WHERE user_id=".DB_quote_smart($userid) . + " AND game_id=".DB_quote_smart($gameid)); + + while($r = mysql_fetch_array($result,MYSQL_NUM)) + $notes[] = $r[0]; + + return $notes; +} + + function DB_get_gametype_by_gameid($id) { $result = mysql_query("SELECT type FROM Game WHERE id=".DB_quote_smart($id)); -- cgit v1.2.3-18-g5258