UseBB Community

The official board for UseBB help and discussion

UseBB Community » 1.0 Discussion » any special thing with functions?

any special thing with functions?

Page: 1

Author Post
Moderator
Registered: Oct 2005
Posts: 444
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: 2215
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.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Moderator
Registered: Oct 2005
Posts: 444
Location: canada
Oh right, i'm not thinking lately sorry Lol.

Page: 1

UseBB Community » 1.0 Discussion » any special thing with functions?

UseBB Community is powered by UseBB 1 Forum Software