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 02-22-2011 01:42 AM

You would need to write some condition that is unique to whatever "Listings" is. I don't know anything about that page since it isn't a default vb page (or is it and you are just calling it something else?), so I don't know what the condition would be. If it's a custom page, then define THIS_SCRIPT at the top of the php page, like it is defined on other vB pages, and then you can use that in the condition.

Saviour 02-22-2011 11:37 PM

Lynne,

Please be gentle with me on this...I've looked over your instructions...and I'm sitting here scratching my head.

I have a mod installed called Chatbox Evo. There is no option in this mod to add a link to the navbar, or to the community link menu.

I want to add a new tab on the navbar that opens the chatbox in full-page mode. I want to name this tab "Chat"...and it will be viewable by all who visit the site.

The link to call the full-size chatbox is as follows:
Code:

http://www.glitchpcforums.com/forum/mgc_cb_evo.php?do=view_chatbox
Now...can you give me step by step as to what I need to do? Thanks, in advance.

Lynne 02-23-2011 12:18 AM

Not really. I don't know anything about the code for that mod. You may want to ask the developer if there is a THIS_SCRIPT set on that page that you can use in the condition. Then you could do something like:
PHP Code:

if (THIS_SCRIPT == 'whatever_for_chat_mod' AND $_GET['do'] == 'view_chatbox'

So, something like that may work.

Saviour 02-23-2011 02:58 PM

Quote:

Originally Posted by Lynne (Post 2165626)
Not really. I don't know anything about the code for that mod. You may want to ask the developer if there is a THIS_SCRIPT set on that page that you can use in the condition. Then you could do something like:
PHP Code:

if (THIS_SCRIPT == 'whatever_for_chat_mod' AND $_GET['do'] == 'view_chatbox'

So, something like that may work.

Lynne...

Thank you for the reply...

Yes, there is a THIS_SCRIPT set on the page:
Code:

define('THIS_SCRIPT', 'mgc_cb_evo');
So...what I'd like to do is setup a tab (labeled "Chat"), with no sub-menu links...so that when a user clicks the "Chat" tab, they are directed to the chat, itself.

Can you provide me with the code, or the modifications from your code...in order for me to complete this? I don't want to remove any lines of code from what you have given us...and leave myself hanging. I do understand coding...a little, but don't want to leave myself in a bind.

Thanks, in advance...

davepkr 02-23-2011 04:25 PM

This is PERFECT for creating only a TAB, this is what I was looking for.

Quote:

Originally Posted by thunderclap82 (Post 1927043)
Do you have to create your own vBulletin page to use this? I created a section and am trying to use this tutorial to go to that section, yet I can't get the navbar to highlight. Here is the code as I have it now (I removed the submenu link code):

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'podcast')
{
    $vbulletin->options['selectednavtab']='podcast';
    $tabselected = ' class="selected"';
    $tablinks = '
                <ul class="floatcontainer">
                       
                </ul> ';
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="/forums/content/116-podcast">Podcast</a>'.$tablinks.'</li>' ;



Saviour 02-23-2011 05:32 PM

Update...

Got 'er done! Thanks for the help...much appreciated.

Bellinis 03-02-2011 11:04 AM

Quote:

Originally Posted by Saviour (Post 2165897)
Update...

Got 'er done! Thanks for the help...much appreciated.

Tell me, how did you do it? I'd like to do the same :)

farrellzach 03-06-2011 10:52 PM

Hi Lynne, I've read through a few of the posts here regarding having the forum tab highlighted along with the new tab. I added the tab fine, I'm using a UserCP tab, but the forum tab is highlighted when I click it.

Here's my plugin code
Code:

if (THIS_SCRIPT == 'UserCP')  // also defined('UserCP') possible
{
//set selected tab
    $vbulletin->options['selectednavtab'] = 'UserCP';
}
// add the "subtemplate" to the navbartemplate
$template_hook['navtab_end'] .= vB_Template::create('UserCP Nav Bar')->render();


Lynne 03-06-2011 11:18 PM

There is not default vbulletin script named "UserCP", so is this on a custom page? And, you cannot have a template called "UserCP Nav Bar" - you may not have spaces in a template name.

I really don't get what you are doing with your plugin code at all and I don't see the tab code in there either.

Guest210212002 04-10-2011 09:12 PM

This is working just fine for me, and (as usual!) thank you, Lynne. :)

One quick question, here's my code - I'm just adding a link to vaispy. Everything works as it should, and I just removed the default dropdown menus from your code.

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'vaispy')
{
    $vbulletin->options['selectednavtab']='mgtab_forumspy';
    $tabselected = ' class="selected"';
    $tablinks = '';


$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="(my test tld)forum/vaispy.php">ForumSpy</a>'.$tablinks.'</li>' ;

Is there a quick way to get the default set of tablinks (dropdowns) that are on forumhome/etc on a custom page? Right now my tab/link works perfectly, but I have no submenus. I'd like to add the usual things like User CP, Community and such back to the sublinks.

Thanks!


All times are GMT. The time now is 03:05 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.01735 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
  • (5)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