Page 1 of 1

Add a Default Avatar to your phpBB3 forum

Posted: Fri Oct 24, 2008 2:28 pm
by LDM
If you add an default avatar to the whole registered usergroup, you will lose all of the avatars that your current members have selected or uploaded. Using this little trick, you can assign all of your board a Default Avatar to those that haven't selected or uploaded one, yet still keeping the avatars that your current members have selected.

This will work on any style you have installed.

Open: includes/functions_display.php

Find:

Code: Select all

if (empty($avatar) || !$avatar_type)
	{
		return '';
Then inline find:

Code: Select all

return '';
and replace with:

Code: Select all

return '<img src="images/avatars/no_avatar.gif" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
Now select the image below, save it and upload it to /images/avatars/ then purge your cache.

All your members that haven't selected an avatar will now be issued with the default as well as any new members.
no_avatar.gif

Re: Add a Default Avatar to your phpBB3 forum

Posted: Sun Oct 26, 2008 1:37 am
by QuickFix
This is a really good option :thumbsup:

Re: Add a Default Avatar to your phpBB3 forum

Posted: Thu Apr 16, 2009 4:54 pm
by binaryb
Thank you, this is a very good and simple mod. :good:

Re: Add a Default Avatar to your phpBB3 forum

Posted: Wed Aug 26, 2009 10:42 pm
by Mercenary
Alright then indeed a very great option tnx for sharing m8 ;)

Re: Add a Default Avatar to your phpBB3 forum

Posted: Thu Oct 28, 2010 9:10 am
by svalle
The code to search for has changed (at least at my Forum runing on 3.0.7-PL1) to this:

Code: Select all

	if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
	{
		return '';
	}
But it's still the same fix. Works fine :)

Re: Add a Default Avatar to your phpBB3 forum

Posted: Thu Jun 16, 2011 4:41 pm
by Benet_
Good trick, very useful, you are excellent! :)

Re: Add a Default Avatar to your phpBB3 forum

Posted: Wed Feb 08, 2012 4:18 pm
by shione
Thanks for this. Was looking for a mod like this for ages...

Re: Add a Default Avatar to your phpBB3 forum

Posted: Mon May 07, 2012 12:37 am
by shadowslight
I wasn't aware of this method. when I started my board, i edited the "registered users" group and added a default avatar, that would be replaced when a member uploaded their own.

Re: Add a Default Avatar to your phpBB3 forum

Posted: Tue Jul 03, 2012 6:18 pm
by smartuser20
Hello,
I have a forum and I tried this method but it is not working. Any idea why? I don't know my server details, but I can look them up and let you know. or I can show you my site if necessary.

Re: Add a Default Avatar to your phpBB3 forum

Posted: Mon Jul 09, 2012 4:21 am
by cisco007
i really have no idea why it's not working other then maybe you don't have the image in the directory specified!
and without really knowing exactly what it's meant by it's not working, i can't really tell you the problem or answer.

Re: Add a Default Avatar to your phpBB3 forum

Posted: Mon Jul 30, 2012 10:28 am
by dupko
cisco007 wrote:i really have no idea why it's not working other then maybe you don't have the image in the directory specified!
and without really knowing exactly what it's meant by it's not working, i can't really tell you the problem or answer.
Its strange,rly :cray:

Re: Add a Default Avatar to your phpBB3 forum

Posted: Mon Jul 30, 2012 3:43 pm
by cisco007
can you tell me what you mean by "not working"?
and post up the edits you have done so i can take a look?