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

Home » FUDforum Development » FUDforum 3.0+ » getting the GLOBALS needed for fudapi
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
getting the GLOBALS needed for fudapi [message #35513] Wed, 17 January 2007 14:40 Go to next message
maarten is currently offline  maarten   United States
Messages: 7
Registered: January 2007
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
I'm using fudforum_login.php and fudapi.inc.php in a context where I'm confined into function scope, so I'm relying on the technique in __fud_login_common() to read GLOBALS.php, eval it, and then export the ones that matter.

Catch is: the variables exported don't cover all the ones needed by fudapi.inc.php.

For example, when fud_add_user() copies $vals['login'] to the alias, it relies on $GLOBALS['MAX_LOGIN_SHOW'] and will fail if that's not set, and the alias field will stay blank.

I searched fudapi for uses of globals and added these to be exported:
'SERVER_TZ', 'MAX_LOGIN_SHOW', 'POSTS_PER_PAGE',
'WWW_ROOT', 'LOGEDIN_TIMEOUT', 'TMP'


There may be other ones in code called from fudapi? For easier future integration, it'd be great if there was a fool-proof way to get all globals exported correctly.

Simply including GLOBALS.php at the top of fudapi.inc.php won't work for me because fudapi.inc.php is being included inside a function and I have no control over that.
Re: getting the GLOBALS needed for fudapi [message #35520 is a reply to message #35513] Wed, 17 January 2007 19:05 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
The export list was expanded.

FUDforum Core Developer
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: fud_delete_user() produces SQL error?
Next Topic: show last ten topic
Goto Forum:
  

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

Current Time: Fri Dec 06 02:25:02 EST 2024

Total time taken to generate the page: 0.05076 seconds