This repository has been archived on 2018-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
sotdbot/sotdlist.php

32 lines
945 B
PHP

<?php
define("SOTD_LOCATION","/home/khuxkm/code/sotdbot/sotd.json");
$sotd = json_decode(file_get_contents(SOTD_LOCATION),TRUE)["stored_data"];
?>
<html>
<head>
<title>SOTD List</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://tilde.team/css/hacker.css">
<link rel="stylesheet" href="https://tilde.team/css/fork-awesome.css">
</head>
<body>
<div class="container">
<h1><i class="fa fa-music" aria-hidden="true"></i> Song of the Day</h1>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
<thead>
<th>Username</th>
<th>Song</th>
</thead>
<tbody>
<?php foreach($sotd as $username => $data): ?>
<tr><td><?=$username?></td>
<td><a href="<?=$data["value"][1]?>"><?=$data["value"][0]?></a></td>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</body>
</html>