PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Guide to avatars 
Description: How to add and use avatars.
Author: Black Fluffy Lion
Date: Tue Oct 29, 2002 5:13 pm
Type: FAQ
Keywords: avatar, picture, image, graphic, change, edit, remote, link, off-site, upload, gallery, file, category, chmod, ch mod, ch-mod, 777, permission, read, write, execute
Category: Administrating
Handy Dandy Guides Present...

Guide to avatars!

Contents


  • Introduction

    • So what's an 'avatar'?
    • Right, where can I get avatars then?
    • OK then hotshot, what are all these different types of avatars with phpBB2?

      • Gallery avatars
      • Remote avatars
      • Uploaded avatars

    • So how do I use them then?

  • Admin panel

    • What's all this about doing avatars under the admin panel?
    • So what do all these options mean?

      • Enabling forms of avatar selection
      • Maximums
      • Paths

    • I've done all that. Now what?

  • Files

    • Where do I put what?

  • Editing your profile

    • So how do I display my avatar now?

      • Remote avatars
      • Gallery avatars
      • Uploaded avatars

    • That's all?

  • Troubleshooting

    • My avatar doesn't show up/gallery doesn't display! *whimper*

      • Yes! Please tell me how to fix it!
      • CH-what?

    • When my users register their avatar doesn't show up so they have to go back to edit it again. Any fix?
    • When I try changing my avatar from a remote or gallery avatar to an uploaded one all I get is error messages. You wanna solve this one too?
    • Why does the category select thing display all strange?
    • It still doesn't work!

  • End note


Introduction

Avatars, avatars, avatars...they hold so many joys yet can be so annoying when they don't work. I've seen many a folk crumble when faced with the daunting of changing their avatar. What options to change?? What to CH-MOD?? How to enable uploads?? Well, hopefully this tutorial will answer all of these questions, so you will know all there is to be known about avatars. Sounds pretty exciting, huh?? No?! Read on anyway.

So what's an 'avatar'?

OK, let's start with the basics. An avatar is the image that is displayed (if enabled and specified) below the user's name in topics, just below their rank. It also shows up when you view a members profile.

Right, where can I get avatars then?

Try http://www.phpbb.com/styles/

OK then hotshot, what are all these different types of avatars with phpBB2?

With phpBB2 there's 3 main ways to select an avatar - gallery, uploading and linking. I'll explain what each of them is here:

Gallery avatars

This is where there is a collection of avatars already on the server. You can select one from the gallery. The gallery is often split into sections (e.g. Simpsons, Futurama, Other).

Remote avatars

This is where there is the avatar you want uploaded to a different server. You use this by linking to the avatar's URL.

Uploaded avatars

This is where you can select a file on your computer to upload to the server to use as your avatar. You can also select a file on a different server to be copied to the fora's server.

So how do I use them then?

Whoah! Patience, I'm just getting to that part! Before you can select an avatar in your profile you'll have to do a few things in the admin panel, so I'll explain that now.

Admin panel

What's all this about doing avatars under the admin panel?

Well before you can do anything with avatars you'll have to enable them. So trot on over to the admin panel (link at the bottom of the page in case you hadn't already noticed it) and go to 'Configuration', under 'General Admin'. Scroll down the page and you'll hit 'Avatar Settings'. Ding ding ding! Congratulations, you've reached avatar country.

So what do all these options mean?

Let's start at the top...

Enabling forms of avatar selection

That's what the first 3 options are, pretty self-explanitory. 'Enable gallery avatars', 'Enable remote avatars' and 'Enable avatar uploading' are for you to state whether you wish to allow those forms of avatar selection. And since you know what all of those are, because cleverly you read the introduction section, this should be no problem to deal with.

Maximums

This is what we get to next: 'Maximum Avatar File Size' and 'Maximum Avatar Dimensions'. Also pretty self-explanitory. But why do you want these limits?? Well, let me put it this way, do you want some prat uploading a 2 MB gif that takes up all the space on the screen, pushes the user column so far out you have to scroll to read any message, takes up half your server space and stretches their profile out so far to the right that it screws up your whole fora? I rest my case. Note that these limits do not apply to remotely linked avatars so if you leave that enabled then you can still get some prat using a 2 MB gif that takes up all the space on the screen etc...

Paths

Scroll down a wee bit more and you hit the world of paths, in this case 'Avatar Storage Path' and 'Avatar Gallery Path'. This is where the location of all your gallery and uploaded avatars is specified. You can change this if you want avatars uploaded and the gallery to be sotred in a different location but remember to make the same changes to your site's FTP! But, if you are lazy, like me, then just leave it on the default (images/avatars and images/avatars/gallery).

I've done all that. Now what?

When you've twiddled with those settings to your heart's content then it's time to specify the avatar in your profile. Carry on reading...

