summaryrefslogtreecommitdiffstats
path: root/db.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-03-11 22:21:09 -0700
committerArun Persaud <arun@nubati.net>2008-03-11 22:21:09 -0700
commit3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9 (patch)
tree38c8b54eedd2f71864c20faa2d4403511f8eba4d /db.php
parentcdee8a3e86f57ac0ace7fad8612b0b809b9d08a4 (diff)
downloade-DoKo-3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9.tar.gz
e-DoKo-3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9.tar.bz2
e-DoKo-3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9.zip
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 <arun@nubati.net>
Diffstat (limited to 'db.php')
-rw-r--r--db.php21
1 files changed, 21 insertions, 0 deletions
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));