Add stats page
This commit is contained in:
parent
58303d3641
commit
6e6b3996d1
|
@ -0,0 +1,16 @@
|
|||
<?php $title="stats page";
|
||||
$desc="stats about tilde.chat and its channels";
|
||||
include "header.php"; ?>
|
||||
<h1>stats</h1>
|
||||
<?php
|
||||
$stats = json_decode(file_get_contents("stats.json"));
|
||||
echo "\t<p>There are {$stats->usercount} users across {$stats->channelcount} channels.</p>\n";
|
||||
echo "\t<table class='table'>\n\t\t<tr><th>Name</th><th>User count</th><th>Topic</th></tr>\n";
|
||||
foreach($stats->channels as $channel) {
|
||||
echo "\t<tr><td>{$channel->name}</td><td>{$channel->usercount}</td><td>{$channel->topic}</td></tr>\n";
|
||||
}
|
||||
echo "\t</table>\n";
|
||||
?>
|
||||
<hr>
|
||||
<p>Available in <a href="stats.json">JSON format</a>.</p>
|
||||
<?php include "footer.php"; ?>
|
Loading…
Reference in New Issue