Project:Admin message
Version:5.x-1.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#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):

<?php
global $user;
return
$user->uid == 35;
?>

#2

Status:active» fixed

#3

Status:fixed» closed (fixed)

#4

as a drupal newbie and a PHP uninitiated would

<?php
global $user;
return
$user->role == anonymous;
?>

show the message only to anonymous users?

#5

I already found the answer in the snippets

<?php
global $user;
if (
in_array('anonymous',$user->roles)) {
  return
TRUE;
} else {
  return
FALSE;
}
?>

does it!! Actually you can replace anonymous with any other role.

nobody click here