If like me you are not a big fan of the Log Message functionality of Drupal (the one that adds a "Log Message" textarea at the bottom of each node form), then here is a small php snippet override to add to the template.php file of your theme to definitely hide the Message Log:
/**
* Override node form and remove "Log message" textarea
*/
function phptemplate_node_form($form) {
$form['log']['#access'] = FALSE;
return drupal_render($form);
}Make a good use of it ;)
Is very easy to show some contents to anonymous AND some other to authenticated users in Drupal. You'll only need to adapt the following few lines of php to output your content:
<?php
global $user;
if (!$user->uid) { ?>
<div>anonymous content here</div>
<?php } else { ?>
<div>authenticated content here</div>
<?php } ?>Yep, that easy.
Ever had the need to redirect your users to a certain page after they perform a particular task (ie: after they are invited to register to the site)?
Doing it is simple:
just translate the link in your PHPTemplate content-type file (es: node.tpl.php) from:
http://www.mywebsite.com/user/register
to:
Inglese: Come utilizzare i link dei termini ($terms) associati a ciascun nodo di Drupal per navigare altri contenuti dello stesso autore taggati con lo stesso termine?
<?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.";
}
?>| September 2010 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | ||