vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   vB4.2 Navigation Manager - how to discussion (https://vborg.vbsupport.ru/showthread.php?t=283146)

Boofo 05-26-2012 10:19 PM

Okay!

Christos Teriakis 05-27-2012 07:12 AM

Quote:

Originally Posted by Paul M (Post 2330700)
Custom $show variables can be created pretty much in any hook, as the navigation is almost the last thing built, but two common ones added for the purpose are load_show_variables & load_forum_show_variables.

If you don't mind, can you help me on how to convert a condition like:
Code:

<vb:if condition="$vbulletin->userinfo['permissions']['classifieds'] & $vbulletin->bf_ugp['classifieds']['moderate']">
to work as $show. I know that there are variables/condiltions like: $show['member'], but I was always using the above style.

Thank you
Chris

Boofo 05-27-2012 07:32 AM

Maybe something like this?

Code:

if (condition="$vbulletin->userinfo['permissions']['classifieds'] & $vbulletin->bf_ugp['classifieds']['moderate']") $show['classifieds'] = true;

Christos Teriakis 05-27-2012 07:36 AM

Quote:

Originally Posted by Boofo (Post 2333423)
Maybe something like this?

Code:

if (condition="$vbulletin->userinfo['permissions']['classifieds'] & $vbulletin->bf_ugp['classifieds']['moderate']") $show['classifieds'] = true;

Thank you. I'll try it. I suppose that I can add multiple conditions and end them like $show['classifieds_post'] = true, or $show['classifieds_moderate'] = true etc.

Thanks again
Chris

Boofo 05-27-2012 08:34 AM

Sure you can. As another example, here is one I use in the load_show_variables hook:

Code:

if ($vbulletin->products['adv_product_management4'] == 1) 

    $show['modtools_apm'] = true; 
    $show['modtools_pm'] = false; 

else 

    $show['modtools_apm'] = false; 
    $show['modtools_pm'] = true; 
}


If APM is installed it will use that link. If not, it default to the vb product manager.

I also use the show variables in the navigation_tab_complete, but you have to globalize it in that hook, as well as $vbphrase if you use that there, too.

Lionel 05-29-2012 03:33 AM

I found it to be much easier to use old system but at navtab_start and navtab_end.
then at navigation_tab_complete I empty $tabid for THIS_SCRIPT. This way I can keep all my dynamic navigations.

nhawk 05-29-2012 10:25 AM

A word about using the built in Navigation Manager...

If you use it as built in vB 4.2.0, add navtabs, menus or links and then delete them, the phrases used by those items are left behind in the phrase table.

Evidently it was designed to leave unused data in the database...

http://tracker.vbulletin.com/browse/VBIV-15177

Unfortunately, for some reason I don't have the option to petition to reopen that bug.

Altari 05-29-2012 02:20 PM

Hello,

I try to add 3 links in the Quick Links menu, but that doesn't work : Sometimes nothing is shown, sometime only the last link is shown... i don't really why, maybe someone could help me ?

Here is the code i'm using (tried to do it from Paul's blog) in build_navigation_array hook

PHP Code:

if ($show['member']) 

    
$userid vB::$vbulletin->userinfo['userid'];
    if (
vB::$vbulletin->options['rescue_lienannoncesonoff'] == 1
    {
        
$lien_mesannonces = array( 
            
'name' => 'rescue_commu_annonces'
            
'navtype' => 'link'
            
'url' => '{options.toppath}member.php?u='.$userid.'&tab=afficher_annonces',
            
'active' => 1
            
'productid' => 'rescue'
            
'text' => 'Mes annonces'
        ); 
        
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_commu_annonces'] = $lien_mesannonces;
    }
    
    
$lien_messujets = array( 
        
'name' => 'rescue_messujets'
        
'navtype' => 'link'
        
'url' => '{options.toppath}search.php?do=finduser&userid='.$userid.'&starteronly=1&contenttype=vBForum_Thread',
        
'active' => 1
        
'productid' => 'rescue'
        
'text' => 'Mes sujets'
    ); 
    
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_messujets'] = $lien_messujets;
    
    
$lien_mesmessages = array( 
        
'name' => 'rescue_mesmessages'
        
'navtype' => 'link'
        
'url' => '{options.toppath}search.php?do=finduser&userid='.$userid.'&starteronly=1&contenttype=vBForum_Post&showposts=1',
        
'active' => 1
        
'productid' => 'rescue'
        
'text' => 'Mes messages'
    ); 
    
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_mesmessages'] = $lien_mesmessages;
    unset(
$userid);



Boofo 05-29-2012 02:56 PM

You need to add this at the very top:

Code:

global $show;

And try the navigation_tab_complete hook instead.

Altari 05-29-2012 04:16 PM

Quote:

Originally Posted by Boofo (Post 2334311)
You need to add this at the very top:

Code:

global $show;

And try the navigation_tab_complete hook instead.

Hello,

Thank you for your help,
But this doesn't work better : I added the global show and change template hook, but nothing happen. I use VBOptimise(?), but i flushed the cache, cleared system cache etc... Nothing works like that :(

Anyway, i'm just trying to add this to start, and it doesn't work :
PHP Code:

global $show;
if (
$show['member'] == TRUE

    
$lien_messujets = array( 
        
'name' => 'rescue_messujets'
        
'navtype' => 'link'
        
'url' => '{options.toppath}search.php?do=finduser&userid='.$userid.'&starteronly=1&contenttype=vBForum_Thread',
        
'active' => 1
        
'productid' => 'rescue'
        
'text' => 'Mes sujets'
    ); 
    
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_messujets'] = $lien_messujets;




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.01212 seconds
  • Memory Usage 1,769KB
  • 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
  • (6)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
  • (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