1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-17 19:29:28 +01:00
vichan/404.php

34 lines
606 B
PHP
Raw Normal View History

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
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){
$files = glob("404/*.*");
2014-09-25 15:40:43 -07:00
$cache->set("404glob", $files);
}else
$files = $cache->get("404glob");
if(count($files) == 0)
$errorimage = "";
else
$errorimage = $files[array_rand($files)];
2014-09-24 16:41:23 -07:00
$page = <<<EOT
<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" => ""));