Add a Default Avatar to your phpBB3 forum

Tips & Tricks to use on your phpBB3 Forum.
  • Advertisement

Bookmark and Share

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
User avatar
LDM
Site Admin
Site Admin
 
Posts: 1794
Joined: May 2008
Location: UK
Has thanked: 17 times
Have thanks: 122 times
Fine

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:
User avatar
QuickFix
Forum Member
Forum Member
 
Posts: 25
Joined: October 2008
Has thanked: 0 time
Have thanks: 0 time

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:
User avatar
binaryb
Forum Member
Forum Member
 
Posts: 3
Joined: April 2009
Has thanked: 0 time
Have thanks: 0 time

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 ;)

For this message the author Mercenary has received thanks:
1rge
User avatar
Mercenary
Forum Member
Forum Member
 
Posts: 8
Joined: August 2009
Has thanked: 0 time
Have thanks: 1 time

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 :)
User avatar
svalle
Forum Member
Forum Member
 
Posts: 2
Joined: December 2008
Has thanked: 0 time
Have thanks: 0 time

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
Benet_
Forum Member
Forum Member
 
Posts: 1
Joined: June 2011
Has thanked: 0 time
Have thanks: 0 time

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
shione
Forum Member
Forum Member
 
Posts: 1
Joined: February 2012
Has thanked: 0 time
Have thanks: 0 time

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.
User avatar
shadowslight
Forum Member
Forum Member
 
Posts: 35
Joined: May 2012
Location: United States
Has thanked: 8 times
Have thanks: 2 times
Curiuos

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
smartuser20
Forum Member
Forum Member
 
Posts: 9
Joined: July 2012
Has thanked: 0 time
Have thanks: 0 time

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
User avatar
cisco007
Staff
Staff
 
Posts: 496
Joined: October 2008
Has thanked: 13 times
Have thanks: 31 times
Daring

Next


  • Advertisement

Return to PhpBB3 Tips & Tricks



Who is online

Users browsing this forum: No registered users and 1 guest


Subscribe to the ModphpBB3 Forum RSS