Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: Aaron Nelsen on March 14, 2004, 04:19:56 AM

Title: User Avatar
Post by: Aaron Nelsen on March 14, 2004, 04:19:56 AM
I'm updating my old theme and I need to know how to get the avatar displayed for each user.
Title: Re: User Avatar
Post by: [Unknown] on March 14, 2004, 04:50:50 AM
Well, if you don't know PHP, try putting this in your template somewhere:

', $context['user']['avatar'], '

If you do know PHP, it's in that variable I named above ;).

-[Unknown]
Title: Re: User Avatar
Post by: Aaron Nelsen on March 14, 2004, 04:59:51 AM
In Firefox 0.8 it just displays the text "array" when I use that when I'm logged in. And when I log out it gives me this error
QuoteNotice: Undefined index: avatar in /home/r181471/public_html/forum/Themes/test/index.template.php on line 226
Title: Re: User Avatar
Post by: [Unknown] on March 14, 2004, 05:02:16 AM
I'm sorry, I'm sorry... forgot that it changed.  In fact, I changed it.  Boy does that make me quick, eh?

You want:

', $context['user']['is_guest'] ? '' : $context['user']['avatar']['image'], '

-[Unknown]
Title: Re: User Avatar
Post by: Aaron Nelsen on March 14, 2004, 05:08:52 AM
Thanks man, works like a charm! SMF freaking rocks!