Log in

View Full Version : Custom Logged On User Menu Question


Duckfather
04-17-2006, 08:46 AM
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:


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