Add a Default Avatar to your phpBB3 forum

Tips & Tricks to use on your phpBB3 Forum.
User avatar
LDM
Site Admin
Site Admin
Posts: 1794
Joined: Thu May 29, 2008 6:51 pm
Your Forum/Website URL: http://
Location: UK
Contact:

Add a Default Avatar to your phpBB3 forum

Postby LDM » Fri Oct 24, 2008 2:28 pm

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
Image

Image

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider to support the site.


QuickFix
Forum Member
Forum Member
Posts: 25
Joined: Sun Oct 26, 2008 12:59 am
Your Forum/Website URL: http://

Re: Add a Default Avatar to your phpBB3 forum

Postby QuickFix » Sun Oct 26, 2008 1:37 am

This is a really good option :thumbsup:

binaryb
Forum Member
Forum Member
Posts: 3
Joined: Wed Apr 01, 2009 6:02 am
Your Forum/Website URL: http://gamesareus.net

Re: Add a Default Avatar to your phpBB3 forum

Postby binaryb » Thu Apr 16, 2009 4:54 pm

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
Your Forum/Website URL: http://

Re: Add a Default Avatar to your phpBB3 forum

Postby Mercenary » Wed Aug 26, 2009 10:42 pm

Alright then indeed a very great option tnx for sharing m8 ;)

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider to support the site.


User avatar
svalle
Forum Member
Forum Member
Posts: 2
Joined: Sun Dec 14, 2008 11:31 pm
Your Forum/Website URL: http://www.ercup.se

Re: Add a Default Avatar to your phpBB3 forum

Postby svalle » Thu Oct 28, 2010 9:10 am

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
Contact:

Re: Add a Default Avatar to your phpBB3 forum

Postby Benet_ » Thu Jun 16, 2011 4:41 pm

Good trick, very useful, you are excellent! :)

User avatar
shione
Forum Member
Forum Member
Posts: 1
Joined: Wed Feb 08, 2012 7:25 am
Your Forum/Website URL: http://forum.habbekrats.org

Re: Add a Default Avatar to your phpBB3 forum

Postby shione » Wed Feb 08, 2012 4:18 pm

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
Your Forum/Website URL: http://soothingchaos.com/forum
Location: United States

Re: Add a Default Avatar to your phpBB3 forum

Postby shadowslight » Mon May 07, 2012 12:37 am

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
Your Forum/Website URL: http://
Contact:

Re: Add a Default Avatar to your phpBB3 forum

Postby smartuser20 » Tue Jul 03, 2012 6:18 pm

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.
Sorry for any grammatical mistakes.

User avatar
cisco007
Staff
Staff
Posts: 501
Joined: Tue Oct 07, 2008 3:44 am
Your Forum/Website URL: http://phpbbmexico.com

Re: Add a Default Avatar to your phpBB3 forum

Postby cisco007 » Mon Jul 09, 2012 4:21 am

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.
Image
Image

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider to support the site.



Return to “PhpBB3 Tips & Tricks”



Who is online

Users browsing this forum: No registered users and 1 guest