Is it possible to write an if statement in the page.tpl.php file that first gets the user role and then compares it to a string and it either shows the logo or doesn't. Something like....

//some how get user role

global $user;
$user_fields = user_load($user->uid);

$current_role = $user_fields->role[];

if ($current_role == "public_user"){
>?
print $front_page; " title=" print t('Home'); " >
Only local images are allowed. print $logo; " alt=" print t('Home'); " />

?>
}else{
//don't show.
}

Comments

gjangelo’s picture

Because users can have more than one role -- like "authenticated user" AND "classifieds editor" -- the values are in an array. so, something like this:

global $user;
$output = '';
if (in_array('premium user',$user->roles)) {
   $output .= 'Instructions on how to ';
   $output .= '<a href=/sites/all/assets/updating-a-profile.doc">Update Your Profile</a>.';
}
return $output;

alternatively, check for access within role, by permissions (not role):

if (user_access('Administer Nodes')) {
$block_content .= 'user has access';
}
else {
$block_content .= 'no access';
}