summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsther Brunner <esther@kaffeehaus.ch>2005-08-30 21:47:01 +0200
committerEsther Brunner <esther@kaffeehaus.ch>2005-08-30 21:47:01 +0200
commita15ce62dba2e46a5754ac7f4c603661dd98a429a (patch)
tree9c33205ceb8e9fb1c8f6f4c7b82adf09d6af51bb
parent89541d4b7dc947af15bd1e26777c11be11931e50 (diff)
downloadrpg-a15ce62dba2e46a5754ac7f4c603661dd98a429a.tar.gz
rpg-a15ce62dba2e46a5754ac7f4c603661dd98a429a.tar.bz2
Replacement Patterns for pageTemplate()
darcs-hash:20050830194701-283c4-cee46936501b270fc8e5def2ea53ee7dbe13b7ef.gz
-rw-r--r--inc/common.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php
index 24a8a1889..99fa381bc 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -504,7 +504,17 @@ function rawWiki($id,$rev=''){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function pageTemplate($id){
- return io_readFile(dirname(wikiFN($id)).'/_template.txt');
+ global $conf;
+ global $INFO;
+ $tpl = io_readFile(dirname(wikiFN($id)).'/_template.txt');
+ $tpl = str_replace('@ID@',$id,$tpl);
+ $tpl = str_replace('@NS@',getNS($id),$tpl);
+ $tpl = str_replace('@PAGE@',strtr(noNS($id),'_',' '),$tpl);
+ $tpl = str_replace('@USER@',$_SERVER['REMOTE_USER'],$tpl);
+ $tpl = str_replace('@NAME@',$INFO['userinfo']['name'],$tpl);
+ $tpl = str_replace('@MAIL@',$INFO['userinfo']['mail'],$tpl);
+ $tpl = str_replace('@DATE@',date($conf['dformat']),$tpl);
+ return $tpl;
}