MyBB Community Forums

Full Version: Default avatars
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got a quick question: is it possible for me (as administrator) to upload a default avatar for my users, so that when users register and have not uploaded their own avatars yet, that for this period of time, my default avatar will display?
Yes, there is. (this should work). Open member.php and find
$db->query("INSERT INTO ".TABLE_PREFIX."users (uid,username,password,email,usergroup,regdate,lastactive,lastvisit,website,icq,aim,yahoo,msn,birthday,allownotices,hideemail,emailnotify,invisible,style,timezone,threadmode,receivepms,pmpopup,daysprune,regip,showcodebuttons $queryad $queryad2 $queryad3) VALUES (NULL,'$username','$md5password','$email','$usergroup','$timenow','$timenow','$timenow','$website','$icq','$aim','$yahoo','$msn','$bday','$allownotices','$hideemail','$emailnotify','$invisible','$style','$timezoneoffset','$threadmode','$receivepms','$pmpopup','$daysprune','$ipaddress','1' $queryadd $queryadd2 $queryadd3)");
		$uid = $db->insert_id();
and replace with
$db->query("INSERT INTO ".TABLE_PREFIX."users (uid,username,password,email,[b]avatar,[/b]usergroup,regdate,lastactive,lastvisit,website,icq,aim,yahoo,msn,birthday,allownotices,hideemail,emailnotify,invisible,style,timezone,threadmode,receivepms,pmpopup,daysprune,regip,showcodebuttons $queryad $queryad2 $queryad3) VALUES (NULL,'$username','$md5password','$email',[b]'images/avatars/clear_avatar.gif',[/b]'$usergroup','$timenow','$timenow','$timenow','$website','$icq','$aim','$yahoo','$msn','$bday','$allownotices','$hideemail','$emailnotify','$invisible','$style','$timezoneoffset','$threadmode','$receivepms','$pmpopup','$daysprune','$ipaddress','1' $queryadd $queryadd2 $queryadd3)");
		$uid = $db->insert_id();
(Bold bits are the added bits)

Change images/avatars/clear_avatar.gif to whatever avatar you want.
Thanks for your help.
I tried it out but I'm afraid it didn't work. The default picture doesn't show up.
have you checked that the image is there? change the URL to the image you want to use where it says:
Quote:images/avatars/clear_avatar.gif
To you want it to display
Ah I know what the matter was.
The default avatar only shows up for new threads. The ones that had been posted already do not display the default avatar. But all the new ones show it... so everything seems to be okay now. Thank you very much for your help.
and images/avatars/clear_avatar.gif actually shows a big white avatar, you should find that if you highlight there avatar area, it should be there.

Edit: I see you got it now. Glad I could help.