MyBB Community Forums

Full Version: Default Avatar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,
How do I fix this?

When a user registers and does not set an avatar I just get the dreaded missing image red cross (this only appears to happen on the portal page, on the forum pages the avatar just doesn't show), this is fixed when the user chooses an avatar.

How do I:

Set a default avatar for new users that haven't set their own.

Thanks
The default profile plugin hasn't been updated to 1.6 yet, but the avatar doesn't show on the portal by default, so this is really an issue with how the avatar is being put on the portal.
Thanks Matt,
My error!
I had put the avatar variable in one of the portal templates without considering how it was being called...dooooh!!

By the way,I love MyBB and everything about it, the day I found MyBB was a happy day for me and I could give up vBulletin for ever.

A Million Thanks.
So its not possible without the Add-on?
(2010-08-19, 01:55 PM)MadDogTen Wrote: [ -> ]So its not possible without the Add-on?
No. MyBB doesn't has an inbuilt No-avatar feature Sad

I will be making a plugin for it soon Wink
The existing plug in is very easy to update - change to 1.6 and remove the line that refers to the remember me column.

Thats it

remove
'defaultprofile_remember' => array('Remember Login', 'Remember login status next time the user visits?', 'yesno', '1'),

and

		if($mybb->settings['defaultprofile_remember'] == 1)
		{
			$user->user_insert_data['remember'] = 1;
		}
		else
		{
			$user->user_insert_data['remember'] = 0;
		}

Or if you want a default avatar showing in posts and don't want to use the profile plugin you can use php in templates and put in an if function in the post bit.

<td class="tcat">
				<div class="float_left smalltext">
                                        <if $post['avatar'] then>
                                        <a href="member.php?action=profile&amp;uid=$post[uid]"><img src="{$post['avatar']}" alt="avatar" /></a>
                                        <else>
                                        <img src="{$mybb->settings['bburl']}/images/avatars/guestfish.gif"  alt="avatar" />
                                        </if>						
                                        <strong>{$post['profilelink']}</strong>{$post['postdate']}, {$post['posttime']} 
                                        <div><span id="edited_by_{$post['pid']}"></span></div>
				</div>
				{$post['posturl']}
			</td>

guestfish is the name I gave my guest avatar, that is my horizontal post bit but I think it is clear what to do


EDIT : sorry, missed one, edited post.


The Plugin didn't work, I Changed the Version and Removed everything you said, but it wont set the Avatar.
Hmm, its working fine for me. Did you use notepad++ as the editor? Did you install the plugin? Obviously this is for NEW users, not existing users. That is what the OTHER code can do for you, the code in the postbit etc
Pages: 1 2