I'm probably over thinking this, but I have site with various user levels. I'd like to create a specific var (either smarty or in PHP) in my site's header template, then based on this value, display certain code on another page. I've tried several approaches without success. I tried creating a simple function in header.php:
if( $user->level_info.level_name == Basic )
{
$basic_user == yes;
}
Then in video.tpl:
{if $basic_user == yes}
some code
{/if}
It didn't work. I also tried it in smarty (header.tpl)
{if $user->level_info.level_name == Basic}
{assign var="basic_user" value="yes"}
{/if}
Then something like if "var=xx, some code", but honestly I can't even remember how I tried that in video.tpl, but I'm sure it was wrong. Can anyone please help? I'm sure it's simple, but I'm stuck and frustrated. Thanks!
I also just tried this in video.php:
if($user->level_info.level_name != Premium){
header("Location: nopermission.php"); exit();
}
And it "works", but all users, no matter if Basic or Premium are forwarded to the no permission page. I am very confused.