<?php
-/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arun Persaud <arun@nubati.net>
+/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Arun Persaud <arun@nubati.net>
*
* This file is part of e-DoKo.
*
if(!$sequence || $sequence==4)
{
- DB_query("INSERT INTO Trick VALUES (NULL,NULL,NULL, ".DB_quote_smart($gameid).",NULL)");
+ DB_query("INSERT INTO Trick VALUES (CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,NULL,".DB_quote_smart($gameid).",NULL)");
$trickid = DB_insert_id();
$sequence = 1;
$number++;
function DB_play_card($trickid,$handcardid,$sequence)
{
- DB_query("INSERT INTO Play VALUES(NULL,NULL,NULL,".DB_quote_smart($trickid).
+ DB_query("INSERT INTO Play VALUES(CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,NULL,".DB_quote_smart($trickid).
",".DB_quote_smart($handcardid).",".DB_quote_smart($sequence).")");
$playid = DB_insert_id();
{
$names = array();
- $result = DB_query("SELECT fullname FROM User ORDER BY create_date DESC, id DESC LIMIT $N");
+ $result = DB_query("SELECT fullname FROM User".
+ " WHERE create_date >=(NOW() - interval 45 day)".
+ " ORDER BY create_date DESC, id DESC LIMIT $N");
while($r = DB_fetch_array($result))
$names[] = $r[0];
function DB_insert_comment($comment,$playid,$gameid,$userid)
{
- DB_query("INSERT INTO Comment VALUES (NULL,NULL,NULL,$userid,$playid,$gameid, ".DB_quote_smart($comment).")");
+ DB_query("INSERT INTO Comment VALUES (CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,NULL,$userid,$playid,$gameid, ".DB_quote_smart($comment).")");
return;
}
function DB_insert_note($comment,$gameid,$userid)
{
- DB_query("INSERT INTO Notes VALUES (NULL,NULL,NULL,$userid,$gameid, ".DB_quote_smart($comment).")");
+ DB_query("INSERT INTO Notes VALUES (CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,NULL,$userid,$gameid, ".DB_quote_smart($comment).")");
return;
}
else
{
/* create new one */
- $result = DB_query("INSERT INTO Rulesets VALUES (NULL, NULL, ".
+ $result = DB_query("INSERT INTO Rulesets VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ".
DB_quote_smart($dullen).",".
DB_quote_smart($schweinchen).",".
DB_quote_smart($lowtrump).",".
switch($pref[0])
{
case 'cardset':
+ if($pref[1])
+ $PREF['cardset'] = $pref[1];
break;
case 'email':
function DB_set_recovery_password($user,$newpw)
{
DB_query("INSERT INTO Recovery VALUES(NULL,".DB_quote_smart($user).
- ",".DB_quote_smart($newpw).",NULL)");
+ ",".DB_quote_smart($newpw).",CURRENT_TIMESTAMP)");
return;
}
{
DB_query("INSERT INTO Reminder ".
" VALUES(NULL, ".DB_quote_smart($user).", ".DB_quote_smart($gameid).
- ", NULL) ");
+ ", CURRENT_TIMESTAMP) ");
return 0;
}
function DB_digest_insert_email($To,$message,$type,$gameid)
{
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).")");
+ DB_query("INSERT INTO digest_email VALUES (NULL,".DB_quote_smart($To).",CURRENT_TIMESTAMP,'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).")");
+ DB_query("INSERT INTO digest_email VALUES (NULL,".DB_quote_smart($To).",CURRENT_TIMESTAMP,'misc',NULL,".DB_quote_smart($message).")");
return;
}