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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
GLOBALS.php and integration: suggested patch [message #166583] Mon, 23 January 2012 21: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
add to buddy list
ignore all messages by this user
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 02: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 00:02 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3631
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 08: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
add to buddy list
ignore all messages by this user
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 02: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
add to buddy list
ignore all messages by this user
Updated patch, will work on upgrade.php now
  • Attachment: glob.diff
    (Size: 1.08KB, Downloaded 422 times)

[Updated on: Wed, 01 February 2012 02: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 03: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
add to buddy list
ignore all messages by this user
Patched upgrade.php as well, couldn't test it (but I tested the preg_replace).

  • Attachment: upgrade.diff
    (Size: 0.77KB, Downloaded 394 times)
Re: GLOBALS.php and integration: suggested patch [message #166789 is a reply to message #166631] Thu, 23 February 2012 17: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
add to buddy list
ignore all messages by this user
The suggested changes have been tested and committed with revision number 5428.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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 12 05:24:49 EST 2017

Total time taken to generate the page: 0.00784 seconds