By manoloka on
Hi there,
I use a snippet to display certain content (within contemplate) only if user is anonymous using this code.
<?php
//sacar el variable array cargado del usuario
global $user;
//si el uid es igual a cero (es anonimo)
if ($user->uid == 0) {
//despleje lo que le coresponde al usuario anonimo
print 'MyContent blah blah';
}
?>Now I'd like to display that content but only if author is certain role.
I found this post (http://drupal.org/node/379246) that shows how to accomplish this for a block, so I guess the code could be somehow reusable/combined.
Any ideas how to accomplish that?
Comments
^
This comment looks like the one you need: http://drupal.org/node/379246#comment-1346140
What's new and changing in PHP 8.4
mmm ... something similar but
mmm ... something similar but not yet there, somehow breaks all the html ...
I meant that the function to
I meant that the function to disappear seems to be working but it breaks the rest of the html therefore the whole page is looking a mess.
^
are all HTML tags closed correctly ?
Above code doesn't output anything other than print statements so it's likely that there are some open HTML tags.
What's new and changing in PHP 8.4