2 /* make sure that we are not called from outside the scripts,
3 * use a variable defined in config.php to check this
8 /* this outputs the default home page with some extra statistics on it */
10 $pre[0]=0;$game[0]=0;$done[0]=0;
12 $r=DB_query("SELECT COUNT(*) FROM Game where status='pre'");
13 if($r) $pre = DB_fetch_array($r);
15 $r=DB_query("SELECT COUNT(*) FROM Game where status='play'");
16 if($r) $game = DB_fetch_array($r);
18 $r=DB_query("SELECT COUNT(*) FROM Game where status='gameover'");
19 if($r) $done = DB_fetch_array($r);
22 $r=DB_query("SELECT AVG(datediff(mod_date,create_date)) FROM Game where status='gameover' ");
24 $avgage= DB_fetch_array($r);
33 echo "\n\n<div class=\"login\">\n";
35 echo "<p> If you want to play a game of Doppelkopf, you found the right place ;)</p>".
36 "<p> For more information please visit our <a href=\"$WIKI\">wiki</a>. </p>".
37 "<h4>Some statistics:</h4>";
41 echo "<p> At the moment there are no games that are being started ";
43 echo "<p> At the moment there is one games that is being started ";
45 echo "<p> At the moment there are $pre games that are being started ";
50 echo "zero games that are ongoing. ";
52 echo "one game that is ongoing. ";
54 echo "$game games that are ongoing. ";
59 echo "No game has been completed on this server. </p>";
61 echo "One game has been completed on this server. </p>";
63 echo "$done games have been completed on this server. Average time of a game: $avgage days</p>";
66 <h4> Login/Register:</h4>
68 Please <a href="index.php?action=register">register</a>, in case you have not done that yet <br />
69 or login with you email-address or name and password here:
72 <form action="index.php?action=login" method="post">
74 <label for="email">Email:</label>
75 <input type="text" id="email" name="email" size="20" maxlength="30" /> <br />
76 <label for="password">Password:</label>
77 <input type="password" id="password" name="password" size="20" maxlength="30" /> <br />
78 <input type="submit" class="submitbutton" name="login" value="login" />
79 <input type="submit" class="submitbutton" name="forgot" value="Forgot your password?" />
84 <p> Have an OpenID account? Sign in below <br />
85 <input type="text" id="openid_url" name="openid_url" size="20" maxlength="50" />
86 <input type="submit" class="submitbutton" name="login" value="Sign in" /><br />
87 e.g. http://username.openid.net. See <a href="http://openid.net">openid.net</a> for more information.</p>