register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'handle_start', array()); } function handle_start(&$event, $param){ global $ID; global $ACT; global $INFO; if ($ACT != 'show') return; if (!($INFO['exists'])) return; # don't try to read an article that doesn't exist $text = rawWiki($ID); if(preg_match('/^([=]+[^=]+[=]+[\n]?)?\[\[([^]#]*)\#?([^]]*)\]\]$/',$text,$p)) { msg(sprintf('From: '.tpl_pagetitle($ID, true).'')); $check = false; # dummy variable for sectionID $url = ($p[3] == '') ? wl($p[2]) : wl($p[2]) . '#' . sectionID($p[3], $check); idx_addPage($ID); # seemingly required for fulltext search indexing of the page, without which we won't show up on the$ send_redirect($url); } } } ?>