summaryrefslogtreecommitdiffstats
path: root/include/welcome.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/welcome.php')
-rw-r--r--include/welcome.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/welcome.php b/include/welcome.php
new file mode 100644
index 0000000..7aeaf78
--- /dev/null
+++ b/include/welcome.php
@@ -0,0 +1,26 @@
+<?php
+/* make sure that we are not called from outside the scripts,
+ * use a variable defined in config.php to check this
+ */
+if(!isset($HOST))
+ exit;
+
+/* this outputs the default home page with some extra statistics on it */
+
+$pre[0]=0;$game[0]=0;$done[0]=0;
+$r=mysql_query("SELECT COUNT(id) FROM Game GROUP BY status");
+if($r) {
+ $pre = mysql_fetch_array($r,MYSQL_NUM);
+ $game = mysql_fetch_array($r,MYSQL_NUM);
+ $done = mysql_fetch_array($r,MYSQL_NUM);
+ }
+
+$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]);
+
+?> \ No newline at end of file