MyBB Community Forums

Full Version: Storing data in a session
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm creating my third plugin, but I don't know how I'm able to update a session variable. I'm using $_SESSION and it doesn't want to work. Is there a function that doe what I'm wanting to do?

I'm also wanting to create a new page on the administration panel. Something like the new points plugin, which has its own tab and sub-menu.

Any help will be awesome. Thanks.
You have to first start the session using session_start() before you may use the $_SESSION variables.
(2012-02-08, 12:08 PM)Mr Josh Wrote: [ -> ]I'm creating my third plugin, but I don't know how I'm able to update a session variable. I'm using $_SESSION and it doesn't want to work. Is there a function that doe what I'm wanting to do?

There's session data inside the mybb class, which can be accessed through $mybb->session. Not sure if that's what you wanted.

(2012-02-08, 12:08 PM)Mr Josh Wrote: [ -> ]I'm also wanting to create a new page on the administration panel. Something like the new points plugin, which has its own tab and sub-menu.

You'll need to create a new folder under admin/modules, and add a file called module_meta.php.

Browse through some of the other module folders for examples of what you'll need to do to add your own sub-menu's.
The home module seems the most straight-forward and easy to read.