If I were you I wouldn't hack the source directly. The cleanest and most flexible way to do that would be an action plugin [1] which hooks into the TPL_ACT_RENDER event [2]. The idea would be to check in the function hooked to the event if a) the action is "show" and b) the page doesn't exist yet and then just output your stuff. Output buffering is active during this event, so you can just use simple print statements to get your stuff shown.
You can be as site specific as you like.
Save the following in <dokuwiki>lib/plugins/test/action.php
<?php
/**
* Example Action Plugin
*/
if(!defined('DOKU_INC')) die();
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'action.php');
class action_plugin_test extends DokuWiki_Action_Plugin {
/**
* return some info
*/
function getInfo(){
return array(
'author' => 'Me name',
'email' => 'myname@example.org',
'date' => '2006-12-17',
'name' => 'Example (action plugin component)',
'desc' => 'Example action functions.',
'url' => 'http://www.example.org',
);
}
/**
* Register its handlers with the dokuwiki's event controller
*/
function register(&$controller) {
$controller->register_hook('TPL_ACT_RENDER', 'AFTER', $this, 'output');
}
/**
* Generate output
*/
function output(&$event, $param) {
global $ID;
if($event->data != 'show') return; // nothing to do
if(!page_exists($ID)) {
// output stuff here
print "Hello World";
}
}
}
Hope that helps.
[1]
http://dokuwiki.org/devel:action_plugins
[2]
http://dokuwiki.org/devel:events_list#TPL_ACT_RENDER