Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: russ - helmikuu 05, 2005, 06:23:14 AP

Otsikko: Group Permissions in index.template.php
Kirjoitti: russ - helmikuu 05, 2005, 06:23:14 AP
I think i put this post in the wrong forum but here it is in a different one in case someone who knows the answer hasnt looked in the other forum :)

Sorry for repeating myself...

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:

Code:
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!
Otsikko: Re: Group Permissions in index.template.php
Kirjoitti: Jerry - helmikuu 05, 2005, 07:09:15 AP
What errors do you get? you might also want to try and put the full path to ads.php :)
Otsikko: Re: Group Permissions in index.template.php
Kirjoitti: russ - helmikuu 05, 2005, 10:57:20 AP
 2: in_array(): Wrong datatype for second argument
File: /homepages/htdocs/smf/Themes/default/shout.template.php (eval?)
Line: 676

Back

Notice: Array to string conversion in /homepages/htdocs/smf/Sources/Subs.php on line 1801
Otsikko: Re: Group Permissions in index.template.php
Kirjoitti: Kirby - helmikuu 05, 2005, 02:07:38 IP
have you globalled $user_info? why not just use $context['user']?
Otsikko: Re: Group Permissions in index.template.php
Kirjoitti: russ - helmikuu 05, 2005, 03:43:03 IP
does that work for groups tho? if u use $context['user']?

could u jus global $user_info at the top of index.template.php and it might work?
Otsikko: Re: Group Permissions in index.template.php
Kirjoitti: Kirby - helmikuu 07, 2005, 04:46:57 IP
yeah, you can do that
$context['user'] would be better in themes though, IMHO