From 0fee74014787d314a28537d8a096ec35afea9df0 Mon Sep 17 00:00:00 2001 From: anonfagola Date: Wed, 24 Sep 2014 17:02:40 -0700 Subject: [PATCH] Update 404.php Made it loop through directory --- 404.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/404.php b/404.php index a9705911..91663296 100644 --- a/404.php +++ b/404.php @@ -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 = << -

404 Not Found

- - - +
+
+

404 Not Found

+ + +
+
EOT; echo Element("page.html", array("config" => $config, "body" => $page, "title" => ""));