UseBB Community

UseBB support, discussion and development

any special thing with functions?

Post Reply

Page: 1

Author Post
Moderator
Registered: Oct 2005
Posts: 502
Location: Canada
Hey,

I have an included file in the UseBB panel/profile. In this page i have a function...like function blah() { }, its at the bottom. I put code in there and then i call the function near the top of the page ( blah(); ). But i doesn't work.

I get Fatal error: Call to a member function on a non-object in /home/gaia/public_html/usebbzone/forums/sources/panel_files.php on line 187

But when i remove the function call and place just the code i had within the function into the place where i called the function, it works fine?
Developer
Registered: Apr 2004
Posts: 2230
Location: Belgium
You are probably using an object within the function. In order to use it you need to global the object, like
global $functions;

as the first statement in your function.
Moderator
Registered: Oct 2005
Posts: 502
Location: Canada
Oh right, i'm not thinking lately sorry Lol.

Post Reply

Page: 1

UseBB Community is powered by UseBB 1 Forum Software