PDA

View Full Version : Creating thumbnail of avatar upon upload


MarkPW
06-18-2006, 11:09 PM
Hi all,

When my users upload (or link) to an avatar, I want to generate a thumbnail of that avatar. I realise there's a hook called profile_updateavatar_complete of which I would guess would be a suitable location to run code for this. However, because I'm unfamiliar with how vb processes the avatar in the first place, I don't know which variables hold the file data etc in order to process the thumbnailed copy, nor do I know how to define whether a user is processing a file or whether that user has chosen to link to an external image.

I'm not asking for help on how to create a thumbnail. I just want to know which variables I use to retrieve data and extension information of the uploaded avatar, aswell as the variable which defines whether it is an external url or upload.

I would appreciate any help. :classic:

calorie
06-21-2006, 02:52 PM
To get a feel for avatars, look at the following code chunks in the profile.php file:

if ($_REQUEST['do'] == 'editavatar')
{
// blah blah
}

if ($_POST['do'] == 'updateavatar')
{
// blah blah
}

Maybe consider pulling the avatar and using CSS to resize the avatar into a thumb:

<img src="whatever" style="width: 25px;" alt="" border="0" />