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

Home » FUDforum Development » FUDforum 3.0+ » GLOBALS.php "cleanup"
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: GLOBALS.php "cleanup" [message #6841 is a reply to message #6759] Fri, 25 October 2002 16:37 Go to previous messageGo to previous message
holstein   Canada
Messages: 9
Registered: August 2002
Location: Montreal
Karma:
Junior Member
With my changes, all the variables declared in GLOBALS.php are effectively changed with the format I described. That way, they are explicitely added to the GLOBALS scope.

Everything is still working right with this change : all the globals are indeed called in the $GLOBALS array. From what I understand (I know way more in Perl than in PHP, so maybe I don't clearly understand peculiarity about the PHP scopes and al.), my changes are not changing anything, but it makes my code work...

What I'm doing to make Fud setup his user cookie at the same time of my cookies is this :

- - - - - - 8<- - - - -
/* set my cookies. I wont bother your with that.. ;o) /*

require_once $_SERVER['DOCUMENT_ROOT'] . '/forum/GLOBALS.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/forum/forum_data/include/theme/lpa/db.inc';
require_once $_SERVER['DOCUMENT_ROOT'] . '/forum/forum_data/include/theme/lpa/cookies.inc';

$fsess = new fud_session;
$fud_uid = $this->dbh->getOne("SELECT id FROM fud_users WHERE login = " . $this->dbh->quote($this->info['username']));
set_referer_cookie($fud_uid);
$fsess->cookie_set_session($fsess->save_session($fud_uid));

- - - - - - 8<- - - - -


As you see, I include what I need to be able to build a fud_session object and call it's cookie_set_session method.
If I leave GLOBALS.php the way it is by default, this won't work because the DBHOST_* globals are not, for a reason I confess I don't clearly understand, recognized by the fud_session object. If I apply my changes and declare all the variable in GLOBALS.php directly in the $GLOBALS array/namespace, everything work. And the forum still work right.

Am I missing something, and my forum is going to explode somewhere I have'nt figure?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Avatar restriction?
Next Topic: install.php/upgrade.php build scripts?
Goto Forum:
  

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

Current Time: Mon Nov 25 23:48:59 GMT 2024

Total time taken to generate the page: 0.03797 seconds