Mostrare contenuti diversi ai visitatori e agli utenti registrati

tags: Drupal   php snippets  
drupal tags: users   contents  

<?php
/**
* The following simple snippet
* displays different information to anonymous/logged in users within a page.
*
* This works with drupal 4.5 and drupal 4.6
*/
global $user;
if (
$user->uid) {
    return
"This message is only visible for logged-in users.";
}
if (!
$user->uid) {
    return
"This message is only visible for not-logged-in users.";
}
?>


Vedi anche:

Invia nuovo commento

Il contenuto di questo campo è privato e non verrà mostrato pubblicamente.
  • Allowed HTML tags: <a> <em> <p> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <img> <hr>
  • Linee e paragrafi vanno a capo automaticamente.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Indirizzi web o e-mail vengono trasformati in link automaticamente

Maggiori informazioni sulle opzioni di formattazione.

Archivio

Maggio 2012
DomLunMarMerGioVenSab
12345
6789101112
13141516171819
20212223242526
2728293031
PureDivs Conversione Temi Drupal
PureDivs Conversione Temi Drupal