1
Hi!
I created an array in header.php file named "$xoops_usergroups", a list of groups the user belongs to. BTW, this is the code:
Quote:
$xoopsTpl->assign( 'xoops_usergroups', $xoopsUser->getGroups() );
Now I wanted to check it in smarty this way:
Quote:
<{if 16|in_array($xoops_usergroups)}>
....
<{/if}>
Check if someone belongs to group 16.
But guess what? It always returns TRUE, no matter what user checks it. I checked my test user belongs only to registered users group. I loged out and in, checked smarty console and values are the right ones.
In smarty forums, the syntax appeared like this:
Quote:
<{if 16|in_array:$xoops_usergroups}>
....
<{/if}>
But it can't be compiled, so i put array name between brackets. It compiled but gives always true.
So i used a foreach loop as a workaround, but i want to know why the former solution doesn't work.
What's wrong?