FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Fudla! Plugin Core Code Changes (Requirements for FUD 3.0.2 <-> Joomla integration)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Fudla! Plugin Core Code Changes [message #165018 is a reply to message #165017] Sun, 17 April 2011 05:16 Go to previous messageGo to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma:
Senior Member
Administrator
Core Developer
Patch to introduce PRE_TEMPLATE and POST_TEMPLATE hooks:
http://fudforum.svn.sourceforge.net/fudforum/?rev=5207&view=rev

Here is a sample plugin (file: x.plugin) to capture and process output:
<?php
plugin_add_hook('PRE_TEMPLATE',  'plugin_x_capture_output');
plugin_add_hook('POST_TEMPLATE', 'plugin_x_process_output');

function plugin_x_capture_output($t) {
	ob_start();
	return $t;
}

function plugin_x_process_output() {
	$template_output = ob_get_contents();
	ob_end_clean();
        // Modify output, add headers, footers, go mad...
	echo $template_output;
}
?>


Edit: Changed PRE_THEME to PRE_TEMPLATE and POST_THEME to POST_TEMPLATE as per http://sourceforge.net/apps/trac/fudforum/changeset/5208
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Tips for higher iPhone/Andriod/Pre compatibility
Next Topic: Help Needed - fud_user_reg class
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 09:23:09 GMT 2024

Total time taken to generate the page: 0.07002 seconds