MyBB Community Forums

Full Version: Plugin Creation Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey everyone this is my first plugin and I made it to help a friend.

The plugin is supposed to install a template, and 5 settings in a setting group. but it wont install any of those. HELP I attached the files. please don't steal it. The plugin is to let users add groups and it will make them the group leader.
Add a rebuild_settings(); at the end of your install function;
The rest looks normal to me :/
tried it and no luck.
Before I even offer to help with this, is that a modded groups.php included in your zip? If so, why if I may ask?
You shouldn't need to mod the groups.php at all if you properly use the plugin hooks. Unless there isn't a hook that lets you manipulate the data you need to manipulate. In which case you can either custom the file with new hooks (the only way I'm willing to customize the stock MyBB files, since there is no other reason to), or write completely custom routines to process your data and "replace" the data using existing hooks. Let me know.
currently i'm not aware of any other groups.php file that the member group can access....if there is i would LOVE to know about it. I was just making a mod for my friend that will let members create their own groups for social reasons. All of the hooks MyBB has relating to groups are for joining/leaving, and admin adding/managing.

The problem is that the plugin wont install the settings and the template. I had built what I wanted the modification to do and with everything worked but when I tried to compile it into the plugin i had this difficulty
I was just asking why you included it in the zip if its not modded. Or if it is modded Wink
it is modded....its a custom page that i made for the plugin
You need to have a _is_installed function if you are using an install function. Without the _is_installed function mybb assumes your plugin is installed and you won't get the option to install it, hence settings and templates are never added.

Something like this should work:

function group_is_installed()
{
	global $db;
	
	$query = $db->simple_select("settinggroups", "name", "name='group'", array('limit' => 1));
	$group = $db->fetch_field($query, "name");
	if($group)
	{
		return true;
	}
	return false;

}
G33K THANK YOU. That fixed it. Smile
Awesome. Glad you got it fixed. I guess that means I can scratch it off my list of things too look at lol!
Pages: 1 2