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

Home » FUDforum Development » Plugins and Code Hacks » GLOBALS.php and integration: suggested patch
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
GLOBALS.php and integration: suggested patch [message #166583] Tue, 24 January 2012 02:52 Go to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Hello,
I recently made the switch from PhpBB3 to FUDforum (bless an API that one can actually call that). Unfortunately I had a problem with integration that has already been brought up (fud_use() undefined and all that nonsense), but I think there is an easy solution to everyone's problems.

I patched glob.inc so that the change_global_settings() function looks for variables defined as $GLOBALS['var_name'] instead of just $var_name. The reason behind this is that including GLOBALS.php from a class (as required by integration with CodeIgniter) does not work properly as the variables are not explicitly declared as global.

I hope this helps

P.S. I just realized this is not the right forum, and I should have posted under the "Plugins and code hacks" one. Sorry.

EDIT: Corrected a sentence

[Updated on: Wed, 25 January 2012 07:46]

Report message to a moderator

Re: GLOBALS.php and integration: suggested patch [message #166611 is a reply to message #166583] Sat, 28 January 2012 05:02 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
The patch looks good, but needs some work:

1. We also need to fix this line in change_global_settings (to add the $GLOBALS bit):
$p = strpos($settings, 'ADMIN_EMAIL');

2. We need some code in upgrade.php to change all setting to the new format.

Let me know if you need SVN commit access.

PS: The Lightbox plugin makes it almost impossible to download ZIP files! We will have to sort it out as well...
Re: GLOBALS.php and integration: suggested patch [message #166614 is a reply to message #166611] Sat, 28 January 2012 13:40 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
I'll try to improve the patch with the required changes, but I am having other problems with which to scratch my head on.
Re: GLOBALS.php and integration: suggested patch [message #166630 is a reply to message #166611] Wed, 01 February 2012 07:10 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Updated patch, will work on upgrade.php now
  • Attachment: glob.diff
    (Size: 1.08KB, Downloaded 1095 times)

[Updated on: Wed, 01 February 2012 07:12]

Report message to a moderator

Re: GLOBALS.php and integration: suggested patch [message #166631 is a reply to message #166630] Wed, 01 February 2012 08:07 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Patched upgrade.php as well, couldn't test it (but I tested the preg_replace).

  • Attachment: upgrade.diff
    (Size: 0.77KB, Downloaded 1063 times)
Re: GLOBALS.php and integration: suggested patch [message #166789 is a reply to message #166631] Thu, 23 February 2012 22:16 Go to previous message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
The suggested changes have been tested and committed with revision number 5428.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fud_update_user, fud_add_user patch
Next Topic: Quote depth limiter - mod or plugin
Goto Forum:
  

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

Current Time: Tue Dec 03 18:09:32 GMT 2024

Total time taken to generate the page: 0.05672 seconds