Hi,
I wrote a div in page.tpl in drupal 7. The div carries a static image in it. I want the image to be displayed only when no user is logged in. Once if any user log in the div should not display. I am trying to work out with some loop but could not get any clue. Please any help?

Thanks.

Comments

ryangambito’s picture

<?php
if(user_is_logged_in()){
   //do something here for logged in users
}
else{
   //do something here for non logged in users
}
?>
chaithanya.kvk’s picture

Thanks lot! it worked for me.