View Single Post
  #111  
Old 01-02-2010, 09:55 PM
Meje Meje is offline
 
Join Date: Oct 2007
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the reply Lynne.

I want the tab to stay selected, when I am on any of the pages in the submenu of the new tab.

Looks like it might be easier to show you the code? Its only going to make it easier for others trying to do the same thing to understand too

I have created a new tab called "Site Info'. I have also created my own VB page for it to link to.

This is the code for the plug in:

PHP Code:
$tabselected '';
$tablinks '';
if (
THIS_SCRIPT == 'ip_site_information')
{
    
$vbulletin->options['selectednavtab']='ip_site_information';
    
$tabselected ' class="selected"';
    
$tablinks '                <ul class="floatcontainer">
                        <li><a href="our_philosophy.php">Our Philosophy</a></li>
                            <li class="popupmenu">
                                <a href="javascript://" class="popupctrl">Advertising</a>
                                <ul class="popupbody popuphover">
                                        <li><a href="banner_advertising.php">Banner Advertising</a></li>
                                        <li><a href="sig_advertising.php">Signature Advertising</a></li>
                                    
                                </ul>
                            </li>
                        <li><a href="donations.php">Donations</a></li>
                        <li><a href="sendmessage.php.php">Contact Us</a></li>
                </ul> '
;


$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="ip_site_information.php">Site Info</a>'.$tablinks.'</li>' 
and this is the condition in my 'Site Info' VB page I created:

PHP Code:
define('THIS_SCRIPT''ip_site_information'); 
Everything works as it should with all the above code for the Site Info tab & Page.

I have 4 other VB pages I created myself. They are the the ones listed in the submenu of the new tab "Site Info' See first image attached.

For these 4 links in the submenu, the condition in each of their VB pages is as follows:

Our Philosophy Page:
PHP Code:
define('THIS_SCRIPT''our_philosophy'); 
Advertising is a drop down menu, so contains the 2 links, 'Sig Advertising' and 'Banner Advertising' that have their own VB pages.

Sig Advertising Page:
PHP Code:
define('THIS_SCRIPT''sig_advertising'); 
Banner Advertising Page:
PHP Code:
define('THIS_SCRIPT''banner_advertising'); 
Donations Page:
PHP Code:
define('THIS_SCRIPT''donations'); 
Now when I click on any of these links, you can see what happens in the second attached image, that while it takes me to the page I want it to, the tab thats selected is the Forum tab and all its submenus. Where as I want the new tab, 'Site Info' and all its submenus to remain selected when I click on these submenu links.
Attached Images
File Type: png Screen shot 2010-01-03 at 10.36.48 AM.png (31.3 KB, 0 views)
File Type: png Screen shot 2010-01-03 at 10.37.14 AM.png (32.3 KB, 0 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01281 seconds
  • Memory Usage 1,816KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete