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)

Boofo 08-16-2010 06:05 AM

That is how it is supposed to work. When I go to private messages, my Forum tab is selected. Or am I missing what you are wanting to do?

pedrossi 08-16-2010 06:21 AM

Yeah, I want the new tab to be selected when I go to private messages, rather than the Forum tab. Sorry if I wasn't clear before.

cellarius 08-16-2010 06:38 AM

Quote:

Originally Posted by pedrossi (Post 2084632)
Yeah, I want the new tab to be selected when I go to private messages, rather than the Forum tab..

Change in your code:
PHP Code:

if (THIS_SCRIPT == 'member'

to
PHP Code:

if (THIS_SCRIPT == 'member' OR THIS_SCRIPT == 'private'


pedrossi 08-16-2010 03:56 PM

Wow, so simple. That did it! I thought there would be a conflict, but I guess not?

Anyway, many thanks :)

Boofo 08-16-2010 04:34 PM

Quote:

Originally Posted by cellarius (Post 2084635)
Change in your code:
PHP Code:

if (THIS_SCRIPT == 'member'

to
PHP Code:

if (THIS_SCRIPT == 'member' OR THIS_SCRIPT == 'private'


Whew! Thanks for bailing me out once again, sir. ;)

cellarius 08-16-2010 04:44 PM

Quote:

Originally Posted by Boofo (Post 2084829)
Whew! Thanks for bailing me out once again, sir. ;)

Anytime ;)

Boofo 08-16-2010 05:46 PM

I wasn't quite sure what he was wanting. Must have been the old age confusion creeping up on me. ;)

Boofo 08-18-2010 10:52 PM

I found an easy way to make any new tabs have the same links under it as the forum tab does. If anyone is interested in how to do that, contact me and I will show you. You will also be able to add links in between the other links just like in the forum tab.

nlwin 08-31-2010 09:46 PM

Is this plugin works in vBulletin 4.0.5? I tried it and it doesn't work for me. Any idea? :D

Lynne 09-01-2010 12:07 AM

Yes, it works in 4.0.5.

NashChristian 09-12-2010 07:39 PM

Quote:

Originally Posted by Lynne (Post 2003463)
In the code in the first post, one of the submenu items is a dropdown. If you are talking about the navtab itself being a dropdown, someone else wrote an article for that (I think it was Shelby).

Hello Lynne,

I've used your plugin here successfully for quite a while and love it! I'm now trying to rework my navigation to create drop-down menus on most of my TABS. I've tried Shelby's mod (referenced above) and I believe that YOURS is closer to meeting my needs, however I need some help adapting it.

Basically, what I want is ALL the functionality of your plugin PLUS the ability to include drop-down menus on the TABS themselves!

Problems with Shelby's Mod (for my needs):
  • I want the tab to stay highlighted once one of the options in that tab have been selected (like on yours).
  • I want to replace the tablinks (submenus) on each of the primary categories (like on yours).

For example, one of my TABS is for the EVENT CALENDAR:

EVENT CALENDAR
  • Monthly View
  • Weekly View
  • Add New Event

Then once any of those three links above, in the tab menu are selected, I want to have the Event Calendar button highlighted (show SELECTED same as vB default behavior), and have the standard Forum submenu (tablinks) replaced with one custom submenu that says "Add New Event". So this text link will appear alone in the upper left corner of the navigation submenu (under the row of tabs).

I've been playing with this all day, but can't seem to figure it out. I'm unsure whether it is NECESSARY to do this in two steps by creating the new template and plugin as suggested by Shelby. I don't mind either way, I just need help adapting one of the mods to include these features.

Any help would be appreciated!

Thanks!
:D Jeff

Lynne 09-12-2010 08:52 PM

You are going to have to merge the two mods together. I'd suggest doing that and then starting your own thread where you post your code and images or your result (or a link to see it). That way, we can try out your code ourselves and see what is going on and make suggestions for changes.

NashChristian 09-12-2010 10:31 PM

Quote:

Originally Posted by Lynne (Post 2097291)
You are going to have to merge the two mods together. I'd suggest doing that and then starting your own thread where you post your code and images or your result (or a link to see it). That way, we can try out your code ourselves and see what is going on and make suggestions for changes.

Hello Lynne,

