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)

Andreas 05-29-2012 09:22 PM

Quote:

Originally Posted by Altari (Post 2334427)
Awww that works perfectly, thank you !
For guys who read : Add an id...

... a unique ID or you will run into problems sooner or later ;)

Badshah93 05-30-2012 03:51 AM

Quote:

Originally Posted by Andreas (Post 2334465)
... a unique ID or you will run into problems sooner or later ;)

chances are very less, because all the links inside menu generated through navigation manager has id in range of (20 - 50 +), so one can use any id between 1-20 for links inside menu. (per menu).

A higher number will be much better (ex: 1001)

OR

Get the last navid of link in menu.

PHP Code:

$lastnavid array_pop(array_keys($result['vbtab_forum']['links']['vbmenu_qlinks']['links']));
$lastnavid $result['vbtab_forum']['links']['vbmenu_qlinks']['links'][$lastnavid]['navid']; 

So, last code which i gave to one of the user will be like this

PHP Code:

if (vB::$vbulletin->userinfo['userid'])  

$userid vB::$vbulletin->userinfo['userid']; 
$lastnavid array_pop(array_keys($result['vbtab_forum']['links']['vbmenu_qlinks']['links']));
$lastnavid $result['vbtab_forum']['links']['vbmenu_qlinks']['links'][$lastnavid]['navid'];

$lien_messujets = array(   
        
'name' => 'rescue_messujets',   
        
'navtype' => 'link',   
        
'url' => '{options.toppath}search.php?do=finduser&userid='.$userid.'&starteronly=1&contenttype=vBForum_Thread',  
        
'active' => 1,   
        
'text' => 'Mes sujets'
        
'productid' => 'vbulletin',
        
'navid' => $lastnavid++   
    );   
$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' => 'vbulletin',  
    
'text' => 'Mes messages',
    
'navid' => $lastnavid++ 
);  
$lien_mesannonces = array(  
    
'name' => 'rescue_commu_annonces',  
    
'navtype' => 'link',  
    
'url' => '{options.toppath}member.php?u='.$userid.'&tab=afficher_annonces'
    
'active' => 1,  
    
'productid' => 'vbulletin',  
    
'text' => 'Mes annonces',
    
'navid' => $lastnavid++  
);  
     
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_messujets'] = $lien_messujets
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_commu_annonces'] = $lien_mesannonces
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_mesmessages'] = $lien_mesmessages
unset(
$userid); 



Omegatron 05-30-2012 06:09 PM

What I need to know is how to use the $vbulletin options in a url in the navigation manager

Paul M 05-30-2012 09:14 PM

{options.optionname}

AusPhotography 05-30-2012 10:31 PM

Quote:

Originally Posted by Paul M (Post 2334852)
{options.optionname}

Can we have a Article outlining what objects are available ?
I know of...
  • {options.__}
  • {session.__}
  • {userinfo.__}
What else is available?
Can we have custom objects?

Thanks!

Kym

Edit: Found the answer in the code.
See: function process_navigation_linkvars($url) in ./includes/functions.php :D
Anything in $GLOBALS or in $vbulletin->object where object is options, userinfo etc.

Merenguista 05-31-2012 10:47 AM

1- I want add a new Tab, what shoup i put in Tab Script(s) ?

2- I want add a menu and link only for Users Awaiting Moderation, what shoud i put in Show Permission Name ?

AusPhotography 06-01-2012 03:00 AM

We use Photopost vBgallery and it runs in a different root path to the forum...
eg: ./forurm vs ./gallery
As a result any relative paths in the Tabs fail when in the Gallery unless you do some edits in the Navigation Manager.

I've built an interim product file for vBgallery 3.01 that has support for the new vB4.2.0 navigation. (I can't post it due to (c) reasons).

Chuck @ Photopost has my code and will release an update for vBgallery (soon-ish I hope)

nhawk 06-01-2012 08:20 AM

Quote:

Originally Posted by Merenguista (Post 2335018)
1- I want add a new Tab, what shoup i put in Tab Script(s) ?

The name of the php script that makes the tab the active tab. The script must supply it's name with this code...

Code:

define('THIS_SCRIPT', 'thenameofthescript');
Quote:

Originally Posted by Merenguista (Post 2335018)
2- I want add a menu and link only for Users Awaiting Moderation, what shoud i put in Show Permission Name ?

I don't think there's a standard $show variable for that usergroup so you would need to create a custom one in a plugin. Call it something like... uamod ...and put that in the Show Permission Name. The create a plugin with this code...

Code:

if(is_member_of($vbulletin->userinfo,3))
{
        $show['uamod'] = true;
}

That code can be used in either the 'parse_templates' or the 'process_templates_complete' hook.

cjwinternet 07-06-2012 08:39 PM

<removed>

KGodel 07-21-2012 01:12 AM

Hey guys. I am having an issue with some Show Permissions. I have successfully gotten some working, creating the hook for each special usergroup, however when I add them together, so say I want usergroups X, Y, and Z to see a link, each having a separate $show variable in the hook I have created, when I combine them such as "showx.showy.showz" this seems to make the link appear only if a user is in ALL groups. Is there a character I am supposed to use aside from the dot to create an "or" combination versus and "and" combination? Thanks!


All times are GMT. The time now is 12:35 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.01918 seconds
  • Memory Usage 1,768KB
  • 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
  • (2)bbcode_php_printable
  • (5)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