2014-09-24 16:41:23 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include "inc/functions.php";
|
2014-09-25 15:40:43 -07:00
|
|
|
include "inc/cache.php";
|
2014-09-24 16:41:23 -07:00
|
|
|
|
2014-09-24 17:02:40 -07:00
|
|
|
if(!file_exists("404/"))
|
|
|
|
mkdir("404/");
|
2014-09-24 16:41:23 -07:00
|
|
|
|
2014-09-25 15:40:43 -07:00
|
|
|
$cache = new Cache;
|
|
|
|
$cache->init();
|
|
|
|
|
|
|
|
if($cache->get("404glob") == false){
|
2014-09-24 17:02:40 -07:00
|
|
|
$files = glob("404/*.*");
|
2014-09-25 15:40:43 -07:00
|
|
|
$cache->set("404glob", $files);
|
|
|
|
}else
|
|
|
|
$files = $cache->get("404glob");
|
2014-09-24 17:02:40 -07:00
|
|
|
|
|
|
|
if(count($files) == 0)
|
|
|
|
$errorimage = "";
|
|
|
|
else
|
|
|
|
$errorimage = $files[array_rand($files)];
|
2014-09-24 16:41:23 -07:00
|
|
|
|
|
|
|
$page = <<<EOT
|
2014-09-24 17:02:40 -07:00
|
|
|
<center>
|
|
|
|
<div class="ban">
|
|
|
|
<h2>404 Not Found</h2>
|
|
|
|
|
|
|
|
<img src="{$errorimage}" style="width: 700px;">
|
|
|
|
</div>
|
|
|
|
</center>
|
2014-09-24 16:41:23 -07:00
|
|
|
EOT;
|
|
|
|
|
|
|
|
echo Element("page.html", array("config" => $config, "body" => $page, "title" => ""));
|