xoops forums

rossb

Just popping in
Posted on: 1/2 16:24
rossb
rossb (Show more)
Just popping in
Posts: 24
Since: 2006/8/28
#1

USAGE: register_postfilter

Hi;

Having difficulty understanding how to use the smarty register_postfilter function with xoops-2.5.8, based on this post:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=72081

Correct me if I am wrong, but, I think this goes into index.php, just after "include $GLOBALS['xoops']->path('header.php');"

function add_header_comment($tpl_source, &$smarty)     {         
return "<?php echo "<!-- Created by Smarty! -->n"?>n" . $tpl_source; 
  } 

$xoTheme->register_postfilter("add_header_comment");


I am nor even sure whether this function still applies and is usable for xoops-2.5.8, nor whether index.php is where it should reside.

Thanks;
Bill

rossb

Just popping in
Posted on: 1/2 17:51
rossb
rossb (Show more)
Just popping in
Posts: 24
Since: 2006/8/28
#2

Re: USAGE: register_postfilter

Solved;

Problems twofold:

changed location from $ROOT/index.php to modules/publisher/index.php, since it is publisher O/P I want to postfilter (add pupup definitions)

cut and past problems \n became n in the code:

return "<?php echo "<!-- Created by Smarty! -->\n"; ?>\n" . $tpl_source;

now, it works. Such a noob:)