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. |
#12
|
||||
|
||||
thanks
|
#13
|
|||
|
|||
I have a problem with the xml file which describes the menu I want to appear in the AdminCP.
If one of the options contains a link, which includes as a character, the character &, the menu does not appear. For example: Code:
<navoption displayorder="100"> <text>Statistics - Warnings Per User</text> <link>admin_warn.php?act=viewwarnedusers&type=warnings</link> </navoption> If I replace the & character with a - or something, everything works. Is this a bug in the way the xml is handled or is this character not allowed? If so, how can I pass a link, which includes such a character? Thanks |
#14
|
||||
|
||||
& is only allowed in CDATA (Character Data) Sections, otherwise you must use the entity &
|
#15
|
|||
|
|||
Thanks Kirby, much appreciated.
Any other characters that are not allowed, that I need to be aware of? As you can tell, I have no expertise in XML. Thanks again. |
#16
|
||||
|
||||
[ ] < > ' "
|
#17
|
|||
|
|||
Thank you Sir!
|
#18
|
|||
|
|||
Quote:
ok a Q about vb 3.5 beta 3 code if we open <text> shouldn't we close it with </text > why are we closing it as </phrase> in your code you show Code:
<navoption displayorder="1"> <text>Top-Link Forums & Moderators</phrase> <link>demohack.php?do=foo</link> </navoption> |
#19
|
|||
|
|||
Its a typo.
|
#20
|
||||
|
||||
Jep. That happens when you just "blindly" write "Code" without testing it
Fixed. |
#21
|
||||
|
||||
Is there a way with this XML to add a separator between navoptions to segregate different areas of the same navigation?
i.e. *NAVGROUP TITLE* view something view somethingelse *SEPARATOR* edit something edit somethingelse *SEPARATOR* delete something delete somethingelse Is this possible without having it get linked? I've already tried a single character in the link but it sends the navigation frame over into the main view if you accidentally click that.... |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|