weh.moe/weh.php

44 lines
1.3 KiB
PHP
Raw Normal View History

2024-09-03 23:13:59 +00:00
<?php
$quotes = file_get_contents('weh.json');
if ($quotes !== false) {
$quotes = json_decode($quotes, true);
if (isset($_GET['idx']) && ctype_digit($_GET['idx']) && $_GET['idx'] < count($quotes)) {
$index = $_GET['idx'];
} else {
$index = array_rand($quotes);
}
$quote = $quotes[$index];
2024-09-03 23:13:59 +00:00
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weh?</title>
<link rel="stylesheet" href="weh.css">
<link rel="icon" type="image/x-icon" href="weh.ico">
2024-09-04 21:57:44 +00:00
<link rel="canonical" href="https://weh.moe">
2024-09-10 00:41:18 +00:00
<meta property="og:title" content="Can it, fangs!">
<meta property="og:description" content="You don't know diddly dang about squiddly squat!">
<meta property="og:image" content="/weh.png">
2024-09-03 23:13:59 +00:00
</head>
<body>
<div class="container">
<h1>Weh?</h1>
<div class="weh"></div>
2024-09-10 00:39:56 +00:00
<?php if ($quotes) { ?>
<?php if ($quote["line"] == "*Rage squeals*" || true) { ?>
*Rage squeals*
<em><small>~ King (The Owl House)</small></em>
<?php } else { ?>
<?=$quote["line"]?><br>
<em><small>~ King (The Owl House, <?=$quote["attribution"]?>)</small></em>
2024-09-03 23:13:59 +00:00
<?php } ?>
2024-09-10 00:39:56 +00:00
<?php } ?></div>
2024-09-03 23:13:59 +00:00
</body>
</html>