Files

Where do I put what?

If you're using gallery avatars then obviously you'll need them on the server if you want your users to select one. With a FTP client go to the place you selected under 'Avatar Gallery Path', and create a new folder in it. This will be the name of one of the categories. Upload the right avatars to there, and make more categories if you want. CH-MOD these files 777 (see Troubleshooting --> My avatar doesn't show up/gallery doesn't display! *whimper* for more).

Editing your profile

So how do I display my avatar now?

Click on 'Profile' (there's a link at the top of the forum page) and scroll again. You'll come across a little something called 'Avatar control panel'. Ding ding ding! We're back in avatar country. First of all you'll see the avatar you're currently using. Now this next bit is so freaking easy I honestly don't know why I'm explaining it. Oh well, here goes:

Remote avatars

This is the bit next to 'Link to off-site Avatar'. All you have to do (I feel like an idiot explaining this) is, as it says, 'Enter the URL of the location containing the avatar image you wish to link to.' Couldn't be easier.

Gallery avatars

Now we come across 'Select Avatar from gallery'. This is also amazingly easy to do. Just hop over to the gallery with the 'Show gallery' link, select the avatar you want and then click 'Select avatar'. Note that there may be different categories to browse in; so to change the category you're viewing just change the 'Select category' drop down list (near the top).

Uploading avatars

There's 2 different ways to do this now. Firstly, 'Upload Avatar from your machine'. To use this just click the 'Browse' button and you'll find yourself with a way to navigate around your computer and select the avatar you want. The other way, 'Upload Avatar from a URL' is simple enough. It's basically the same as the link to off-site avatar option exept this time instead of just linking to it, it copies the avatar file to the server and uses that copy.

That's all?

Yep, done! What, it doesn't work?? Well, there's always a problem or two...

Troubleshooting

My avatar doesn't show up/gallery doesn't display! *whimper*

Sigh...a problem?? Well, the good news is that I expect there's an easy fix...

Yes! Please tell me how to fix it!

That's not a question and this is an FAQ. But neither was the last question a question so I'll help you anyway. Chances are the problem is that the permissions are wrong so your fora does not have permission to display the avatar. To change this all we have to do is CH-MOD the avatar directory and files 777.

CH-what??

If you're using a good FTP client - I recommend SmartFTP - and are running phpBB2 on Unix then this will be very easy. First, locate the avatar files and directory and select them. Then right click on them and select 'Properties' or 'CHMOD' or 'Permissions' or something like that. You want to CH-MOD them 777. If there's no space to enter this as a number then you want to enable everyone access to write, read and execute the file (in most cases this can be done by ticking all the boxes). Done!

When my users register their avatar doesn't show up so they have to go back to edit it again. Any fix?

Pretty annoying...luckily there is a fix:

Open up /includes/usercp_avatar.php and find

Code:

return ( $mode == 'editprofile') ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY : '';


...replace this with

Code:

return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY : "'$avatar_filename', " . USER_AVATAR_GALLERY;


Should fix the problem!

When I try changing my avatar from a remote or gallery avatar to an uploaded one all I get is error messages. You wanna solve this one too?

T'would be my pleasure to. Try deleting your current avatar first and then uploading your new one. A simple fix but often works. If it doesn't though then try this:

Open up /includes/usercp_avatar.php and find the code

Code:
$new_filename = ( $current_avatar != '' && $mode != 'register' ) ? $current_avatar : uniqid($user_ip) . $imgtype;


...and replace this with

Code:
$new_filename = uniqid($user_ip) . $imgtype;


Why does the category select thing display all strange?

There are bugs with some themes which cause the category select menu to not display properly. Luckily for you, this fix should work but backup the file first! Open templates/yourTemplate/profile_avatar_gallery.tpl and change your category code to

Code:
   <tr>
     <td class="catBottom" align="center" valign="middle" colspan="6" height="28"><span class="genmed">{L_CATEGORY}:&nbsp;{S_CATEGORY_SELECT}&nbsp;<input type="submit" class="liteoption" value="{L_GO}" name="avatargallery" /></span></td>
   </tr>


It would also be helpful to inform the template creator of the bug if s/he does not already know about it.

It still doesn't work!

Ask in this thread then and I'll try to help you and add it to this section.

End note

That's it again from Handy Dandy Guides. Hope you found it useful. As ever, feedback is appreciated. The troubleshooting section will be updated with any questions I see or you ask here. And to round it all off, a few thank-yous: to Brewjah, for the link to the avatar site; to The Black Pit for sticking it; to Sven Ansem, for finding the fix to the gallery avatars don't show up after registration problem; to themidnightclub, for his fix on the moving to an uploaded avatar problem; to the phpBB2 team, for making such a great bit of software; and lastly, to you, for reading it.

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.