My concern with that is three fold:
  1. I would be literally copying your code and Shelby's and combining the two, which I don't think I'm supposed to do without permisson from both parties.
  2. People will ask me a bunch of questions that I'm not the slightest bit qualified to answer.
  3. I've tinkered with this some already, and the part I can't figure out is how to have the selected tab highlighted (show SELECTED the same as vB default behavior). The plugin can be conditional, but I don't believe the template can. I'd need a way either to pass a value into the template (selected or not), or I'd need the plugin to route to two different templates depending upon whether it is selected or not. Multipy that times five different tabs, each with their own drop-down menu, and it seems that this could get quite resource intensive.

Your thoughts?

Thanks!
:D Jeff

Lynne 09-12-2010 11:06 PM

1. No you wouldn't. You are simply taking our instructions and writing your own. I'm talking about putting in your own links and all that - post exactly what your plugin code currently is.

2. Ignore them or say "I don't know". It's a help thread - you are asking for help not offering help.

3. Post it. Tell us what isn't working. Tell us what the conditions are for the tab to be highlighted. You need to verbalize that anyway so you can write your condition for it.

NashChristian 09-13-2010 12:01 AM

Ok, I misunderstood what you were saying.

What forum should I post the new help thread in?

Modification Requests/Questions (Unpaid)?
vB4 Design and Graphics Discussions?

Thanks again for your assistance!
Jeff

Lynne 09-13-2010 12:13 AM

You could post it in here - vB4 General Discussions (or vB4 Programming Discussions)

NashChristian 09-13-2010 06:07 PM

Quote:

Originally Posted by Lynne (Post 2097291)
You are going to have to merge the two mods together. I'd suggest doing that and then starting your own thread where you post your code and images or your result (or a link to see it). That way, we can try out your code ourselves and see what is going on and make suggestions for changes.

I've started a new thread HERE for anyone who wants to follow or participate in the development of the modifications I've mentioned.

jacobskinner811 09-13-2010 06:57 PM

hey lynn i am not a programer and am really bad at all this...is there a way i could pay you to install it on my site?

unknown22 09-16-2010 07:55 PM

I put in the plugin code but it only creates a tab beside forum it's a link to another website
and there's no nav bar with menu.

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'new site')
{
    $vbulletin->options['selectednavtab']='hlstat';
    $tabselected = ' class="selected"';
    $tablinks = '                <ul class="floatcontainer">
                        <li><a href="link1.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_middle'] .= '<li'.$tabselected.'><a class="navtab" href="http://website.com">name here</a>'.$tablinks.'</li>' ;

I was looking only to create a nav bar link like community you click that and members list etc..
Trying to make it under my home tab which has nothing under it, using vbadvanced.

Lynne 09-16-2010 11:44 PM

Quote:

Originally Posted by unknown22 (Post 2099234)
I put in the plugin code but it only creates a tab beside forum it's a link to another website
and there's no nav bar with menu.

Since you are linking to another site, you will be on another site after you click the link and therefore it can't be highlighted.

unknown22 09-17-2010 01:34 AM

It was a test because that other tutorial was for the tab I thought this was for the navbar like community, quick links. I like to have it as that won't work?? only the link as I said to another site shows up nothing under that.

Lynne 09-17-2010 02:45 AM

Quote:

Originally Posted by unknown22 (Post 2099403)
It was a test because that other tutorial was for the tab I thought this was for the navbar like community, quick links. I like to have it as that won't work?? only the link as I said to another site shows up nothing under that.

If you read the first post, this is for the navtab and then contents in the sub-menu.

unknown22 09-17-2010 12:20 PM

Either way if I try to add this under home does not work or navbar alone submenu won't show up.

if (THIS_SCRIPT == 'cmps_index.php')

home page, nothing shows up under there

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'cmps_index.php')
{
    $vbulletin->options['selectednavtab']='hometemplate';
    $tabselected = ' class="selected"';
    $tablinks = '                <ul class="floatcontainer">
                        <li><a href="link1.php">Link 1</a></li>
                            <li class="popupmenu">
                                <a href="javascript://" class="popupctrl">Drop Down</a>
                                <ul class="popupbody popuphover">
                                        <li><a href="http://blackpulsegamers.net/forums/forum.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="cmps_index.php">jjyj</a>'.$tablinks.'</li>' ;

Hook Location = process_templates_complete

Execution Order = 10 and I have another mod which uses Execution Order 8 and both tabs switch for some reason. Roster is the second last tab before this one.

Even If I try to make a tab alone nothing shows up under it.

Lynne 09-17-2010 01:43 PM

I'm not positive, but I don't think this is valid:
if (THIS_SCRIPT == 'cmps_index.php')

I don't think THIS_SCRIPT is defined as cmps_index.php on that page. Open the file and see what it says (you shouldn't guess, you need to Look At The Code).

