Browse Source

normalize webchat links

pull/45/head
Ben Harris 1 month ago
parent
commit
157404fb0c
  1. 4
      badges/shieldsio.php
  2. 2
      gen_stats
  3. 2
      index.php
  4. 2
      stats/index.php
  5. 2
      wiki/pages/hamradio.md

4
badges/shieldsio.php

@ -1,14 +1,14 @@
<?php
function get_badge($channel_name=FALSE) {
if ($channel_name==FALSE) {
return "https://img.shields.io/badge/dynamic/json.svg?url=https://tilde.chat/stats.json&label=~chat&query=$.usercount&suffix=%20online&link=https:%2F%2Ftilde.chat&link=https:%2F%2Fkiwi.tilde.chat&colorB=%2300cc00";
return "https://img.shields.io/badge/dynamic/json.svg?url=https://tilde.chat/stats.json&label=~chat&query=$.usercount&suffix=%20online&link=https:%2F%2Ftilde.chat&link=https:%2F%2Ftilde.chat%2Fkiwi%2F&colorB=%2300cc00";
}
$name_url = urlencode($channel_name);
$name_link = urlencode(substr($channel_name,1));
$stats = json_decode(file_get_contents("https://tilde.chat/stats.json")) ?? array("channels"=>[]);
foreach ($stats->channels as $key=>$channel) {
if ($channel->name==$channel_name) {
return "https://img.shields.io/badge/dynamic/json.svg?url=https://tilde.chat/stats.json&label=~chat&query=$.channels[$key].usercount&suffix=%20online%20on%20{$name_url}&link=https:%2F%2Ftilde.chat&link=https:%2F%2Fkiwi.tilde.chat%2F{$name_link}&colorB=%2300cc00";
return "https://img.shields.io/badge/dynamic/json.svg?url=https://tilde.chat/stats.json&label=~chat&query=$.channels[$key].usercount&suffix=%20online%20on%20{$name_url}&link=https:%2F%2Ftilde.chat&link=https:%2F%2Ftilde.chat%2Fkiwi%2F{$name_link}&colorB=%2300cc00";
}
}
return "https://img.shields.io/badge/~chat-invalid%20channel-red.svg";

2
gen_stats

@ -51,7 +51,7 @@ for c in root.findall("./channellist/channel"):
name=name,
topic=unsanitize(c.find("./channeltopic/topictext"), "no topic set"),
usercount=int(c.find("usercount").text),
webchatlink="https://kiwi.tilde.chat/" + name,
webchatlink="https://tilde.chat/kiwi/" + name,
)
)

2
index.php

@ -14,7 +14,7 @@
<em>na</em>.tilde.chat, <em>eu</em>.tilde.chat, and <em>au</em>.tilde.chat on port 6697 with ssl/tls.
</p>
<p>plaintext <a href="irc://localhost:6667">on localhost port 6667</a> is available at a shell on <a href="wiki/servers">tildes that run chat nodes</a> (port 7766 on ~town)</p>
<p>if you don't have a client ready to go, try using our <a href="https://kiwi.tilde.chat/">webchat</a>.</p>
<p>if you don't have a client ready to go, try using our <a href="https://tilde.chat/kiwi/">webchat</a>.</p>
<p>
you can also connect from any xmpp client with our <a href="https://biboumi.louiz.org">biboumi gateway</a>.
it runs on <a href="https://tilde.team/wiki/xmpp#biboumi">tilde.team</a>'s xmpp server.

2
stats/index.php

@ -13,7 +13,7 @@ include __DIR__."/../header.php";
<div class="btn-group">
<a class="btn btn-default" href="<?=$member->link?>"><?=$member->name?></a>
<?php foreach ($chans as $chan) { ?>
<a class="btn btn-primary" href="https://kiwi.tilde.chat/<?=$chan?>"><?=$chan?></a>
<a class="btn btn-primary" href="https://tilde.chat/kiwi/<?=$chan?>"><?=$chan?></a>
<?php } ?>
</div>
<?php } ?>

2
wiki/pages/hamradio.md

@ -19,4 +19,4 @@ This is a list of callsigns of tildeverse members.
- [KK6GET = NoraCodes](//tilde.town/~noracodes)
- [NV0N = jjs](//jjs.tilde.team)
A ham radio operator channel is available: [#hamradio](https://kiwi.tilde.chat/#hamradio).
A ham radio operator channel is available: [#hamradio](https://tilde.chat/kiwi/#hamradio).

Loading…
Cancel
Save