forked from tildeverse/tilde.chat
Make the table look 1000% nicer
This commit is contained in:
parent
79bd8d273a
commit
33ff6876ff
15
stats.php
15
stats.php
|
@ -4,13 +4,16 @@ 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";
|
||||
?>
|
||||
<p>There are <?=$stats->usercount?> users across <?=$stats->channelcount?> channels.</p>
|
||||
<table class='table table-striped table-bordered'>
|
||||
<thead><tr><th>Name</th><th>Users</th><th>Topic</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach($stats->channels as $channel): ?>
|
||||
<tr><td><?=$channel->name?></td><td><?=$channel->usercount?></td><td><?=$channel->topic?></td></tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<p>Available in <a href="stats.json">JSON format</a>.</p>
|
||||
<?php include "footer.php"; ?>
|
||||
|
|
Loading…
Reference in New Issue