unknown22 09-18-2010 03:11 PM

How could i add links sub menu etc.. under my home tab which theres nothing under that used vbadvanced for that.

Lynne 09-18-2010 06:01 PM

Quote:

Originally Posted by unknown22 (Post 2100082)
How could i add links sub menu etc.. under my home tab which theres nothing under that used vbadvanced for that.

You would have to edit the plugin that is creating that tab for you.

mailshuxin 10-13-2010 02:07 AM

Very easy to use
It great,I used on my vb

PankajKumar 10-24-2010 01:24 PM

Hi Lynne,

I want to have this in my forum and added following code as a plugin

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'webmaster tools')
{
    $vbulletin->options['selectednavtab']='tools';
    $tabselected = ' class="selected"';
    $tablinks = '                <ul class="floatcontainer">
                        <li><a href="link1.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_middle'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.awebmastersforum.com/cmps_index.php?pageid=tools">Tools</a>'.$tablinks.'</li>' ;

Now the issues I am facing are;

1. On clicking of "Tools" tab, Forum is getting highlighted which should be Tools.
2. No sub-menus are getting shown, I think its because of first issue. If that will be fixed, it should automatically get fixed.

You can check this at my forum: Webmaster Forum

I am not sure what is the issue with my code. I searched in all the 24 pages of the thread but didn't find the solution. Please help me out.

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

Hi,

On further debugging, after clicking on "Tools" tab, i checked the page source and found this:


var THIS_SCRIPT = "adv_index";

Now my question is that where are we setting this variable in the plugin code? Obviously, I am missing some small details which is causing this issue and the variable is not getting set properly and hence default Forum tab is getting highlighted.

Please let me know where does it get set? I am new to VB, so it will take some time to get used to it.

Lynne 10-24-2010 02:10 PM

If the page you are clicking on has THIS_SCRIPT defined as 'adv_index', then 'adv_index' is what you need to put into the plugin. The plugin has the condition for when the tab is highlighted.

PankajKumar 10-24-2010 02:39 PM

Quote:

Originally Posted by Lynne (Post 2113616)
If the page you are clicking on has THIS_SCRIPT defined as 'adv_index', then 'adv_index' is what you need to put into the plugin. The plugin has the condition for when the tab is highlighted.

Thanks Lynne,

I did that and it worked smooth. And I figured it out why it was happening. Just in case someone else is facing this problem, its defined in the vbadvanced php file, similar things can happen if used with other php files. Just a Tip.

Thanks again.

lowchia 10-29-2010 04:24 PM

Hi Lynne

Thanks for helping us but after reading so much, my knowledge only increase by abit :(

My forum is at http://singstocks.com/forum

I just need to add a "Home" tab at nav bar: Home --> Forum --> What news

This home tab is a link back to my blog at http://singstocks.com.

Pls help and explain clearly as i am new at codes.

Thank you

Code:

<div id="navbar" class="navbar">

        <ul id="navtabs" class="navtabs floatcontainer<vb:if condition="$show['member'] AND $notifications_total"> notify</vb:if>">
                {vb:raw template_hook.navtab_start}
                <vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'">
                        <li class="selected"><a class="navtab" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}">{vb:rawphrase forum}</a>
                                <ul class="floatcontainer">
                                        {vb:raw template_hook.navbar_start}
                                        <vb:if condition="$show['searchbuttons']">
                                                <vb:if condition="$show['member']">
                                                <li><a href="search.php?{vb:raw session.sessionurl}do=getnew&amp;contenttype=vBForum_Post">{vb:rawphrase new_posts_nav}</a></li>
                                                <vb:else />
                                                <li><a href="search.php?{vb:raw session.sessionurl}do=getdaily&amp;contenttype=vBForum_Post">{vb:rawphrase todays_posts}</a></li>
                                                </vb:if>
                                        </vb:if>
                                        {vb:raw template_hook.navbar_after_getnew}
                                        <vb:if condition="$show['pmmainlink']">
                                                <li><a href="private.php{vb:raw session.sessionurl_q}" rel="nofollow">{vb:rawphrase private_messages}</a></li>
                                        </vb:if>
                                        {vb:raw template_hook.navbar_after_pm}
                                        <li><a rel="help" href="faq.php{vb:raw session.sessionurl_q}" accesskey="5">{vb:rawphrase faq}</a></li>
                                        {vb:raw template_hook.navbar_after_faq}
                                        <li><a href="calendar.php{vb:raw


cassis2k 11-03-2010 02:01 PM

Quote:

Originally Posted by Lynne (Post 2113616)
If the page you are clicking on has THIS_SCRIPT defined as 'adv_index', then 'adv_index' is what you need to put into the plugin. The plugin has the condition for when the tab is highlighted.

Thank you Lynne, it's perfect :D

Lostboyfan 11-13-2010 09:33 PM

How do I make a navbar tab stay highlighted with you click on it?

I would like to know as soon as possible

Hippy 11-14-2010 11:26 AM

your answer is above your post

Lostboyfan 11-14-2010 03:29 PM

Quote:

Originally Posted by Hippy (Post 2121725)
your answer is above your post

Thanks for telling me. Must of been reading so many post that I finally just posted to get an answer and didn't know that it was right in front of me.

crtsoft 11-17-2010 02:33 AM

Great post. simple, and works great. thanks

Dugchugger 11-29-2010 01:55 AM

Thanks Lynne! It's Duggy-proof! I got it up and running in less than 5 mins. You are a vB Goddess!

sailnet 12-14-2010 08:28 PM

I just installed this code exactly as it appears, and it shows up on my forums menus but the drop downs do not appear - any ideas why?

I'm running on 4.1.0

I would have preferred to go with the template version of this mod but there's nothing in the template version about creating drop downs and I need drop down on my additional menu items.

tdev1 12-19-2010 06:58 PM

thanks for this tutorial, very nice :)

