CLEANUP: moved more statistics into the sortable table
[e-DoKo.git] / include / db.php
index 882a1adb35448224451f230aff4f6278fa373a80..b79da87def6d231ccbc39507619e21a049cc8e09 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/* Copyright 2006, 2007, 2008, 2009, 2010 Arun Persaud <arun@nubati.net>
+ *
+ *   This file is part of e-DoKo.
+ *
+ *   e-DoKo is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   e-DoKo is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with e-DoKo.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 /* make sure that we are not called from outside the scripts,
  * use a variable defined in config.php to check this
  */
@@ -498,6 +517,15 @@ function DB_update_game_timestamp($gameid)
   return;
 }
 
+function DB_get_game_timestamp($gameid)
+{
+  $r = DB_query_array("SELECT mod_date FROM Game WHERE id=".DB_quote_smart($gameid));
+
+  if($r)
+    return $r[0];
+  else
+    return NULL;
+}
 
 function DB_update_user_timestamp($userid)
 {
@@ -514,6 +542,17 @@ function DB_get_user_timestamp($userid)
   else
     return NULL;
 }
+
+function DB_get_user_creation_date($userid)
+{
+  $r = DB_query_array("SELECT create_date FROM User WHERE id=".DB_quote_smart($userid));
+
+  if($r)
+    return $r[0];
+  else
+    return NULL;
+}
+
 function DB_get_user_timezone($userid)
 {
   $r = DB_query_array("SELECT timezone FROM User WHERE id=".DB_quote_smart($userid));