Group Permissions in index.template.php

Started by russ, February 04, 2005, 07:00:35 AM

Previous topic - Next topic

russ

Ive re-dun most of my index.template.php file to allow the design to fit in nicely with the rest of my site but theres one thing i havent managed to do so far... there are various ads around the place in index.template.php and i would like to "hide" these ads if say a members changes group - ive tried:


if (in_array(55, $user_info['groups']))
{
}
else
{
include("ads.php");
}


but i got errors. is this not the correct way of doing it? is there a better way :) suggestions appreciated!

russ

i guess i could call it in from another file using iframes but i hate them.... :(

russ

update: ive tried it again but i still get errors, i guess ive got the wrong variables in the index.template.php file :(

[Unknown]

Use $GLOBALS['user_info'] instead of $user_info.

-[Unknown]

russ

so it shuld look liek this?

if (in_array(55, $GLOBALS['user_info']['groups']))
{
}
else
{
include("ads.php");
}

[Unknown]

That would show the ads to anyone NOT in group #55, yes.

-[Unknown]

Advertisement: