vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create a New Tab in the navbar (https://vborg.vbsupport.ru/showthread.php?t=226914)

Lynne 05-07-2010 10:27 PM

Quote:

Originally Posted by mclarens (Post 2033440)
Hey Lynne, great tread, can finaly add links to my nav bar.

This might be abit offtopic but, i was thinking to change my "Home" button on the navbar to another side and been searching around without no exacly explainable answer how to to do that.
Do you know how to do that or where i can find the answer on that? :)

Just change the template_hook it is using. Plugin - Navbar: Insert CMS Navbar Entry

mclarens 05-08-2010 09:16 AM

ahh thanks alot :)

mordor1 05-10-2010 04:42 PM

I got it working for 1 link but now i want to make one for the FAQ too

Code:

Plugin PHP Code
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'faq.php')
{
    $vbulletin->options['selectednavtab']='faq_ftn';
    $tabselected = ' class="selected"';
    $tablinks = '                <ul class="floatcontainer">
                        <li><a href="faq.php">Link 1</a></li>
                            <li class="popupmenu">
                                <a href="javascript://" class="popupctrl">Drop Down</a>
                                <ul class="popupbody popuphover">
                                        <li><a href="sublink1.php">SubLink 1</a></li>
                                        <li><a href="sublink2.php">SubLink 2</a></li>
                                        <li><a href="sublink3.php">SubLink 3</a></li>
                                </ul>
                            </li>
                        <li><a href="link2.php">Link 2</a></li>
                        <li><a href="link3.php">Link 3</a></li>
                </ul> ';

}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="faq.php">FAQ</a>'.$tablinks.'</li>' ;

The link Faq is not highlighted now when its selected

Lynne 05-10-2010 07:33 PM

This is not valid for the faq page:
PHP Code:

if (THIS_SCRIPT == 'faq.php'

Open the file faq.php and find what THIS_SCRIPT is defined to be at the top.

Jonas Clark 05-10-2010 09:25 PM

Thanks Lynne, Everything worked great... execution controls order of tab.

mordor1 05-11-2010 05:46 PM

Quote:

Originally Posted by Lynne (Post 2034695)
This is not valid for the faq page:
PHP Code:

if (THIS_SCRIPT == 'faq.php'

Open the file faq.php and find what THIS_SCRIPT is defined to be at the top.

thx its faq without .php .... :o

Bansheebob 05-18-2010 04:57 PM

I cant believe we have to go through all this to add simple links to a navbar. What the hell? I dont know how to do all this. Make my own plugin, your kidding right? Now I'm gonna have to pay someone to add a few links to my navbar, unlike 3.8 where it was as easy as a simple template edit/addition. Unreal. I'm starting to see why people are going back to the old vb forums.

cellarius 05-18-2010 05:04 PM

Quote:

Originally Posted by Bansheebob (Post 2039342)
I cant believe we have to go through all this to add simple links to a navbar. What the hell? I dont know how to do all this. Make my own plugin, your kidding right? Now I'm gonna have to pay someone to add a few links to my navbar, unlike 3.8 where it was as easy as a simple template edit/addition. Unreal. I'm starting to see why people are going back to the old vb forums.

I can understand your frustration, but a thread where a volunteer took the time to explain what is clearly too difficult is not the place to vent, really. Lynne or her tutorial are not to be blamed for this.

Bansheebob 05-18-2010 05:07 PM

I wasnt blaming Lynne, she actually helped me yesterday with another issue. Just frustrated because on 3.8 I could edit anything in templates very easily and now in vb4 it's like you need a college course. They say in another thread "find this code" in navbar template and I look and its not even there in my code. I cant win today, starting to dislike vb4 bigtime.

Wilfred1 05-19-2010 11:31 PM

Lynne - thank you for this and I have played around with it and with some small changes to suit my needs it works well.

But I would like to add that I am having an issue with this whole new navbar setup for v4 especially given that the navbar is the most changed component, in my opinion, in vb.

I use a navbar that is very similar to the new v4 one except with the added functionality of being able to hover on a tab and access the submenu of that tab for a set millisecond time before it bounces back to the currently selected tab.

To do this I have to set the criteria for its use when using v3.8.5:
Code:

<script type="text/javascript">
    <if condition="in_array(THIS_SCRIPT, array('adv_index', 'about', 'sendmessage','support','staff','memberlist','online', 'private', 'register'))">tabmenu.definemenu("menu", 0)</if>
    <if condition="in_array(ADV_DYNA_PREFIX, array('aircraft', 'acnotice'))">tabmenu.definemenu("menu", 1)</if>
    <if condition="in_array(THIS_SCRIPT, array('aircraft_register', 'aircraft_types'))">tabmenu.definemenu("menu", 1)</if>
    <if condition="in_array(THIS_SCRIPT, array('blog', 'blog_usercp'))">tabmenu.definemenu("menu", 2)</if>
    <if condition="in_array(ADV_DYNA_PREFIX, array('clubs', 'download', 'terms'))">tabmenu.definemenu("menu", 3)</if>
    <if condition="in_array(THIS_SCRIPT, array('calendar', 'view', 'vbgooglemaphse', 'links_index', 'quiz', 'weather', 'weather_arfor', 'weather_metar', 'weather_taf', 'weather_sigmet', 'flight_planner'))">tabmenu.definemenu("menu", 3)</if>
    <if condition="in_array(THIS_SCRIPT, array('index', 'album', 'group', 'search', 'showthread', 'forumdisplay', 'newthread'))">tabmenu.definemenu("menu", 4)</if>
    <if condition="in_array(ADV_DYNA_PREFIX, array('quotes'))">tabmenu.definemenu("menu", 5)</if>
    <if condition="in_array(THIS_SCRIPT, array('arcade', 'gallery_index', 'gallery_upload', 'gallery_search', 'gallery_slideshow', 'gallery_albums', 'gallery_edit', 'gallery_delete', 'vbtubepro', 'youtube_browser'))">tabmenu.definemenu("menu", 5)</if>
    <if condition="in_array(THIS_SCRIPT, array('profile', 'member', 'subscription'))">tabmenu.definemenu("menu", 6)</if>
    <if condition="ADV_DYNA_PREFIX == 'classifi'">tabmenu.definemenu("menu", 8)</if>
    <if condition="$pg=='advertising_rates'">tabmenu.definemenu("menu", 0)</if>
</script>

Following this criteria are all the different sub menus which are listed as ul and li's.

As you can see it is a "dogs breakfast" of an array and trying to convert this to a more vb way using your great tutorial here is really, for me, going from one "dog's breakfast" to another.

So I raise this question...there must be a better way for everyone to manage their v4 navbar?

Could a global variable be created and:
- each time a user clicks a tab or submenu item the global variable is set to a number to correspond to the tab id
- the page changes to the linked page
- the tab that corresponds to the global variable is then made "selected"

Very little code would be needed to facilitate this, you wouldn't need to worry about "THIS SCRIPT" or any other definition of what page is being displayed, very simple to include a setting of the global variable on clicking, and then reading the variable on page display etc.

Is this an option? Would it make the navbar easier to manage? Would it improve performance? :confused:


All times are GMT. The time now is 12:24 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.02210 seconds
  • Memory Usage 1,758KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete