use second line of ~/.ring as destination
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
e9dd5e47e9
commit
9dafe487bf
|
@ -23,7 +23,14 @@ if ($action !== "index") {
|
||||||
die("invalid action");
|
die("invalid action");
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Location: https://tilde.team/~$user/");
|
// use custom link from second line of ~/.ring
|
||||||
|
if (filesize("/home/$user/.ring") > 0) {
|
||||||
|
$ringfile = file("/home/$user/.ring", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
if (count($ringfile) > 1 && $ringfile[1] !== "")
|
||||||
|
$dest = trim($ringfile[1]);
|
||||||
|
}
|
||||||
|
$location = $dest ?? "/~$user/";
|
||||||
|
header("Location: $location");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -54,18 +61,26 @@ else {
|
||||||
<p>then create a .ring file in your ~ to be added in the webring:</p>
|
<p>then create a .ring file in your ~ to be added in the webring:</p>
|
||||||
<pre>$ touch ~/.ring</pre>
|
<pre>$ touch ~/.ring</pre>
|
||||||
|
|
||||||
<p>the first line of ~/.ring will be displayed here as a tagline</p>
|
<p>the first line of ~/.ring will be displayed here as a tagline.</p>
|
||||||
|
<p>the second line of the file is used as a custom link if your webring tags are not on your homepage.</p>
|
||||||
|
|
||||||
<h3 id="explore">explore webring</h3>
|
<h3 id="explore">explore webring</h3>
|
||||||
<p><a href="?action=random">jump to random page</a></p>
|
<p><a href="?action=random">jump to random page</a></p>
|
||||||
<p>all members:</p>
|
<p>all members:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($users as $user):
|
<?php foreach ($users as $user):
|
||||||
if (filesize("/home/$user/.ring") > 0)
|
if (filesize("/home/$user/.ring") > 0) {
|
||||||
$tagline = htmlspecialchars(trim(fgets(fopen("/home/$user/.ring", "r"))));
|
$ringfile = file("/home/$user/.ring", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
else unset($tagline); ?>
|
$tagline = htmlspecialchars($ringfile[0]);
|
||||||
|
if (count($ringfile) > 1 && $ringfile[1] !== "")
|
||||||
|
$link = htmlspecialchars($ringfile[1]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unset($tagline);
|
||||||
|
unset($link);
|
||||||
|
} ?>
|
||||||
|
|
||||||
<li><a href="https://tilde.team/~<?=$user?>/">~<?=$user?></a><?=(isset($tagline) ? " — " : "")?><?=$tagline ?? ""?></li>
|
<li><a href="<?=$link ?? "/~$user/"?>">~<?=$user?></a><?=(isset($tagline) ? " — $tagline" : "")?></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue