register_hook('ACTION_ACT_PREPROCESS','BEFORE', $this, '_check404'); $controller->register_hook('TPL_CONTENT_DISPLAY','BEFORE', $this, '_show404'); } function _check404(Doku_Event $event , $param) { if($event->data != 'show') return false; global $INFO; if($INFO['exists']) return false; $event->data = 'notfound'; $event->stopPropagation(); $event->preventDefault(); return true; } function _show404(Doku_Event $event, $param) { global $ACT; if($ACT != 'notfound') return false; $event->stopPropagation(); $event->preventDefault(); global $ID; $oldid = $ID; $ID = $this->getConf('404page'); echo p_wiki_xhtml($ID,'',false); $ID = $oldid; $ACT='show'; return true; } }