X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=db.php;h=b3651bd4beffc7bf0e99be833f12f2efcee52643;hp=8843712f0cf0ff5f6004a3b8c0ce203d2608b1fc;hb=4b94fd36ed89060493ac80d89db3c1e304b13623;hpb=9fd03423a0e5e26397250e8924d2be0e01e2ceaf diff --git a/db.php b/db.php index 8843712..b3651bd 100644 --- a/db.php +++ b/db.php @@ -417,7 +417,7 @@ function DB_get_all_userid_by_gameid($id) $names = array(); $result = mysql_query("SELECT user_id FROM Hand WHERE game_id=". - DB_quote_smart($id)); + DB_quote_smart($id)." ORDER BY position "); while($r = mysql_fetch_array($result,MYSQL_NUM)) $names[] = $r[0]; @@ -446,6 +446,13 @@ function DB_get_all_names() return $names; } +function DB_update_game_timestamp($gameid) +{ + mysql_query("UPDATE Game SET mod_date = CURRENT_TIMESTAMP WHERE id=".DB_quote_smart($gameid)); + return; +} + + function DB_update_user_timestamp($userid) { mysql_query("UPDATE User SET last_login = CURRENT_TIMESTAMP WHERE id=".DB_quote_smart($userid)); @@ -584,4 +591,21 @@ function DB_get_ruleset($dullen,$schweinchen) return -1; /* something went wrong */ } +function DB_get_party_by_hash($hash) +{ + $result = mysql_query("SELECT party FROM Hand WHERE hash=".DB_quote_smart($hash)); + $r = mysql_fetch_array($result,MYSQL_NUM); + + if($r) + return $r[0]; + else + return NULL; +} +function DB_set_party_by_hash($hash,$party) +{ + mysql_query("UPDATE Hand SET party=".DB_quote_smart($party)." WHERE hash=".DB_quote_smart($hash)); + return; +} + + ?> \ No newline at end of file