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)

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.


All times are GMT. The time now is 05:38 AM.

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.02706 seconds
  • Memory Usage 1,755KB
  • 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
  • (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