Make network stats include a link to a webchat

This commit is contained in:
Robert Miles 2018-07-19 18:36:02 -04:00
parent 277d4c4dce
commit b4c6d97783
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ for schannel in schannels:
channel["topic"]="Topic hidden"
if channel["name"]=="#secret-sudoers": # no stat output for #secret-sudoers! it's a sekrit club of the ~team sysadmins!
continue
channel["webchatlink"] = "https://web.tilde.chat/?join="+channel["name"].lstrip("#")
channels.append(channel)
channels.sort(key=lambda x: x["name"].lower())
out["channels"]=channels

View File

@ -10,7 +10,7 @@ include "header.php"; ?>
<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="//web.tilde.chat/?join=<?=ltrim($channel->name,"#")?>"><?=$channel->name?></a></td><td><?=$channel->usercount?></td><td><?=$channel->topic?></td></tr>
<tr><td><a href="<?=$channel->webchatlink?>"><?=$channel->name?></a></td><td><?=$channel->usercount?></td><td><?=$channel->topic?></td></tr>
<?php endforeach; ?>
</tbody>
</table>