Last updated March 19, 2009. Created by joachim on January 1, 2007.
Edited by -Shaman-, iandickson. Log in to edit this page.
Altering the node.tpl file can be used to control where user pictures appear (provided that you have turned them on in User Settings and Theme of course).
For example I had a site which comprised formal pages where avatars were NOT wanted, and a Forum where they were.
In English this means "if the user has a Picture AND the page content TYPE is a FORUM POST - print the picture" (and if it's any other part of the site, then don't print the picture...).
<?php if ($picture && $type == 'forum') {
print $picture;
}?>
Comments
worked a bit different
As I tried the code from above I received a Parse Error.
What worked for me:
(Displays the picture everywhere but in events.)
<?phpif ($picture && $type != 'event'):
?>
<?phpprint $picture
?>
<?phpendif;
?>
Can I use OR here to give
Can I use OR here to give more options in displaying the picture? For instance, in my case, I want to OR your given statement since I want to display user pictures in FORUM and SOLUTION content types but no pictures for the rest of the content types.
Jess
Math Resource Center
Worked for me
Worked great -- make sure you enable "User picture in posts" on your theme, or else there's no function.
"What the world needs is more geniuses with humility; there are so few of us left." - Oscar Levant