From c291952477d27f618af03e38a334ef990a9f3dc9 Mon Sep 17 00:00:00 2001 From: anonfagola Date: Wed, 24 Sep 2014 16:41:23 -0700 Subject: [PATCH 1/4] Create 404.php --- 404.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 404.php diff --git a/404.php b/404.php new file mode 100644 index 00000000..2b32338e --- /dev/null +++ b/404.php @@ -0,0 +1,20 @@ + +
+

404 Not Found

+ + +
+ +EOT; + +echo Element("page.html", array("config" => $config, "body" => $page, "title" => "")); From ca0e7ffc5d270cf46c83dc3c74427da183fe5b54 Mon Sep 17 00:00:00 2001 From: anonfagola Date: Wed, 24 Sep 2014 16:52:23 -0700 Subject: [PATCH 2/4] Update 404.php --- 404.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/404.php b/404.php index 2b32338e..a9705911 100644 --- a/404.php +++ b/404.php @@ -8,13 +8,11 @@ $errorimages = array("http://www.submitawebsite.com/blog/wp-content/uploads/2010 $errorimage = $errorimages[array_rand($errorimages)]; $page = << -
-

404 Not Found

- - -
- +
+

404 Not Found

+ + +
EOT; echo Element("page.html", array("config" => $config, "body" => $page, "title" => "")); From 0fee74014787d314a28537d8a096ec35afea9df0 Mon Sep 17 00:00:00 2001 From: anonfagola Date: Wed, 24 Sep 2014 17:02:40 -0700 Subject: [PATCH 3/4] 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" => "")); From 0ea92d99f7105d3521eb568b7f1931b895920015 Mon Sep 17 00:00:00 2001 From: anonfagola Date: Thu, 25 Sep 2014 15:40:43 -0700 Subject: [PATCH 4/4] Update 404.php --- 404.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/404.php b/404.php index 91663296..364ae33a 100644 --- a/404.php +++ b/404.php @@ -1,11 +1,19 @@ init(); + +if($cache->get("404glob") == false){ $files = glob("404/*.*"); +$cache->set("404glob", $files); +}else +$files = $cache->get("404glob"); if(count($files) == 0) $errorimage = "";