This tutorial will teach how easy it is to add new groups to your admincp left panel. Have you ever installed a plugin, and refreshed the admincp to find some new group added under the vBulletin options, or a new link under a default option? Here is how to do that.
Adding a new group
This first think you will need to do is turn on debug mode. This isn't absolutely necessary but it's a good habit to get into when your making your products, and we're going to use some features that require debug on to be on.
To turn on debug mode add the following line anywhere in your config.php file.
You must first be a
registered member to view any code.
Okay, now we're ready to add a new nav group. Here is the following code that will let you add a new group. This code is XML and should be pretty easy to understand.
You must first be a
registered member to view any code.
You must first be a
registered member to view any code.
Create the product
Nothing helps you understand better then doing it yourself! Lets start by starting our own product. Login to your admincp panel. Under the
Plugin System you should click the
Plugin Manager's link. From there you should see
[Add/Import Product]. Click on that and under the
Add New Product group add the following information.
Product ID: tutorial_test
Title: Tutorial Test
Version: 1.0
Description: This is a test
1.gif
After saving this, we can now add our XML code to display our custom nav group.
create a file called
cpnav_tutorialtest.xml with the following code.
You must first be a
registered member to view any code.
Notes:
+ Notice the product
attribute is the same as the Product ID.
+ The phrase
attribute will look for that phrase. You will need to create this phrase in the phrase manager for this to show up.
+ Notice the permissions
attribute is missing. We won't be using it, since custom admin permissions will be a future tutorial of mine.
Upload that file to your
/includes/xml/ directory. Now go ahead and refresh your admincp. If your seeing blank options. Like this:
2.gif
Then you need to add the phrases titled: test_title & my_test_link the phrase type called: Control Panel Global.
Adding the Phrases
Under
Languages & Phrases look for
Phrase Manager. Click the
Add New Phrase button. You will need to do this twice. Here is the first set.
Phrase Type: Control Panel Global
Product: Tutorial Test
Varname: test_title
Text: Tutorial Test
3.gif Phrase Type: Control Panel Global
Product: Tutorial Test
Varname: my_test_link
Text: My Test Link
4.gif
Now you should see this.
5.gif Your Done!
Copyright ©2004-2006 vBHackers.com All Rights Reserved.
This tutorial may not be redistributed in whole or significant part.