From b2f4249e2e8f426f00983e7cb13a557e58acac48 Mon Sep 17 00:00:00 2001 From: hbrain Date: Thu, 4 Jun 2026 08:48:25 +0200 Subject: [PATCH] Titles randomization --- 404.php | 73 +++++++++++++++++++++++++++++++++++++++++++---- header_titles.php | 40 ++++++++++++++++++++++++++ index.php | 40 +------------------------- 3 files changed, 108 insertions(+), 45 deletions(-) create mode 100644 header_titles.php diff --git a/404.php b/404.php index a33a2e7..8e74953 100644 --- a/404.php +++ b/404.php @@ -3,8 +3,67 @@ date_default_timezone_set('Europe/Copenhagen'); if (!function_exists('h')) { function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, "UTF-8"); } } -$siteHeaderTitle = 'Multiple Voices Log'; -$brandUrl = '404.php'; +$headerTitles = require __DIR__ . '/header_titles.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); ?> @@ -12,8 +71,9 @@ http_response_code(404); -404 — MVLog +MVLog - 404 +