Firefox PHP

modify final html code

Posted by bloodchecker 
modify final html code
August 31, 2011 10:24AM
Hello,

As a beginner in Phorum modules, I can't understand how to get final html code to alter it.

For example, after Phorum parsed the .tpl file, i would like, to replace the string "__MYSTRING__" by any "Hello World !". (The real idea is to call another parser from another CMS).

So I would like to know if there is any hook such as :

function xxxx($template)
{
return preg_replace("__MYSTRING__", "Hello World !", $template);
}

I can't find anything in the manual, but i may had miss something (i'am not that far good in english)
Re: modify final html code
August 31, 2011 08:31PM
If you need to run it on the full Phorum output, not only the message bodies, then you could use the "start_output" hook to do an ob_start(), after which you can do an "ob_get_clean()" in the "end_output" hook.

From there on, you can modify the output and finaly print it to send it to the browser.

Note that what you propose, would only modify the template code. __MYSTRING__ references in message bodies would not be replaced. My proposal from above would do so though.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login