summaryrefslogtreecommitdiffstats
path: root/include/db.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2012-06-09 08:53:39 -0700
committerArun Persaud <arun@nubati.net>2012-06-09 09:48:09 -0700
commit5d1647f138763213a32e3e1ba426e3f86157f018 (patch)
tree0b7c1ffdf98bd0f42c4e09377e3747f3535478f9 /include/db.php
parent21099cf40f1696e4e2213e3a497246a2e5570209 (diff)
downloade-DoKo-5d1647f138763213a32e3e1ba426e3f86157f018.tar.gz
e-DoKo-5d1647f138763213a32e3e1ba426e3f86157f018.tar.bz2
e-DoKo-5d1647f138763213a32e3e1ba426e3f86157f018.zip
Remove games from digest where the player already moved
Diffstat (limited to 'include/db.php')
-rw-r--r--include/db.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/db.php b/include/db.php
index 0523fea..1f02169 100644
--- a/include/db.php
+++ b/include/db.php
@@ -30,7 +30,7 @@ if(!isset($HOST))
function DB_open()
{
- $version_needed = 3;
+ $version_needed = 4;
global $DB,$DB_user,$DB_host,$DB_database,$DB_password;
$DB = @mysql_connect($DB_host,$DB_user, $DB_password);
@@ -1242,9 +1242,12 @@ function DB_get_number_of_tricks($gameid,$position)
return $r[0];
}
-function DB_digest_insert_email($To,$message)
+function DB_digest_insert_email($To,$message,$type,$gameid)
{
- DB_query("INSERT INTO digest_email VALUES (NULL,".DB_quote_smart($To).",NULL,".DB_quote_smart($message).")");
+ if($type == GAME_YOUR_TURN)
+ DB_query("INSERT INTO digest_email VALUES (NULL,".DB_quote_smart($To).",NULL,'your_turn',$gameid,".DB_quote_smart($message).")");
+ else
+ DB_query("INSERT INTO digest_email VALUES (NULL,".DB_quote_smart($To).",NULL,'misc',NULL,".DB_quote_smart($message).")");
return;
}
@@ -1263,7 +1266,7 @@ function DB_get_digest_message_by_email($email)
{
$messages = array();
- $result = DB_query("SELECT id,content FROM digest_email Where email='$email'");
+ $result = DB_query("SELECT id,content,type,game_id FROM digest_email Where email='$email'");
while($r = DB_fetch_array($result))
$messages[]=$r;