Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 08-19-2014, 09:04 PM
RisingGlow RisingGlow is offline
 
Join Date: Feb 2012
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Dealing with Navigation Manager

I recently decided it was time to upgrade vBulletin to the latest v4.
The biggest issue here is the navbar and it's tabs.

What I used to have it as before was the forum home page would show the tabs Forum, Blogs, and other plugins' tab like vBshop. However, I had a custom page where if you were on it, it wouldn't show Blogs or vBshop tabs. It would show other tabs that I assigned it to show ONLY on that specific page via THIS_SCRIPT. This is still possible for me because I'm adding tabs, not removing. It was easy for me to do just by editing the navtab template or sometimes creating a small plugin. Now after 4.2, I can't do that anymore.

I am wondering if there is an easy way hide a tab by the script it's running or somehow create something like this.
Reply With Quote
  #2  
Old 08-19-2014, 09:41 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have not tried this, but it should work.

Create a show variable with your script name (THIS_SCRIPT), I am using 'faq' as my example tab and script:
Code:
// hook: load_show_variables

$show['this_faq'] = THIS_SCRIPT === 'faq' ? true : false;
    //var_dump($show['this_faq']);  // Diagnostic
In the navigational manager under your new tab find "Show Permission Name" and add in the text-area field: this_faq

I will test this a bit later when I get a chance, but give it a whirl.

------------------------------------

You can add additional show variables you created by using a "." between the variables (. = AND). I think the help button gives an example.

$show['faq_notab'] - shuts off this tab under certain conditions -- Just create a new show variable, like above.
Example: this_faq.faq_notab (Combined permissions on "Show Permission Name")

I am not sure the example conditions would ever exist in combination... I was just trying to throw an example together quickly.
Reply With Quote
  #3  
Old 08-20-2014, 12:56 AM
RisingGlow RisingGlow is offline
 
Join Date: Feb 2012
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
I have not tried this, but it should work.

Create a show variable with your script name (THIS_SCRIPT), I am using 'faq' as my example tab and script:
Code:
// hook: load_show_variables

$show['this_faq'] = THIS_SCRIPT === 'faq' ? true : false;
    //var_dump($show['this_faq']);  // Diagnostic
In the navigational manager under your new tab find "Show Permission Name" and add in the text-area field: this_faq

I will test this a bit later when I get a chance, but give it a whirl.

------------------------------------

You can add additional show variables you created by using a "." between the variables (. = AND). I think the help button gives an example.

$show['faq_notab'] - shuts off this tab under certain conditions -- Just create a new show variable, like above.
Example: this_faq.faq_notab (Combined permissions on "Show Permission Name")

I am not sure the example conditions would ever exist in combination... I was just trying to throw an example together quickly.
Ah this works perfect. Thanks!
Reply With Quote
  #4  
Old 08-20-2014, 02:25 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad to hear.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:00 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.13836 seconds
  • Memory Usage 2,189KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete