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)

JErix 11-22-2011 07:17 PM

Thanks for the tut. I'm a complete newb and it took a little reading, but, I got it figured out. :)

kfyonur 11-30-2011 10:17 AM

thank you lynee very nice.

kfyonur 12-04-2011 10:39 AM

is it correct ?

Code:

$tabselected = '';
$tablinks = '';
if ($GLOBALS['forumid'] == 66)
{
    $vbulletin->options['selectednavtab']='audiservis';
    $tabselected = ' class="selected"';
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.audiclubtr.com/f66/">Audi Servis</a>'.$tablinks.'</li>' ;


Lynne 12-05-2011 04:06 AM

It looks correct. Did you try it?

GE-Tom 12-05-2011 09:37 AM

It is correct. Works fine with my urls.

@ Lynne

mutch thanks for this great tutorial. helps me a lot. now i only must finde out how i add a dropdown for my main menu tab.

gm139 12-11-2011 07:56 PM

I am using vbulletin suite 418. I would like to add 3 tabs on the navbar, so I have copied your code 3 times in the plugin.
Each tab points to to the page content.php, followed by different parameters for each page. Links work, so when I click on a tab the correct page is shown, but the tab is not highligheted. Any suggestion?

Lynne 12-11-2011 08:22 PM

Quote:

Originally Posted by gm139 (Post 2276844)
I am using vbulletin suite 418. I would like to add 3 tabs on the navbar, so I have copied your code 3 times in the plugin.
Each tab points to to the page content.php, followed by different parameters for each page. Links work, so when I click on a tab the correct page is shown, but the tab is not highligheted. Any suggestion?

You need to create a unique condition for each page. Replace this:
PHP Code:

if (THIS_SCRIPT == 'yourpage'

With a unique condition for the page. It does not have to be a condition based on the variable THIS_SCRIPT. It may be any unique condition.

gm139 12-11-2011 08:51 PM

Quote:

Originally Posted by Lynne (Post 2276851)
You need to create a unique condition for each page. Replace this:
PHP Code:

if (THIS_SCRIPT == 'yourpage'

With a unique condition for the page. It does not have to be a condition based on the variable THIS_SCRIPT. It may be any unique condition.

As suggested at post 423 I have modified the script in this way but it does not work yet.

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'vbcms' && $_SERVER['REQUEST_URI'] == '/content.php?3-prossima-trasferta')
{
    $vbulletin->options['selectednavtab']='prossima-trasferta';
    $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_end'] .= '<li'.$tabselected.'><a class="navtab" href="content.php?3-prossima-trasferta">Prossima trasferta</a>'.$tablinks.'</li>' ;


Hippy 12-11-2011 09:33 PM

Code:

if (THIS_SCRIPT == 'vbcms' && $_SERVER['REQUEST_URI'] == '/content.php?3-prossima-trasferta')
the line above should only read
Code:

if (THIS_SCRIPT == 'vbcms')
I think..

gm139 12-11-2011 10:22 PM

Quote:

Originally Posted by Hippy (Post 2276883)
Code:

if (THIS_SCRIPT == 'vbcms' && $_SERVER['REQUEST_URI'] == '/content.php?3-prossima-trasferta')
the line above should only read
Code:

if (THIS_SCRIPT == 'vbcms')
I think..

no, because I call the content.php from different tabs.


All times are GMT. The time now is 05:47 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.01876 seconds
  • Memory Usage 1,748KB
  • 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
  • (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
  • (1)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