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 #165014 is a reply to message #165013] Sat, 16 April 2011 18:49 Go to previous messageGo to previous message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma:
Senior Member
I was afraid you'll say that.

The ob_x functions cannot be in the plugin as they are used to capture the html output into a variable that will be passed to the plugin by the POST_PROCESS hook. This is because the html is output directly in each of the several .php files in the templates.

Avoiding the functions would mean going into every tmpl file and editing them so that the html is written to a variable which can then be processed as required.

For example, this piece

{SECTION: rate_thread rate thread select}
<form id="RateFrm" action="post">
<select class="SmallText" onchange="if (this.value) topicVote(this.value, {VAR: frm->id}, \'{DEF: s}\', \'{VAR: usr->sq}\');">
<option>{MSG: rate_thread}</option>
<option value="1">1 {MSG: rate_worst}</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5 {MSG: rate_best}</option>
</select>
</form>
{SECTION: END}

would have to be changed to...

{SECTION: rate_thread rate thread select}
<?php 
$htmlData .= "<form id="RateFrm" action="post">\n";
$htmlData .= "<select class="SmallText" onchange="if (this.value) topicVote(this.value, {VAR: frm->id}, \'{DEF: s}\', \'{VAR: usr->sq}\');">\n";
$htmlData .= "<option>{MSG: rate_thread}</option>\n";
$htmlData .= "<option value="1">1 {MSG: rate_worst}</option>\n";
$htmlData .= "<option value="2">2</option>\n";
$htmlData .= "<option value="3">3</option>\n";
$htmlData .= "<option value="4">4</option>\n";
$htmlData .= "<option value="5">5 {MSG: rate_best}</option>\n";
$htmlData .= "</select>\n";
$htmlData .= "</form>\n";
?>
{SECTION: END}


Then, all the quote marks would have to be properly escaped and those with existing "php echo" strings changed etc etc etc.

Possible but a PITA to do when the same effect can be reached in other ways.

Possible draw back of the ob_x is this call earlier in index.php

if ($FUD_OPT_2 & 16384 && $t != 'getfile') {
	ob_start(array('ob_gzhandler', (int)$PHP_COMPRESSION_LEVEL));
}


Which looks like applying gzip which is something that should be left to the web server IMO.

Not sure what the conditions stand for though so not fully up to speed on that particular snippet.
[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: Wed Nov 27 19:53:25 GMT 2024

Total time taken to generate the page: 0.04842 seconds