Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[How-To] Add entries to AdminCP Navigation Menu
Andreas's Avatar
Andreas
Join Date: Jan 2004
Posts: 6,863

 

Germany
Show Printable Version Email this Page Subscription
Andreas Andreas is offline 06-07-2005, 10:00 PM

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:
  • <navgroups>
    This indicates that this is a XML File containing navgroups.
    It has one parameter product that should be set to your product identifier or vbulletin if it does not belong to any product.
  • <navgroup>
    This is the container for one Settings-Group, like Styles & Templates, vBulletin Options, etc.
    It has three parameters: phrase/text, permissions and hr.
    If you are using phrases, phrase must contain the variable name, if you are using hardcoded text then text must contain the label.
    Parameter permissions (optional) can be used to check an administrator permission, like canadminoptions.
    Parameter hr (optional) can be used to put a spacer below this navgroup.
  • <navoption>
    This is one Menu-Entry.
  • <phrase> or <text>
    This must contain the varname or hardcoded text for the menuetry.
  • <link>
    Tag link must contain the URL.
    You can use {$vbulletin->config[Misc][modcpdir]} to point to the ModCP directory here, no matter how it is actually called

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>
Update for Beta 3
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 &amp; Moderators</text>
			<link>demohack.php?do=foo</link>
		</navoption>
	</navgroup>
</navgroups>
Then Top-Link Forums & Moderators will be the first link in Navgroup Forums & Moderators (Displayorder: 60).

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.
Reply With Quote
  #52  
Old 12-04-2005, 09:36 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean with "blank tab"?
Also, do you have a product emotions?
Reply With Quote
  #53  
Old 12-04-2005, 09:43 AM
waza waza is offline
 
Join Date: Apr 2005
Location: Belgium
Posts: 341
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey,
yes I have a product emotions, I also tried it with: product="vbulletin" but it didn't work either I always get a blank entry, like in the attached screen.

If I look to the src code I see this for the blank entry:

HTML Code:
<div style="margin-bottom:12px"></div>
	<a name="grpemotions_0"></a>
		<table cellpadding="0" cellspacing="0" border="0" width="100%" class="navtitle" ondblclick="toggle_group('emotions_0'); return false;">
		<tr>
			<td><strong></strong></td>
			<td align="right">
				<a href="index.php?do=buildnavprefs&amp;nojs=0&amp;prefs=&amp;dowhat=expand&amp;id=emotions_0#grpemotions_0" target="_self"
					onclick="toggle_group('emotions_0'); return false;"
					oncontextmenu="toggle_group('emotions_0'); save_group_prefs('emotions_0'); return false"
				><img src="../cpstyles/vBulletin_3_Silver/cp_expand.gif" title="Expand Group" id="button_emotions_0" alt="" border="0" /></a>
			</td>

		</tr>
		</table>
		<div id="group_emotions_0" class="navgroup" style="display:none">
		<div class="navlink-normal" onclick="nav_goto('');" onmouseover="this.className='navlink-hover';" onmouseout="this.className='navlink-normal'"><a href=""></a></div>
		</div>
Attached Images
File Type: jpg tab_blank.JPG (3.5 KB, 0 views)
Reply With Quote
  #54  
Old 12-04-2005, 10:05 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your XML is invalid

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<navgroups product="emotions">
	<navgroup text="Moods" hr="true">
		<navoption>
			<text>Mood manager</text>
			<link>image.php?do=modify&amp;table=mood</link>
		</navoption>
		<navoption>
			<text>Add new mood</text>
			<link>image.php?do=add&amp;table=mood</link>
		</navoption>
		<navoption>
			<text>Upload mood</text>
			<link>image.php?do=upload&amp;table=mood</link>
		</navoption>
	</navgroup>
</navgroups>
Reply With Quote
  #55  
Old 12-04-2005, 10:14 AM
waza waza is offline
 
Join Date: Apr 2005
Location: Belgium
Posts: 341
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oww I see & should be &amp;

Thx man, I tried like everything, was almost getting crazy .

Grz
Reply With Quote
  #56  
Old 12-18-2005, 07:41 PM
zendiver zendiver is offline
 
Join Date: Sep 2004
Location: Houston, TX
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Nullifi3d
Yes, take a look at includes/xml/cpnav_vbulletin.xml for examples.
Take a look at the permissions parameter within the navgroup tags.
I can see where it you would put 'permissions="canadminsettings"' but that doesn't allow you to choose which Admins have the accessibility.

If you go to Admin Permissions, you are able to choose which Admin has what permissions to access. How would one go about adding this functionality?

Thanks
Reply With Quote
  #57  
Old 12-23-2005, 08:02 PM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zendiver
I can see where it you would put 'permissions="canadminsettings"' but that doesn't allow you to choose which Admins have the accessibility.

If you go to Admin Permissions, you are able to choose which Admin has what permissions to access. How would one go about adding this functionality?

Thanks
I'm wondering the same thing...
Andreas ?
Reply With Quote
  #58  
Old 12-28-2005, 10:42 PM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just for reference, the vBulletin manual has a section on this.
http://www.vbulletin.com/docs/html/cpnav_xml

Very handy. :squareeyed:

Quote:
Originally Posted by Andreas
  • <navgroups>
    This indicates that this is a XML File containing navgroups.
    It has one parameter product that should be set to vbulletin
Actually this should be set to the name of your product.
Reply With Quote
  #59  
Old 12-28-2005, 10:46 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Before RC ... don't know which RC it was that introduced product management, this was correct.
Reply With Quote
  #60  
Old 12-28-2005, 10:47 PM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zendiver
I can see where it you would put 'permissions="canadminsettings"' but that doesn't allow you to choose which Admins have the accessibility.

If you go to Admin Permissions, you are able to choose which Admin has what permissions to access. How would one go about adding this functionality?

Thanks
If you want to add your own permissions, you need to use bitfields.
See http://www.vbulletin.com/docs/html/bitfield_xml

^ Granted this is for 3.5.2..... Not sure about Beta.

Quote:
Originally Posted by Andreas
Before RC ... don't know which RC it was that introduced product management, this was correct.
Have you done one for release? If not, you ought to. Your tutorials are very handy to have around. :glasses:
Reply With Quote
  #61  
Old 02-27-2006, 10:35 AM
jim6763nva's Avatar
jim6763nva jim6763nva is offline
 
Join Date: Oct 2005
Location: Virginia
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Andreas,

Thank you very much for taking the time to put this tutorial together! Tutorials like this one are a huge help to new vBulletin Hack developers.
Kudos to you! Hopefully you will be adding more to this.

Best wishes,
Jim
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09140 seconds
  • Memory Usage 2,347KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_html
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete