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

Merge pull request #49 from anonfagola/patch-5

Made a 404 page
This commit is contained in:
Fredrick Brennan 2014-09-27 21:34:18 -04:00
commit 700f24f179

33
404.php Normal file
View File

@ -0,0 +1,33 @@
<?php
include "inc/functions.php";
include "inc/cache.php";
if(!file_exists("404/"))
mkdir("404/");
$cache = new Cache;
$cache->init();
if($cache->get("404glob") == false){
$files = glob("404/*.*");
$cache->set("404glob", $files);
}else
$files = $cache->get("404glob");
if(count($files) == 0)
$errorimage = "";
else
$errorimage = $files[array_rand($files)];
$page = <<<EOT
<center>
<div class="ban">
<h2>404 Not Found</h2>
<img src="{$errorimage}" style="width: 700px;">
</div>
</center>
EOT;
echo Element("page.html", array("config" => $config, "body" => $page, "title" => ""));