Login Register


Making your first plugin. filter_list
Author
Message
Making your first plugin. #1
This a basic guide to making your first plugin for mybb.
Here is some things you will need to know:
- Basic PHP Knowledge
- Basic MyBB Knowledge
Also, don't be afraid to ask for help on the Mybb Community Forums (You will need to turn your vpn or tor off to go on it)
First open up a new PHP file and put this:
Code:
<?php // Disallow direct access to this file for security reasons if(!defined("IN_MYBB")) { die("Direct initialization of this file is not allowed."); } function myplugin_info() { return array( "name" => "", "description" => "", "website" => "", "author" => "", "authorsite" => "", "version" => "1.0", "guid" => "", "compatibility" => "*" ); } function myplugin_install() { } function myplugin_is_installed() { } function myplugin_uninstall() { } function myplugin_activate() { } function myplugin_deactivate() { }

Fill out the array with your info.


name: The name of the plugin
description: Description of what the plugin does
website: The website the plugin is maintained at (Optional)
author: The name of the author of the plugin
authorsite: The URL to the website of the author (Optional)
version: The version number of the plugin
guid: Unique ID issued by the MyBB Mods site for version checking
compatibility: A CSV list of MyBB versions supported. Ex, "121,123", "12*". Wildcards supported.




Then, you will need to add hooks.

Hooks are basically what you add to the plugin to tell where your functions and shit actually go to.

Here is a list of all hooks: http://docs.mybb.com/1.8/development/plugins/hooks/

In the hook you basically put your function and then the hook itsself.


Thanks for reading my tut Smile
(This post was last modified: 03-08-2015, 07:41 AM by Anurag M.)
Whoop Whoop?

Reply







Users browsing this thread: 1 Guest(s)