20 lines
804 B
PHP
20 lines
804 B
PHP
<?php $title="stats page";
|
|
$desc="stats about tilde.chat and its channels";
|
|
include __DIR__."/../header.php"; ?>
|
|
<h1>stats</h1>
|
|
<?php
|
|
$stats = json_decode(file_get_contents("../stats.json"));
|
|
?>
|
|
<p>There are <?=$stats->usercount?> users across <?=$stats->channelcount?> channels.</p>
|
|
<table class='table table-striped table-bordered table-hover'>
|
|
<thead><tr><th>Name</th><th>Users</th><th>Topic</th></tr></thead>
|
|
<tbody data-link="row" class="rowlink">
|
|
<?php foreach($stats->channels as $channel): ?>
|
|
<tr><td><a href="<?=$channel->webchatlink?>"><?=$channel->name?></a></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 __DIR__."/../footer.php"; ?>
|