{
echo "couldn't find one of the names, please start a new game";
output_footer();
+ DB_close();
exit();
}
{
echo "Error defining ruleset: $ruleset";
output_footer();
+ DB_close();
exit();
};
echo "Can't find you in the database, please check the url.<br />\n";
echo "perhaps the game has been cancled, check by login in <a href=\"$host\">here</a>.";
output_footer();
+ DB_close();
exit();
}
echo "Can't find you in the database, please check the url.<br />\n";
echo "perhaps the game has been cancled, check by login in <a href=\"$host\">here</a>.";
output_footer();
+ DB_close();
exit();
}
$RULES["dullen"] = $r[2];
$RULES["schweinchen"] = $r[3];
-
+ $RULES["call"] = "1st-own-card";
+
+
/* get some infos about the game */
$gametype = DB_get_gametype_by_gameid($gameid);
$gamestatus = DB_get_game_status_by_gameid($gameid);
display_card($card,$PREF["cardset"]);
echo "</p>\n";
- check_for_sickness($me,$mycards);
+ output_check_for_sickness($me,$mycards);
/* move on to the next stage*/
DB_set_hand_status_by_hash($me,'check');
echo "The game has been canceled because ".DB_get_name_by_userid($nines).
" has five or more nines and nobody is playing solo.\n";
output_footer();
+ DB_close();
exit();
}
else if($poverty==1)
echo "<p style=\"background-color:red\";>Game $gameid has been cancled.<br /><br /></p>";
output_footer();
+ DB_close();
exit();
}
else
echo "(wedding)";
- if(substr_compare($GT,"solo",0,4)==0 && $party=="re")
+ if(ereg("solo",$GT) && $party=="re")
echo "($GT)";
/* add point calls */
" <input type=\"radio\" name=\"call30\" value=\"yes\" /> ";
if( can_call(0,$me) )
echo " 0:".
- " <input type=\"radio\" name=\"call0\" value=\"yes\" /> ";
+ " <input type=\"radio\" name=\"call0\" value=\"yes\" /> ".
+ " no call:".
+ " <input type=\"radio\" name=\"call0\" value=\"no\" /> ";
echo "<br />\nA short comments:<input name=\"comment\" type=\"text\" size=\"30\" maxlength=\"50\" />\n";
echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
echo "error in testing the status";
}
output_footer();
+ DB_close();
exit();
}
/* user status page */
echo "<p>and these are your games that are already done:<br />Game: \n";
+ $output=array();
$result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" );
while( $r = mysql_fetch_array($result,MYSQL_NUM))
- echo "<a href=\"".$host."?me=".$r[0]."\">#".$r[1]." </a>, ";
- echo "</p>\n";
+ $output[]= "<a href=\"".$host."?me=".$r[0]."\">#".$r[1]." </a>";
+ echo implode(", ",$output)."</p>\n";
$names = DB_get_all_names();
echo "<p>registered players:<br />\n";
- foreach ($names as $name)
- echo "$name, \n";
+ echo implode(", ",$names)."\n";
echo "</p>\n";
echo "<p>Want to start a new game? Visit <a href=\"".$host."?new\">this page.</a></p>";
}
};
output_footer();
+ DB_close();
exit();
}
/* page for registration */
$game = mysql_fetch_array($r,MYSQL_NUM);
$done = mysql_fetch_array($r,MYSQL_NUM);
}
- output_home_page($pre[0],$game[0],$done[0]);
+
+ $r=mysql_query("SELECT AVG(datediff(mod_date,create_date)) FROM Game where status='gameover' ");
+ if($r)
+ $avgage= mysql_fetch_array($r,MYSQL_NUM);
+ else
+ $avgage[0]=0;
+
+ output_home_page($pre[0],$game[0],$done[0],$avgage[0]);
}
output_footer();