\n";
output_footer();
DB_close();
exit();
}
$me = $_REQUEST["me"];
/* Ok, got a hash, but is it valid? */
$myid = DB_get_userid('hash',$me);
if(!$myid)
{
echo "Can't find you in the database, please check the url.
\n";
echo "perhaps the game has been canceled, check by login in here.";
output_footer();
DB_close();
exit();
}
/* user might get here by clicking on the link in an email, so session might not be set */
if(isset($_SESSION["name"]))
output_status($_SESSION["name"]);
/* the user has done something, update the timestamp */
DB_update_user_timestamp($myid);
/* get some information from the DB */
$gameid = DB_get_gameid_by_hash($me);
$myname = DB_get_name('hash',$me);
$mystatus = DB_get_status_by_hash($me);
$mypos = DB_get_pos_by_hash($me);
$myhand = DB_get_handid('hash',$me);
$session = DB_get_session_by_gameid($gameid);
/* get prefs and save them in a variable*/
$PREF = DB_get_PREF($myid);
/* get rule set for this game */
$RULES = DB_get_RULES($gameid);
/* get some infos about the game */
$gametype = DB_get_gametype_by_gameid($gameid);
$gamestatus = DB_get_game_status_by_gameid($gameid);
$GT = $gametype;
if($gametype=="solo")
{
$gametype = DB_get_solo_by_gameid($gameid);
$GT = $gametype." ".$GT;
}
/* does anyone have both foxes */
$GAME["schweinchen"]=0;
for($i=1;$i<5;$i++)
{
$hash = DB_get_hash_from_game_and_pos($gameid,$i);
$cards = DB_get_all_hand($hash);
if( in_array("19",$cards) && in_array("20",$cards) )
{
$GAME["schweinchen"]=1;
$GAME["schweinchen-who"]=$hash;
}
};
/* put everyting in a form */
echo "