The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vB4.2 Navigation Manager - how to discussion
I have vB 4.2.0 BETA 1 running in my test system. Products that use templates/hooks to integrate with the navbar will need the following changes to work with the Navigation Manager. Please post code snips and hints in this thread, we are all on a learning curve. 1. Remove old style navigation hooks/templates etc. 2. Create a new <navigation> section in the product XML file (You can create the navigation in the navigation manager, linked to a product then export the product file as a skeleton) 3. Set any conditionals in a hook or in your main code Eg. $show['apmgtug'] = true; is set for one of the menu items in my example My example relies on $show['member'] = true; as well. Leave the <show> tag empty for 'public' tabs/links 4. If you have multiple scripts, leave <scripts> blank and set $root at the new hooks set_navigation_tab_fallaback or set_navigation_tab_vbview Code:
if (<some condition>) $root= '<name of tab>'; I would probably have a new vB4.2 code base because of the differences, you could have the same code base with some sort of version check. In the end the new navigation integration is better and easier. Here are sample <navigation> from one of my own plugins... Code:
<navigation> <tab name="aptab_competition" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <scripts>apcompetition</scripts> <displayorder>30</displayorder> <url><![CDATA[apcompetition.php{session.sessionurl_q}]]></url> </tab> <link name="aplink_enter" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <parent>aptab_competition</parent> <displayorder>20</displayorder> <url><![CDATA[apcompetition.php{session.sessionurl_q}]]></url> </link> <link name="aplink_search" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <parent>aptab_competition</parent> <displayorder>40</displayorder> <url><![CDATA[apcompetition.php?{vb:raw session.sessionurl}do=search&apmycomps=1]]></url> </link> <link name="aplink_performance" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <parent>aptab_competition</parent> <displayorder>60</displayorder> <url><![CDATA[apcompetition.php?{vb:raw session.sessionurl}do=performance]]></url> </link> <link name="aplink_fame" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>apmgtug</show> <parent>aptab_competition</parent> <displayorder>80</displayorder> <url><![CDATA[apcompetition.php?{vb:raw session.sessionurl}do=finalvotereport]]></url> </link> </navigation> Code:
<phrasetype name="GLOBAL" fieldname="global"> <phrase name="vb_navigation_tab_aptab_competition_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Competitions]]></phrase> <phrase name="vb_navigation_link_aplink_enter_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Enter a Competition]]></phrase> <phrase name="vb_navigation_link_aplink_search_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Search Competitions]]></phrase> <phrase name="vb_navigation_link_aplink_performance_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[My Performance]]></phrase> <phrase name="vb_navigation_link_aplink_fame_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Hall of Fame]]></phrase> </phrasetype> Pull down menu's can also be coded. Have a look at the vB source for examples. Specifically "./install/vbulletin-navigation.xml" |
#92
|
||||
|
||||
... a unique ID or you will run into problems sooner or later
|
#93
|
|||
|
|||
chances are very less, because all the links inside menu generated through navigation manager has id in range of (20 - 50 +), so one can use any id between 1-20 for links inside menu. (per menu).
A higher number will be much better (ex: 1001) OR Get the last navid of link in menu. PHP Code:
PHP Code:
|
#94
|
|||
|
|||
What I need to know is how to use the $vbulletin options in a url in the navigation manager
|
#95
|
||||
|
||||
{options.optionname}
|
#96
|
||||
|
||||
Can we have a Article outlining what objects are available ?
I know of...
Can we have custom objects? Thanks! Kym Edit: Found the answer in the code. See: function process_navigation_linkvars($url) in ./includes/functions.php Anything in $GLOBALS or in $vbulletin->object where object is options, userinfo etc. |
#97
|
||||
|
||||
1- I want add a new Tab, what shoup i put in Tab Script(s) ?
2- I want add a menu and link only for Users Awaiting Moderation, what shoud i put in Show Permission Name ? |
#98
|
||||
|
||||
We use Photopost vBgallery and it runs in a different root path to the forum...
eg: ./forurm vs ./gallery As a result any relative paths in the Tabs fail when in the Gallery unless you do some edits in the Navigation Manager. I've built an interim product file for vBgallery 3.01 that has support for the new vB4.2.0 navigation. (I can't post it due to (c) reasons). Chuck @ Photopost has my code and will release an update for vBgallery (soon-ish I hope) |
#99
|
|||
|
|||
Quote:
Code:
define('THIS_SCRIPT', 'thenameofthescript'); Quote:
Code:
if(is_member_of($vbulletin->userinfo,3)) { $show['uamod'] = true; } |
#100
|
|||
|
|||
<removed>
|
#101
|
||||
|
||||
Hey guys. I am having an issue with some Show Permissions. I have successfully gotten some working, creating the hook for each special usergroup, however when I add them together, so say I want usergroups X, Y, and Z to see a link, each having a separate $show variable in the hook I have created, when I combine them such as "showx.showy.showz" this seems to make the link appear only if a user is in ALL groups. Is there a character I am supposed to use aside from the dot to create an "or" combination versus and "and" combination? Thanks!
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|