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

Reply
 
Thread Tools
[HOW TO - vB4] How add sub-menu drop down to the navbar (tab Forum)
Allan's Avatar
Allan
Join Date: Jun 2003
Posts: 1,513

 

France
Show Printable Version Email this Page Subscription
Allan Allan is offline 01-07-2010, 10:00 PM

This mod add sub-menu drop down to the navbar (tab Forum)

PS: Thank to Lynne for his help

First Method
  • Add new plugin
- Product -> vbulletin
- hook location -> process_templates_complete
- Title -> menu x
- Execution Order -> 5
- Plugin PHP Code

PHP Code:
$template_hook['navbar_end'] .= 
<li class="popupmenu"> 
<a href="javascript://" class="popupctrl">Menu test</a> 
<ul class="popupbody popuphover"> 
<li><a href="http://www.vbulletin-ressources.com/forum">test 1</a></li> 
<li><a href="http://www.vbulletin-ressources.com/forum">test 2</a></li> 
<li><a href="http://www.vbulletin-ressources.com/forum">test 3</a></li> 
</ul> '



Change location
: ($template_hook['navbar_end'] in my example)

- navbar_end -> At the end to the navbar
- navbar_start -> At the beginning of the navbar
- navbar_after_getnew -> After "New Posts"
- navbar_after_pm -> After "Private Messages"
- navbar_after_faq -> After "Faq"
- navbar_after_calendar -> After "Calendar"
- navbar_after_community -> After "Community" button


Second method
  • In the "navbar" template, find:
PHP Code:
{vb:raw template_hook.navbar_end}
                </
ul>
            </
li>
        <
vb:elseif condition="$vboptions['selectednavtab']=='usercp'" /> 
  • Add above:
PHP Code:
<li class="popupmenu">
<
a href="javascript://" class="popupctrl">Menu test</a>
<
ul class="popupbody popuphover">
<
li><a href="http://www.vbulletin-ressources.com/forum">test 1</a></li>
<
li><a href="http://www.vbulletin-ressources.com/forum">test 2</a></li
<
li><a href="http://www.vbulletin-ressources.com/forum">test 3</a></li>   
</
ul>
</
li
  • Result:


PS: Just change the links and titles.
Attached Images
File Type: jpg menu.jpg (16.3 KB, 0 views)
Reply With Quote
  #22  
Old 04-08-2011, 07:04 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could anybody point me in the right direction of getting this effect?

Reply With Quote
  #23  
Old 04-27-2011, 02:33 PM
Mustiii's Avatar
Mustiii Mustiii is offline
 
Join Date: Feb 2010
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I addet this but the Problem is that it is shown if i click on the "Forum" Button. I addet a "Portal"-Button. How can i make that it appears there and not by the Forum Button?

Reply With Quote
  #24  
Old 04-27-2011, 04:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This artilce is about adding the sub-menus, not the navtabs. You need to have the correct condition around your navtab to show it at the correct place. You should ask your question in the modification thread that you use for the navtab.
Reply With Quote
  #25  
Old 04-27-2011, 06:58 PM
Mustiii's Avatar
Mustiii Mustiii is offline
 
Join Date: Feb 2010
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But this has nothing to do with the modification, because i am sure many persons want to add sub-menus as example under the standard buttons like "whats new" and the "blog" and not only by the "forum" button so the question is how to specify that
Reply With Quote
  #26  
Old 04-28-2011, 03:29 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And if you wrote the navtab correctly, then you would have the submenus showing. I have an article in my profile on how to correctly write a plugin to create a navtab with submenus.
Reply With Quote
  #27  
Old 04-28-2011, 02:39 PM
Mustiii's Avatar
Mustiii Mustiii is offline
 
Join Date: Feb 2010
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much Lynne your article was the perfect description to solve my problem. Only thing i still need is to know how to translate (add Phrases) to this new buttons. Because i am using a multilingual Forum
Reply With Quote
  #28  
Old 04-28-2011, 03:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mustiii View Post
Thank you very much Lynne your article was the perfect description to solve my problem. Only thing i still need is to know how to translate (add Phrases) to this new buttons. Because i am using a multilingual Forum
Instead of putting text for the links:
HTML Code:
<a href="link.php">My Link</a>
Use phrases (you will need to enter them into the phrase manager as global phrases):
HTML Code:
<a href="link.php">$vbphrase[my_link]</a>
Reply With Quote
  #29  
Old 04-28-2011, 04:43 PM
Mustiii's Avatar
Mustiii Mustiii is offline
 
Join Date: Feb 2010
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you i addet all the submenus i needet. Only two are making me problems

1. The "Who's Online" Menu. I get this Error Message showing if i write it like that

Code:
Parse error: syntax error, unexpected T_STRING in /www/htdocs/w00d3776/vbulletin/includes/class_bootstrap.php(537) : eval()'d code on line 84
If i write it like Whos Online without ' it makes no problems but why cant i write it like in the Original way?

2. The "Open Contacts Popup"

If i add the code like this

Code:
<li><a onclick="window.open(getBaseUrl() + 'misc.php?do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;" href="javascript://">Open Contacts Popup</a></li>
i get this error message

Code:
Parse error: syntax error, unexpected T_STRING in /www/htdocs/w00d3776/vbulletin/includes/class_bootstrap.php(537) : eval()'d code on line 82
hope that a solution for this problems exists thanks for any help
Reply With Quote
  #30  
Old 04-28-2011, 08:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are writing this in php output, you need to escape the character if that is what you have surrounding the output - \'
Reply With Quote
  #31  
Old 04-28-2011, 08:30 PM
Mustiii's Avatar
Mustiii Mustiii is offline
 
Join Date: Feb 2010
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not sure how to do that i think i can solve the first problem with writing Whos Online and add the correct writing to phrases but i am not sure how to change the Open contacts popup to make it work

--------------- Added [DATE]1304101672[/DATE] at [TIME]1304101672[/TIME] ---------------

Adding the phrases is making me problems i did it step by step but it looks like this now





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 08:46 AM.


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.04350 seconds
  • Memory Usage 2,346KB
  • 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
  • (3)bbcode_code
  • (2)bbcode_html
  • (3)bbcode_php
  • (1)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete