Hi!
Wouldn't it be possible to implement some code into core, that includes a 404.php or something like this from template-folder into content, if html-status is 404?
No, ther core's not a good place for this.
A simple event plugin would look like this:
Code: Select all
<?php
class serendipity_event_404hook extends serendipity_event {
function introspect(&$propbag) {
global $serendipity;
$propbag->add('name', '404 hook');
$propbag->add('description', '');
$propbag->add('requirements', array('serendipity' => '1.5', 'smarty' => '2.6.7', 'php' => '4.1.0'));
$propbag->add('version', '0.1');
$propbag->add('author', 'Garvin Hicking');
$propbag->add('event_hooks', array('entries_header' => true));
}
function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity;
if ($event == 'entries_header' && preg_match('@/pages/error.html@i', $_SERVER['REQUEST_URI'])) {
serendipity_header('HTTP/1.0 404');
serendipity_header('Status: 404 Not Found');
}
return true;
}
}
That's not too hard, right?