add tagline feature

the first line of your ~/.ring file will be shown
here as your tagline

edit as you please :)
This commit is contained in:
Ben Harris 2021-01-13 12:30:14 -05:00
parent 6de03525e5
commit e9dd5e47e9
1 changed files with 9 additions and 3 deletions

View File

@ -54,12 +54,18 @@ else {
<p>then create a .ring file in your ~ to be added in the webring:</p>
<pre>$ touch ~/.ring</pre>
<h3>explore webring</h3>
<p>the first line of ~/.ring will be displayed here as a tagline</p>
<h3 id="explore">explore webring</h3>
<p><a href="?action=random">jump to random page</a></p>
<p>all members:</p>
<ul>
<?php foreach ($users as $user): ?>
<li><a href="https://tilde.team/~<?=$user?>/">~<?=$user?></a></li>
<?php foreach ($users as $user):
if (filesize("/home/$user/.ring") > 0)
$tagline = htmlspecialchars(trim(fgets(fopen("/home/$user/.ring", "r"))));
else unset($tagline); ?>
<li><a href="https://tilde.team/~<?=$user?>/">~<?=$user?></a><?=(isset($tagline) ? " &mdash; " : "")?><?=$tagline ?? ""?></li>
<?php endforeach; ?>
</ul>