Add a Default Avatar to your phpBB3 forum

Tips & Tricks to use on your phpBB3 Forum.
Post Reply
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Add a Default Avatar to your phpBB3 forum

Post 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
QuickFix
Forum Member
Forum Member
Posts: 25
Joined: Sun Oct 26, 2008 12:59 am

Re: Add a Default Avatar to your phpBB3 forum

Post by QuickFix »

This is a really good option :thumbsup:
binaryb
Forum Member
Forum Member
Posts: 3
Joined: Wed Apr 01, 2009 6:02 am

Re: Add a Default Avatar to your phpBB3 forum

Post by binaryb »

Thank you, this is a very good and simple mod. :good:
Mercenary
Forum Member
Forum Member
Posts: 8
Joined: Wed Aug 26, 2009 9:56 pm

Re: Add a Default Avatar to your phpBB3 forum

Post by Mercenary »

Alright then indeed a very great option tnx for sharing m8 ;)
User avatar
svalle
Forum Member
Forum Member
Posts: 2
Joined: Sun Dec 14, 2008 11:31 pm

Re: Add a Default Avatar to your phpBB3 forum

Post 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 :)
Benet_
Forum Member
Forum Member
Posts: 1
Joined: Thu Jun 16, 2011 4:39 pm

Re: Add a Default Avatar to your phpBB3 forum

Post by Benet_ »

Good trick, very useful, you are excellent! :)
User avatar
shione
Forum Member
Forum Member
Posts: 1
Joined: Wed Feb 08, 2012 7:25 am

Re: Add a Default Avatar to your phpBB3 forum

Post by shione »

Thanks for this. Was looking for a mod like this for ages...
User avatar
shadowslight
Forum Member
Forum Member
Posts: 35
Joined: Mon May 07, 2012 12:20 am

Re: Add a Default Avatar to your phpBB3 forum

Post 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.
smartuser20
Forum Member
Forum Member
Posts: 9
Joined: Tue Jul 03, 2012 6:16 pm

Re: Add a Default Avatar to your phpBB3 forum

Post 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.
User avatar
cisco007
Staff
Staff
Posts: 501
Joined: Tue Oct 07, 2008 3:44 am

Re: Add a Default Avatar to your phpBB3 forum

Post 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.
dupko
Forum Member
Forum Member
Posts: 1
Joined: Mon Jul 30, 2012 10:27 am

Re: Add a Default Avatar to your phpBB3 forum

Post 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:
User avatar
cisco007
Staff
Staff
Posts: 501
Joined: Tue Oct 07, 2008 3:44 am

Re: Add a Default Avatar to your phpBB3 forum

Post 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?
Post Reply