MyBB Community Forums

Full Version: I want to start making mods already, but...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to know somethings:
1. Does MyBB has an already defined variable or function that gets the id of the logged in user? I need it.

2. The banned power level (if its 0 or -1 etc..).

3.What files do I need to call so the mod gets the sql info, table colors etc...?

Any help would be apreciated. Smile
Moved to Code Mods.

1) $mybb->user is an array of the current user's info. You can access the uid like so $mybb->user['uid'].

2) Not sure I understand.

3) You need to use $db->.... I recommend you study other plugins for a general how-to. You can also read the wiki [Wiki: Database_Constants] (Broken link, head over to docs.mybb.com instead) and [Wiki: Authoring_Plugins] (Broken link, head over to docs.mybb.com instead)


Good luck! Smile
#2) Do you mean the usergroup for banned people, or the permissions of them?
You might want to look through the MyBB code to see how things are done. You can take a look at inc/class_core.php, inc/class_session.php, inc/init.php, and global.php to see what variables are initialized on each page load. If you're looking to see how bans are handled for example, you can take a look at admin/users.php (where bans are set), and global.php (where the user is notified of the ban). Another example, if you want to see how replies are created, you could look at newreply.php Smile