Customizing SMF > Tips and Tricks

Default Avatar?

(1/14) > >>

Bitwiz44:
When someone does not have or use an Avatar, I would like it to default a  Gif I made. Where do I change the code? 2. Does it follow with different theme's, or do I need to make a change in each theme? (RC1)
Thanks.

A.M.A:
in index.template.php look for:

--- Code: --- if (!empty($context['user']['avatar']))
echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';
--- End code ---
add after

--- Code: --- else
echo '<td valign="middle"><img src="', $settings['images_url'], '/noava.gif" alt="" /></td>';
--- End code ---

in Display.template.php look for:

--- Code: --- // Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
--- End code ---
add after

--- Code: --- else
echo '           <div style="overflow: auto; width: 100%;"><img src="', $settings['images_url'], '/noava.gif" alt="" /></div><br />';
--- End code ---
assuming that the (noava.gif) is in your ( Themes\x\images ) folder.

you have to do the same for each theme.

codenaught:
Hey nice one! Thanks. Worked easy and it makes it look good.

Bitwiz44:
Thank you AMA. I will try this.

Lum-chan:
[edit]Didn't upload the images (stupid me)[/edit]

Works great with RC2 and smfCurve!

Nice one A.M.A.

Navigation

[0] Message Index

[#] Next page

Go to full version