Per user message
Amitaibu - July 22, 2007 - 06:48
| Project: | Admin message |
| Version: | 5.x-1.x-dev |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi,
Thanks for the module.
Currently I'm using the Views_bookmark, in order to dismiss messages per user.
Will your module support Per User message?
Cheers,
Amitai

#1
You mean a message only to a specific user? I would guess that privatemsg is better for that sort of thing. But the PHP visibility option included in this module is quite flexible. To show a message only to a user with uid 35 you can put this in the form (not tested):
<?phpglobal $user;
return $user->uid == 35;
?>
#2
#3
#4
as a drupal newbie and a PHP uninitiated would
<?phpglobal $user;
return $user->role == anonymous;
?>
show the message only to anonymous users?
#5
I already found the answer in the snippets
<?phpglobal $user;
if (in_array('anonymous',$user->roles)) {
return TRUE;
} else {
return FALSE;
}
?>
does it!! Actually you can replace anonymous with any other role.