The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[How-To] Add entries to AdminCP Navigation Menu
The AdminCP Navigation is now controlled through XML files. To add custom entries, you must create a new file cpnav_yourhack.xml and place it in directory includes/xml. This XML-File constist of 6 important tags:
Example HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <navgroups product="vbulletin"> <navgroup phrase="demohack_settings" hr="true"> <navoption> <phrase>demohack_foo</phrase> <link>demohack.php?do=foo</link> </navoption> <navoption> <phrase>demohack_modcp</phrase> <link>../{$vbulletin->config[Misc][modcpdir]}/foobar.php</link> </navoption> </navgroup> <navgroup text="Demohack Settings"> <navoption> <text>Demohack Foo</text> <link>demohack.php?do=foo</link> </navoption> <navoption> <text>Demohack ModCP</text> <link>../{$vbulletin->config[Misc][modcpdir]}/foobar.php</link> </navoption> </navgroup> </navgroups> With Beta 3 a new parameter displayorder has been introduced. This parameter is valid for Tags navgroup and navoption. This way it is possible to control in which order the Navgroups and Links will be displayed, and you can also add custom Links to existing Navgroups. To do so, your navgroup must have them same displayorder and Phrase Varname as the existing group: HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <navgroups product="vbulletin"> <navgroup phrase="forums_and_moderators" displayorder="60"> <navoption displayorder="1"> <text>Top-Link Forums & Moderators</text> <link>demohack.php?do=foo</link> </navoption> </navgroup> </navgroups> To find out the Displayorder for existing groups, take a look at cpnav_vbulletin.xml. This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent. |
#22
|
||||
|
||||
You can add separators between Navgroups, but AFAIK it's not possible to add Spearators between Nav Options.
|
#23
|
||||
|
||||
Thanks Kirby.
I am SO happy to see this addition to Beta3. |
#24
|
||||
|
||||
Quote:
|
#25
|
|||
|
|||
This one is not directly related to the subject, but it also is, somehow.
In the past, I modified the AdminCP menu of a hack of mine, depending on a parameter the user entered, adding or removing a line in the menu. If the condition of this parameter was changed, then I forced a reload of admincp, by redirecting the program to admincp/index.php. Obviously this method can no longer be used, and I have to have two different cpnav_xxx.xml files, one with the additional line and one with out it, and copy the one I need to the /includes/xml directory. However, my php knowledge is not that extensive, so can some one please tell me how I can do something like (in pseudo code): Code:
if (parameter==1) { copy /temp/menu1.xml /includes/xml/cpnav_aws.xml } else { copy /temp/menu2.xml /includes/xml/cpnav_aws.xml } Thanks for your help. |
#26
|
||||
|
||||
I believe this can easily be solved by offering the else-excluded option anyways, and then have this parameter check before any other code in the section in the file, and print out a cp message in the event that the option would not have been shown on the old menu.
|
#27
|
|||
|
|||
Great tutorial again, thanks mate.
|
#28
|
||||
|
||||
It would be really nice to be able to add options to existing groups. It's just much more organized than forcing every tiny little hack to have its own group. Any chance of this being added in the future?
|
#29
|
||||
|
||||
Already possible since Beta 3 ...
|
#30
|
|||
|
|||
How do I add my own options into the modcp?
|
#31
|
||||
|
||||
Hook mod_index_navigation
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|