vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom Logged On User Menu Question (https://vborg.vbsupport.ru/showthread.php?t=113219)

Duckfather 04-17-2006 08:46 AM

Custom Logged On User Menu Question
 
Hi all

I have an external menu which I want to use in an external menu.php file. I've added it as a plugin using the following code I dound on here :-

ob_start();
include('menu.php');
$includedMenuphp = ob_get_contents();
ob_end_clean();

I've used the Hook Location of global_start. This should mean that I can reference the $includeMenuphp variable most anywhere and get the menu to display. This works fine until I attempt the following code to get it to display only for logged on users (code added in the navbar template) :-

<if condition="$bbuserinfo[usergroupid] != 0">
$includedMenuphp
</if>

I've also tried using the $includedMenuphp variable just by itself with no conditionals and it doesn't show.

It just doesn't show at all, no matter what I do

Anyone got any ideas?

Cheers in advance

Andy

Freesteyelz 04-18-2006 01:35 AM

I'm not sure why your code, without the conditional, is not working. However, you try changing the conditional to:

Code:

<if condition="is_member_of($bbuserinfo, x, y, z)">
        $includedMenuphp
</if>

By using "is_member_of" the code is looking for both primary and secondary Usergroups. Where "x", "y" and "z" are replace them with the Usergroup ID's.


All times are GMT. The time now is 12:02 AM.

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.01095 seconds
  • Memory Usage 1,707KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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