MyBB Community Forums

Full Version: Adding new page to modcp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to add a new page to Moderator control panel but I have found nothing about doing it. So how can i add new page to modcp and add link to that page to menu bar?
(2009-10-24, 02:20 PM)MattRogowski Wrote: [ -> ]http://www.learnmybb.com/forums/Thread-H...-new-pages

Then add...

if($mybb->usergroup['canmodcp'] != 1)
{
	error_no_permission();
}

... before the eval line.

Thats how you can add new pages for mods only.

For adding the links to those pages in the ModCP menu bar, you will have to do some template and CSS editing. I could tell you if you would like me to.
Um.. Not exactly what I expected. If i want to add new page to admin cp, i use something like this:
$plugins->add_hook("admin_user_menu", "clanlogo_nav");
$plugins->add_hook("admin_user_action_handler", "clanlogo_action_handler");
..
function clanlogo_action_handler(&$action)
{
	$action['clanlogo'] = array('active' => 'clanlogo', 'file' => 'clanlogo.php');
}
function clanlogo_nav(&$sub_menu)
{
	global $mybb, $lang;
	end($sub_menu);
	$key = (key($sub_menu))+10;

	if(!$key)
	{
		$key = '50';
	}
	$sub_menu[$key] = array('id' => 'clanlogo', 'title' => "Manage clanlogos", 'link' => "index.php?module=user/clanlogo");
}
And then clanlogo.php in forum/admin/modules/user/clanlogo.php
I thought mod cp has similar thing. Anyway thanks