diff options
author | Arun Persaud <arun@nubati.net> | 2008-05-08 20:40:43 -0700 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2008-05-08 20:40:43 -0700 |
commit | 9239ba22c382383cd258ad3f36b2bc0dc99664b2 (patch) | |
tree | 916f1a75fa7624a9ec756b5ff673ba796812b7ed /include/db.php | |
parent | 90323815e10b6bd6dc04e270a78ee9687a2f357a (diff) | |
download | e-DoKo-9239ba22c382383cd258ad3f36b2bc0dc99664b2.tar.gz e-DoKo-9239ba22c382383cd258ad3f36b2bc0dc99664b2.tar.bz2 e-DoKo-9239ba22c382383cd258ad3f36b2bc0dc99664b2.zip |
CLEANUP: reorganized the 'init' phase of a game
moved some code around, so that we test the result
of the init phase in the init case statement. Made things
a bit clearer and removed one page reload by doing this.
Signed-off-by: Arun Persaud <arun@nubati.net>
Diffstat (limited to 'include/db.php')
-rw-r--r-- | include/db.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/db.php b/include/db.php index 8c04828..a9bdffd 100644 --- a/include/db.php +++ b/include/db.php @@ -668,8 +668,6 @@ function DB_set_party_by_hash($hash,$party) function DB_get_PREF($myid) { - global $PREF; - /* Cardset */ $r = DB_query_array("SELECT value from User_Prefs". " WHERE user_id='$myid' AND pref_key='cardset'" ); @@ -696,7 +694,20 @@ function DB_get_PREF($myid) else $PREF["email"]="emailnonaddict"; - return; + return $PREF; +} + +function DB_get_RULES($gameid) +{ + $r = DB_query_array("SELECT * FROM Rulesets". + " LEFT JOIN Game ON Game.ruleset=Rulesets.id ". + " WHERE Game.id='$gameid'" ); + + $RULES["dullen"] = $r[2]; + $RULES["schweinchen"] = $r[3]; + $RULES["call"] = $r[4]; + + return $RULES; } function DB_get_email_pref_by_hash($hash) |