add userpage list

This commit is contained in:
leah 2021-08-18 11:44:09 +01:00
parent 68326f00c9
commit f2e198afa5
1 changed files with 55 additions and 0 deletions

55
static/users.php Normal file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>South London</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='/main.css'>
<link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>
<img src="/logo.svg" class="title">
<div class="links">
<span class="span1">
<a href="/">Home</a>
</span>
<span class="span2">
<a href="/pages/signup/">Sign Up</a></span>
<span class="span3">
<a href="/pages/conduct/">Code Of Conduct</a></span>
<span class="span4">
<a href="https://tildegit.org/southlondon">Git</a></span>
<span class="span5">
<a href="/pages/extras">More</a></span>
</div>
<main>
<div id="userpages" class="userpages-list">
<?php
$usercount = 0;
foreach (glob("/home/*/public_html", GLOB_ONLYDIR) as $user):
if (
(
// make sure we have an index page
!is_file("$user/index.html")
&& !is_file("$user/index.htm")
&& !is_file("$user/index.cgi")
&& !is_file("$user/index.php")
)
|| (
in_array(
sha1_file("$user/index.html"),
[
"9ea0df3015d624f8289b1d6b8606f4257aac8ab5"
]
)
)
) continue;
$user = basename(dirname($user));
$usercount++; ?>
<li><a href="/~<?=$user?>/" class="userpage-item">~<?=$user?></a></li>
<?php endforeach; ?>
</div>
</main>
</body>
</html>