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
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

fajerstarter - July 22, 2007 - 08:43

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

fajerstarter - August 12, 2007 - 13:53
Status:active» fixed

#3

Anonymous - August 26, 2007 - 14:04
Status:fixed» closed

#4

pjek - February 26, 2008 - 04:47

as a drupal newbie and a PHP uninitiated would

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

show the message only to anonymous users?

#5

pjek - February 27, 2008 - 00:33

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.

 
 

Drupal is a registered trademark of Dries Buytaert.