|
1
|
|
|
<? |
|
|
|
|
|
|
2
|
|
|
|
|
3
|
|
|
Loader::load('controller', '/PageController'); |
|
4
|
|
|
|
|
5
|
|
|
class Error404Controller extends PageController |
|
6
|
|
|
{ |
|
7
|
|
|
|
|
8
|
|
|
public function __construct() |
|
9
|
|
|
{ |
|
10
|
|
|
parent::__construct(); |
|
11
|
|
|
|
|
12
|
|
|
Visitor::update404Error(); |
|
13
|
|
|
} |
|
14
|
|
|
|
|
15
|
|
|
protected function set_head_data() |
|
16
|
|
|
{ |
|
17
|
|
|
$this->set_header_method('send404'); |
|
18
|
|
|
$this->add_css('normalize'); |
|
19
|
|
|
$this->add_css('404'); |
|
20
|
|
|
|
|
21
|
|
|
$this->set_title("Jacob Emerick's 404 Page"); |
|
22
|
|
|
$this->set_head('description', 'Global 404 page for sites under jacobemerick.com. Page not found!'); |
|
23
|
|
|
$this->set_head('keywords', ''); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
protected function set_body_data() |
|
27
|
|
|
{ |
|
28
|
|
|
$this->set_body('site_list', $this->get_sites()); |
|
29
|
|
|
|
|
30
|
|
|
$this->set_body_view('/404'); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
private function get_sites() |
|
34
|
|
|
{ |
|
35
|
|
|
return [ |
|
36
|
|
|
[ |
|
37
|
|
|
'url' => 'http://home.jacobemerick.com/', |
|
38
|
|
|
'title' => "Jacob Emerick's Home", |
|
39
|
|
|
'name' => 'Home' |
|
40
|
|
|
], |
|
41
|
|
|
[ |
|
42
|
|
|
'url' => 'http://blog.jacobemerick.com/', |
|
43
|
|
|
'title' => "Jacob Emerick's Blog", |
|
44
|
|
|
'name' => 'Blog' |
|
45
|
|
|
], |
|
46
|
|
|
[ |
|
47
|
|
|
'url' => 'http://lifestream.jacobemerick.com/', |
|
48
|
|
|
'title' => "Jacob Emerick's Lifestream", |
|
49
|
|
|
'name' => 'Lifestream' |
|
50
|
|
|
], |
|
51
|
|
|
[ |
|
52
|
|
|
'url' => 'http://map.jacobemerick.com/', |
|
53
|
|
|
'title' => "Jacob Emerick's Hiking Map", |
|
54
|
|
|
'name' => 'Map' |
|
55
|
|
|
], |
|
56
|
|
|
[ |
|
57
|
|
|
'url' => 'http://portfolio.jacobemerick.com/', |
|
58
|
|
|
'title' => "Jacob Emerick's Portfolio", |
|
59
|
|
|
'name' => 'Portfolio', |
|
60
|
|
|
], |
|
61
|
|
|
[ |
|
62
|
|
|
'url' => 'http://www.waterfallsofthekeweenaw.com/', |
|
63
|
|
|
'title' => 'Waterfalls of the Keweenaw', |
|
64
|
|
|
'name' => 'Waterfalls' |
|
65
|
|
|
] |
|
66
|
|
|
]; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
} |
|
70
|
|
|
|
Short opening tags are disabled in PHP’s default configuration. In such a case, all content of this file is output verbatim to the browser without being parsed, or executed.
As a precaution to avoid these problems better use the long opening tag
<?php.