Below code tested with Drupal 5, not sure if it works on Drupal 6, please let me know if you try it!
Just replace your $content variable with the code below, which is in your node.tpl.php file located in your themes folder. Apologies if anyone finds fault with the below, it works, and I couldn’t find any code on the internet for it, being not a programmer it could be a little ugly, but it does work ;)
<?php if ($teaser): ?><?php global $user; // if visitor is not logged in if (!$user->uid) { // print the teaser print $content; } else { // if user is logged in print the teaser print $content; } ?><?php elseif (!$teaser): ?><?php global $user; // if anonymous visitor and content type is all except blog or page if (!$user->uid && $node->type != 'blog' && $node->type != 'page') { // lock anonymous visitors out of the full article print("<div class='messages'>Please <a href='/user/register'>register</a> or <a href='/user'>login</a> to view images!</div>"); } else { // show all content for all content types to logged in users print $content; } ?><?php endif;?>
Done!
Add to social bookmarks: del.icio.us | Tweet this: Tweet |
Term Papers
The brainchild of celebrity photographer Jeremy Cowart,Help-Portrait is a movement of photographers, coming together in every major city, to use their photography skills to give back to the community.It’s a really good article.Information was important for me.I hope you post again soon.
From this article: Help-Portrait Cork | Comment: #