In page.tpl.php I'm displaying a link for user page. For an example:
<?php echo l(t("My offers"), 'user/' . $user->uid . '/offers'); ?>
So when a user clicks on the link it goes to user/uid/offers.
Now I want to show this link only based on a role. Let's say we have a role "Seller" that has unique ID 5 in the database. How can I set
<?php echo l(t("My offers"), 'user/' . $user->uid . '/offers'); ?>
to be visible only when a user has a role "Seller"?-
var_dump($user)
, you will see$user->roles
. Come on, you can test variables on your own :D – Mołot Jan 22 '14 at 15:52