1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 17:31:00 +01:00

Update 404.php

Made it loop through directory
This commit is contained in:
anonfagola 2014-09-24 17:02:40 -07:00
parent ca0e7ffc5d
commit 0fee740147

21
404.php
View File

@ -2,17 +2,24 @@
include "inc/functions.php";
$errorimages = array("http://www.submitawebsite.com/blog/wp-content/uploads/2010/06/404.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Georgia_404.svg/750px-Georgia_404.svg.png");
if(!file_exists("404/"))
mkdir("404/");
$errorimage = $errorimages[array_rand($errorimages)];
$files = glob("404/*.*");
if(count($files) == 0)
$errorimage = "";
else
$errorimage = $files[array_rand($files)];
$page = <<<EOT
<div class="ban">
<h2 style="text-align: center">404 Not Found</h2>
<center>
<div class="ban">
<h2>404 Not Found</h2>
<img src="{$errorimage}" style="width: 700px;">
</div>
<img src="{$errorimage}" style="width: 700px;">
</div>
</center>
EOT;
echo Element("page.html", array("config" => $config, "body" => $page, "title" => ""));