Compare commits
1 commit
master
...
discord-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f47c6d1313 |
2 changed files with 70 additions and 6 deletions
|
|
@ -49,6 +49,10 @@ li:before {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.discord-widget > li::before {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
p,
|
p,
|
||||||
ul,
|
ul,
|
||||||
pre {
|
pre {
|
||||||
|
|
@ -139,16 +143,24 @@ table.system-info tr td:first-child {
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-container > div.sidebar {
|
.page-container > div.sidebar {
|
||||||
border-left: 2px solid gray;
|
border-left: 2px solid var(--foreground);
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer hr {
|
.footer hr {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
border: none;
|
border: none;
|
||||||
border-top: 2px solid gray;
|
border-top: 2px solid var(--foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
small {
|
small {
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.indent {
|
||||||
|
padding-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.sidebar li.offline {
|
||||||
|
opacity: 80%;
|
||||||
|
}
|
||||||
|
|
|
||||||
60
index.php
60
index.php
|
|
@ -1,6 +1,34 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function getUsers()
|
$BOT_USERS = [
|
||||||
|
"Calypso",
|
||||||
|
"MerryBot",
|
||||||
|
"MathBot",
|
||||||
|
"GPT Assistant",
|
||||||
|
"Tatsu",
|
||||||
|
"Automated_Squirrel",
|
||||||
|
"IceCreamBeta",
|
||||||
|
"Dictionary",
|
||||||
|
"NotSoBot",
|
||||||
|
"Kainé",
|
||||||
|
"Birdbot",
|
||||||
|
"IceCreamBot",
|
||||||
|
"EasyPoll",
|
||||||
|
"TeXit",
|
||||||
|
"FredBoat♪♪",
|
||||||
|
"Ordis",
|
||||||
|
"Jikkeogi ⁞ 찌꺼기",
|
||||||
|
"Linux RSS Bot",
|
||||||
|
"Yappy, the GitLab Monitor",
|
||||||
|
"QuizBot",
|
||||||
|
"OkiDoki",
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of users on the server with "public_html" folders
|
||||||
|
* @return array Array of usernames
|
||||||
|
*/
|
||||||
|
function getUsers(): array
|
||||||
{
|
{
|
||||||
$usernames = array();
|
$usernames = array();
|
||||||
|
|
||||||
|
|
@ -19,8 +47,19 @@ function getUsers()
|
||||||
return $usernames;
|
return $usernames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the member list from the Discord widget API
|
||||||
|
* @return mixed Array of members
|
||||||
|
*/
|
||||||
|
function getDiscordWidget(): mixed
|
||||||
|
{
|
||||||
|
$json = json_decode(file_get_contents("https://discord.com/api/guilds/445821876183367680/widget.json"));
|
||||||
|
return $json->members;
|
||||||
|
}
|
||||||
|
|
||||||
// Execute the function and display results
|
// Execute the function and display results
|
||||||
$usernames = getUsers();
|
$usernames = getUsers();
|
||||||
|
$members = getDiscordWidget();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
@ -43,8 +82,9 @@ $usernames = getUsers();
|
||||||
|___| |__| |_____|_____|_____|__|__|​|_____/|_____|\___/</pre>
|
|___| |__| |_____|_____|_____|__|__|​|_____/|_____|\___/</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<p>Members</p>
|
<p><b>Members</b></p>
|
||||||
<ul class="members">
|
<ul class="members">
|
||||||
|
<?= count($usernames) == 0 ? "<li>Error Retrieving Users</li>" : "" ?>
|
||||||
<?php foreach ($usernames as $username) { ?>
|
<?php foreach ($usernames as $username) { ?>
|
||||||
<li><a href="/~<?= $username ?>">~<?= $username ?></a><?= $username == "amr" ? "*" : "" ?></li>
|
<li><a href="/~<?= $username ?>">~<?= $username ?></a><?= $username == "amr" ? "*" : "" ?></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
@ -54,7 +94,7 @@ $usernames = getUsers();
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<p>Services</p>
|
<p><b>Services</b></p>
|
||||||
<table class="services">
|
<table class="services">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="https://git.frzn.dev">git.frzn.dev</a></td>
|
<td><a href="https://git.frzn.dev">git.frzn.dev</a></td>
|
||||||
|
|
@ -103,7 +143,7 @@ $usernames = getUsers();
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<p>System Info</p>
|
<p><b>System Info</b></p>
|
||||||
<table class="system-info">
|
<table class="system-info">
|
||||||
<tr>
|
<tr>
|
||||||
<td>time:</td>
|
<td>time:</td>
|
||||||
|
|
@ -116,6 +156,18 @@ $usernames = getUsers();
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="sidebar">
|
||||||
|
<p><b>Online Members</b></p>
|
||||||
|
<div class="indent">
|
||||||
|
<ul class="discord-widget">
|
||||||
|
<?php foreach ($members as $member) { ?>
|
||||||
|
<?php if (!in_array($member->username, $BOT_USERS)) { ?>
|
||||||
|
<li><?= $member->username ?></li>
|
||||||
|
<?php } ?>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue