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

Home » FUDforum Development » Bug Reports » Fud API Error
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Fud API Error [message #160178 is a reply to message #159820] Fri, 31 July 2009 09:40 Go to previous messageGo to previous message
mazestar is currently offline  mazestar   Hong Kong
Messages: 2
Registered: July 2009
Karma:
Junior Member
Hi all,

I had the same problem too.

After my investigation, the main reason of this bug should be the php $GLOBALS variable is unaccessible within core.inc which included by GLOBALS.php. when fudapi.inc.php run fud_use function, because the $GLOBALS is not created yet, so it throw exception.

On the other hand, the funny thing is forum_login.php works perfectly! Then I knew that there must be different GLOBALS handling between forum_login.php and fudapi.inc.php, and found that forum_login.php uses __fud_login_common function to create $GLOBALS...

Lastly, my final solution is:

protected function myAddUser()
{
    $Root = realpath($_SERVER["DOCUMENT_ROOT"]);
    include_once $Root.'/forum_data/include/GLOBALS.php';
    include_once $Root.'/forum_data/scripts/forum_login.php';
    __fud_login_common(1); // The main point!!
    include_once $Root.'/forum_data/scripts/fudapi.inc.php';

    //use function within fudapi
    fud_add_user($arg, &err);
    .....
}


wasted a whole day to get the solution.... Embarassed
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: nntp charset problems
Next Topic: After login, front page links don't work
Goto Forum:
  

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

Current Time: Mon Nov 25 01:55:17 GMT 2024

Total time taken to generate the page: 0.04784 seconds