Titles randomization
This commit is contained in:
parent
c120f624df
commit
b2f4249e2e
3 changed files with 108 additions and 45 deletions
73
404.php
73
404.php
|
|
@ -3,8 +3,67 @@ date_default_timezone_set('Europe/Copenhagen');
|
||||||
if (!function_exists('h')) {
|
if (!function_exists('h')) {
|
||||||
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, "UTF-8"); }
|
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, "UTF-8"); }
|
||||||
}
|
}
|
||||||
$siteHeaderTitle = 'Multiple Voices Log';
|
$headerTitles = require __DIR__ . '/header_titles.php';
|
||||||
$brandUrl = '404.php';
|
$siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
||||||
|
$messages = [
|
||||||
|
[
|
||||||
|
'title' => '404 - Unreliable',
|
||||||
|
'body1' => "You shouldn't rely on an unreliable narrator.",
|
||||||
|
'body2' => 'Yet here we are.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - Not Found',
|
||||||
|
'body1' => 'The narrator said this page exists.',
|
||||||
|
'body2' => "You really shouldn't trust him by now.",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - Page Missing',
|
||||||
|
'body1' => "If you've followed directions from the narrator,",
|
||||||
|
'body2' => 'this outcome should not surprise you.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - Lost',
|
||||||
|
'body1' => 'The narrator got us lost.',
|
||||||
|
'body2' => 'Again.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - Wrong Turn',
|
||||||
|
'body1' => 'You trusted the narrator.',
|
||||||
|
'body2' => 'That was your first mistake.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - Questionable Route',
|
||||||
|
'body1' => 'The route looked questionable.',
|
||||||
|
'body2' => 'The narrator called it an adventure.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - ',
|
||||||
|
'body1' => 'The narrator writes a travel blog.',
|
||||||
|
'body2' => 'Not a navigation manual.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => '404 - Lost again',
|
||||||
|
'body1' => 'The narrator got lost.',
|
||||||
|
'body2' => 'You chose to follow him.',
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'title' => '404 - Not confident',
|
||||||
|
'body1' => 'The narrator made a confident prediction.',
|
||||||
|
'body2' => 'That should have been your warning.',
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'title' => '404 - Unbelievable',
|
||||||
|
'body1' => 'You believed the narrator.',
|
||||||
|
'body2' => 'That is adorable.',
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
$siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
||||||
|
$brandUrl = 'https://bubulescu.org/';
|
||||||
|
$message = $messages[array_rand($messages)];
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
|
@ -12,8 +71,9 @@ http_response_code(404);
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<title>404 — MVLog</title>
|
<title>MVLog - 404</title>
|
||||||
<meta name="robots" content="noindex,nofollow">
|
<meta name="robots" content="noindex,nofollow">
|
||||||
|
<link rel="icon" type="image/png" href="assets/img/moto_travel.png">
|
||||||
<link rel="stylesheet" href="style.css?v=20260531u">
|
<link rel="stylesheet" href="style.css?v=20260531u">
|
||||||
<style>
|
<style>
|
||||||
.not-found-card{
|
.not-found-card{
|
||||||
|
|
@ -41,9 +101,10 @@ http_response_code(404);
|
||||||
<?php include __DIR__ . '/_header.php'; ?>
|
<?php include __DIR__ . '/_header.php'; ?>
|
||||||
<main>
|
<main>
|
||||||
<section class="not-found-card" aria-labelledby="not-found-title">
|
<section class="not-found-card" aria-labelledby="not-found-title">
|
||||||
<h2 id="not-found-title">404 — Not found</h2>
|
<h2 id="not-found-title"><?=h($message['title'])?></h2>
|
||||||
<p>The narrator claimed he knew where he was going.</p>
|
<p><?=h($message['body1'])?></p>
|
||||||
<p>The narrator is unreliable.</p>
|
<p><?=h($message['body2'])?></p>
|
||||||
|
<p>Journal of an unreliable narrator.</p>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<?php include __DIR__ . '/_footer.php'; ?>
|
<?php include __DIR__ . '/_footer.php'; ?>
|
||||||
|
|
|
||||||
40
header_titles.php
Normal file
40
header_titles.php
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
return [
|
||||||
|
'Multiple Voices Log',
|
||||||
|
'MultiVerse Log',
|
||||||
|
'Miles & Views Log',
|
||||||
|
'Moving Vistas Log',
|
||||||
|
'Motorcycle Voyage Log',
|
||||||
|
'Mapped Vagabond Log',
|
||||||
|
'Mountain Valley Log',
|
||||||
|
'Miles Versus Logic',
|
||||||
|
'Motorcycle Voyage Log',
|
||||||
|
'Multiple Viewpoints Log',
|
||||||
|
'Multiple Versions of Life',
|
||||||
|
'Motion, Velocity & Luck',
|
||||||
|
'Miles, Views & Life',
|
||||||
|
'Many Voices of Life',
|
||||||
|
'Motion, Velocity & Lunacy',
|
||||||
|
'Maps, Villages & Legends',
|
||||||
|
'Multi-Vision Log',
|
||||||
|
'Mutable View Log',
|
||||||
|
'Mistakes, Victories & Lessons',
|
||||||
|
'Mostly Verified Legends',
|
||||||
|
'Mostly Vague Logistics',
|
||||||
|
'Marginally Viable Leadership',
|
||||||
|
'Mileage Versus Luck',
|
||||||
|
'Mechanical Violence Log',
|
||||||
|
'Moderately Violent Leisure',
|
||||||
|
'Mistakes Validated Later',
|
||||||
|
'Maybe Very Lost',
|
||||||
|
'Miles, Views & Lunch',
|
||||||
|
'Maps, Villages & Lager',
|
||||||
|
'Missing Various Lefts',
|
||||||
|
'Mistakes, Views & Luck',
|
||||||
|
'Many Very Longroads',
|
||||||
|
'Mileage Varies Largely',
|
||||||
|
'Motorcycling Via Luck',
|
||||||
|
'Motorcycle Victim Lifestyle',
|
||||||
|
'Mildly Violating Limits',
|
||||||
|
'My Vices Last',
|
||||||
|
];
|
||||||
40
index.php
40
index.php
|
|
@ -319,45 +319,7 @@ if ($articleId !== '') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$headerTitles = [
|
$headerTitles = require __DIR__ . '/header_titles.php';
|
||||||
'Multiple Voices Log',
|
|
||||||
'MultiVerse Log',
|
|
||||||
'Miles & Views Log',
|
|
||||||
'Moving Vistas Log',
|
|
||||||
'Motorcycle Voyage Log',
|
|
||||||
'Mapped Vagabond Log',
|
|
||||||
'Mountain Valley Log',
|
|
||||||
'Miles Versus Logic',
|
|
||||||
'Motorcycle Voyage Log',
|
|
||||||
'Multiple Viewpoints Log',
|
|
||||||
'Multiple Versions of Life',
|
|
||||||
'Motion, Velocity & Luck',
|
|
||||||
'Miles, Views & Life',
|
|
||||||
'Many Voices of Life',
|
|
||||||
'Motion, Velocity & Lunacy',
|
|
||||||
'Maps, Villages & Legends',
|
|
||||||
'Multi-Vision Log',
|
|
||||||
'Mutable View Log',
|
|
||||||
'Mistakes, Victories & Lessons',
|
|
||||||
'Mostly Verified Legends',
|
|
||||||
'Mostly Vague Logistics',
|
|
||||||
'Marginally Viable Leadership',
|
|
||||||
'Mileage Versus Luck',
|
|
||||||
'Mechanical Violence Log',
|
|
||||||
'Moderately Violent Leisure',
|
|
||||||
'Mistakes Validated Later',
|
|
||||||
'Maybe Very Lost',
|
|
||||||
'Miles, Views & Lunch',
|
|
||||||
'Maps, Villages & Lager',
|
|
||||||
'Missing Various Lefts',
|
|
||||||
'Mistakes, Views & Luck',
|
|
||||||
'Many Very Longroads',
|
|
||||||
'Mileage Varies Largely',
|
|
||||||
'Motorcycling Via Luck',
|
|
||||||
'Motorcycle Victim Lifestyle',
|
|
||||||
'Mildly Violating Limits',
|
|
||||||
'My Vices Last',
|
|
||||||
];
|
|
||||||
$siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
$siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
||||||
$brandUrl = '?id=' . rawurlencode($articleId);
|
$brandUrl = '?id=' . rawurlencode($articleId);
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue