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 01-19-2010 02:41 AM

Quote:

Originally Posted by Steve M (Post 1959836)
Lynne,

How would I construct the if condition for a link like so:
Code:

misc.php?do=rules

Perhaps something like:
PHP Code:

if (THIS_SCRIPT == 'misc' AND $_REQUEST['do'] == 'rules'


Mythotical 01-19-2010 02:46 AM

Quote:

Originally Posted by Lynne (Post 1959857)
Perhaps something like:
PHP Code:

if (THIS_SCRIPT == 'misc' AND $_REQUEST['do'] == 'rules'


Tried that before and didn't work, did it again then realized I needed to change my template.

Thanks

Kinneas 01-19-2010 08:22 AM

Lynne,

Is there any way to add an extra tab using this method, while retaining the same tablinks as are used on the Forum tab?

For my example, I'm trying to add a "Home" tab for vBa CMPS, but want to keep all the links you find on the Forum one.

Lynne 01-19-2010 04:14 PM

You may just copy all the links for the Forum tab.

foesracing 01-19-2010 07:08 PM

I'm trying to create a forum for Traveling. I've downloaded and installed vBh that allows me to add extra tabs. These tabs only link to another site.

I want to create a Nav menu like this "Forum | Travel | Hotels | Car Rental"

When the user clicks on a tab, it will open the tab in the same window but it would be about the topic the user click on. I've seen on other sites that this is possible. Just wondering how it's done. Please provide some details. I'm on vB 4.0.1, just in case you need to know the version. Thanks.

Lynne 01-19-2010 07:11 PM

I can't tell you how to use the other mod - I have no idea how it works. This article will tell you how to create a navtab, such as Travel, and you link it to your forumdisplay.php page for that forum. If you want the tab highlighted at that point, then do an if condition based on the $forumid.

saajjj 01-19-2010 08:11 PM

1 Attachment(s)
Hi Lynne,
This might either be slightly off topic or may perhaps help others if added to your initial post. My search on changing tab order didn't return any useful results. However if whatever I've written is a commonly known solution, please disregard and delete the post :)

All,
It seems many people have asked about reordering tabs in the nav bar.

As mentioned in many places there are three template hooks which allow you to place your new tab:
- navtab_start
- navtab_middle
- navtab_end

Lynne has used the navtab_end hook which is in the last line of the PHP Code:
Code:

$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ;
I'm going to assume the default tabs as:
Forum | Blogs | What's New

If we use the Lynnes way of creating a tab as explained here, but use the navtab_middle hook like:
Code:

$template_hook['navtab_middle'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ;
then the new tab comes between Forum and Blogs. But we want to add the tab after Blogs. To move over the new tab after Blogs just change the execution order from 5 to 6. So by using different execution orders in different plugins you can place your tabs in any order you want within the same template hook. You could of course generate all tabs from one plugin and use code execution order to place the tabs.

This is the only reliable solution I have found and am using it on my own forum (img attached). I'm open to other methods as well.

Cheers

foesracing 01-19-2010 08:44 PM

Lynne,

Can you post the link.php code you mention in the very first post of the thread.

$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ;

I would like to see how link.php is written.

Thanks.

Lynne 01-19-2010 09:34 PM

Quote:

Originally Posted by foesracing (Post 1960588)
Lynne,

Can you post the link.php code you mention in the very first post of the thread.

$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ;

I would like to see how link.php is written.

Thanks.

link.php is a fictitious page. It is whatever page you want to link to.

foesracing 01-19-2010 11:45 PM

Quote:

Originally Posted by Lynne (Post 1960619)
link.php is a fictitious page. It is whatever page you want to link to.


I understand that. I just want to see how another page is written, which variable is need to recreate the same page as forum.php but displaying a different information. I know how to code php but don't know the structure of how vbulletin assembles its code.


All times are GMT. The time now is 02:18 PM.

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.01436 seconds
  • Memory Usage 1,751KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)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