used to create a tutorial on how to embed webchat-IRC: http://thomasfischer.biz/?p=441

larryd 12-29-2010 07:38 PM

I've added a tab called Features which works great thanks..

Question is now that I am calling custom vb pages that I'm creating from this tab how do I get the tab to be the highlighted tab?

For example in my custom VB page dynodb.php

Code:

define('THIS_SCRIPT', 'dynodb');
define(ncoextratab, true);

The forum template for the Features tab is called nco_extra_navbar and looks like this

Code:

<vb:if condition="$vboptions['selectednavtab'] == 'ncoextratab'">

<li style="border-top-style:solid; border-top-color:white; border-top-width:1px; border-left-style:solid; border-left-color:white; border-left-width:1px;" class="popupmenu">

<a style="text-decoration:none;" color='#ff0000'" href="javascript://" class="popupctrl" ><b>Features</b></a>

<ul class="popupbody popuphover">
<li><a href="http://www.newcelica.org">Install Guides</a></li>
<li><a href="http://partscatalog.newcelica.org/page.php">Parts Catalog</a></li>
<li><a href="http://tracktimes.newcelica.org/index.php">Track Times</a></li> 
<li><a href="dynodb.php">Dyno Database</a></li> 
<li><a href="http://www.newcelica.org/other/technical/index.htm">Technical Information</a></li> 
<li><a href="http://www.newcelica.org/other/store/index.htm">NC.org Gear</a></li> 
</ul>
</li>

<vb:else />

<li style="border-top-style:solid; border-top-color:white; border-top-width:1px; border-left-style:solid; border-left-color:white; border-left-width:1px;" class="popupmenu">

<a onmouseover="this.style.color='#ff0000'" onmouseout="this.style.color='#ffffff'" href="javascript://" class="popupctrl" ><b>Features</b></a>

<ul class="popupbody popuphover">
<li><a href="http://www.newcelica.org">Install Guides</a></li>
<li><a href="http://partscatalog.newcelica.org/page.php">Parts Catalog</a></li>
<li><a href="http://tracktimes.newcelica.org/index.php">Track Times</a></li> 
<li><a href="dynodb.php">Dyno Database</a></li> 
<li><a href="http://www.newcelica.org/other/technical/index.htm">Technical Information</a></li> 
<li><a href="http://www.newcelica.org/other/store/index.htm">NC.org Gear</a></li> 
</ul>
</li>

</vb:if>

The plugin hook calls nco_extra_navbar so why when I load my dynodb.php page does it not highlight the Features tab? It highlights the forums tab regardless of how I browse to the dynodb.php page

http://vb.newcelica.org/dynodb.php


All times are GMT. The time now is 09:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02627 seconds
  • Memory Usage 1,877KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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