SplatunesNetwork/index.php

39 lines
No EOL
1.4 KiB
PHP

<?php
$filtered_request = urldecode(strtok(substr($_SERVER['REQUEST_URI'], 1), '?'));
$files = glob($filtered_request . '*.mp3');
$count = count($files);
$artist = substr(urldecode($_SERVER['REQUEST_URI']), 1, -1);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/assets/common.css"/>
<link rel="stylesheet" href="/assets/index.css"/>
<title>Splatunes Network Preview</title>
<meta name="viewport" content="initial-scale=0.75 user-scalable=no"/>
<meta property="og:title" content="<?php echo $artist ?>"/>
<meta property="og:site_name" content="Splatunes Network Preview"/>
<meta property="og:description"
content="<?php echo "Listen to " . $count . " tracks by " . $artist . " on Splatunes Network." ?>"/>
<meta property="og:image" content="<?php echo "/" . $artist . "/artwork.jpg" ?>"/>
</head>
<body>
<a class="card" href="..">
<img src="/assets/svg/arrow_back.svg" alt="" class="svg button"/>
</a>
<?php
foreach ($files as $file) {
echo '<a class="card" href="/' . $file . '">
<img src="artwork.jpg" alt="" />
<div class="content">
<span class="title">' . str_replace($filtered_request, '', $file) . '</span>
</div>
</a>';
}
?>
<div class="footer"><a href="https://git.mctaylors.ru/mctaylors/SplatunesNetwork">Splatunes Network</a> Preview, exists
because it wants to. ©
</div>
</body>
</html>