vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Dealing with Navigation Manager (https://vborg.vbsupport.ru/showthread.php?t=313808)

RisingGlow 08-19-2014 09:04 PM

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.

tbworld 08-19-2014 09:41 PM

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. :)

RisingGlow 08-20-2014 12:56 AM

Quote:

Originally Posted by tbworld (Post 2512032)
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!

tbworld 08-20-2014 02:25 AM

Glad to hear. :)


All times are GMT. The time now is 10:28 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.01029 seconds
  • Memory Usage 1,719KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete