MyBB Community Forums

Full Version: Adding Custom Options to UserCP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

How do I add my own custom links to UserCP? Underneath View Profile in Miscellaneous tab.

Does anyone know how to do this, (If it's possible)?


Thanks!
This is possible by making a plugin. First of you'd need to hook it to the usercp, like this:
$plugins->add_hook('usercp_start', 'myaction');

And for the function, like this
function myaction()
{
  global $mybb;
  
  if ($mybb->input['action'] == 'newaction')
  {
      die('Hello, this is a new action.');
  }
}

You can then access it by: usercp.php?action=newaction
You can use MyBB config profile fields to add links directly
http://docs.mybb.com/1.6/Admin-CP-Config...le-Fields/
I believe you're talking about adding additional tabs to the usercp nav bar.

If you edit one of the existing templates for the UserCP Nav you will be able to add your own tabs in.
(2016-06-27, 01:13 PM)Paradigm Wrote: [ -> ]I believe you're talking about adding additional tabs to the usercp nav bar.

If you edit one of the existing templates for the UserCP Nav you will be able to add your own tabs in.

I understood the question incorrectly, OP it is very easy.
Modify usercp_nav templates and add your custom links.
(2016-06-27, 09:56 AM)Sazze Wrote: [ -> ]This is possible by making a plugin. First of you'd need to hook it to the usercp, like this:
$plugins->add_hook('usercp_start', 'myaction');

And for the function, like this
function myaction()
{
  global $mybb;
  
  if ($mybb->input['action'] == 'newaction')
  {
      die('Hello, this is a new action.');
  }
}

You can then access it by: usercp.php?action=newaction

(2016-06-27, 12:00 PM)WallBB Wrote: [ -> ]You can use MyBB config profile fields to add links directly
http://docs.mybb.com/1.6/Admin-CP-Config...le-Fields/

(2016-06-27, 01:13 PM)Paradigm Wrote: [ -> ]I believe you're talking about adding additional tabs to the usercp nav bar.

If you edit one of the existing templates for the UserCP Nav you will be able to add your own tabs in.

(2016-06-27, 02:27 PM)WallBB Wrote: [ -> ]
(2016-06-27, 01:13 PM)Paradigm Wrote: [ -> ]I believe you're talking about adding additional tabs to the usercp nav bar.

If you edit one of the existing templates for the UserCP Nav you will be able to add your own tabs in.

I understood the question incorrectly, OP it is very easy.
Modify usercp_nav templates and add your custom links.

Thanks guys for your help! I've done it now!