PDA

View Full Version : saving picture...


smiles
05-15-2006, 10:37 AM
I am trying to make an avatar creator for the forum, but I am not sure how to make it so that once people make their avatar, that they can save it as their avatar, and have the image go right into the spot, without them having to do anything.
Also, how could I integrate the ushop system, so that they have to pay for the stuff they use?

hambil
05-16-2006, 12:19 PM
The binary data and avatar info (user id, filename, size, width, etc...) have to be inserted into the customavatar table.

You don't have to do that manually - there is a data manager. Look at the if($_POST['do'] == 'updateavatar') code in profile.php. Of special interest is:


// begin custom avatar code
require_once(DIR . '/includes/class_upload.php');
require_once(DIR . '/includes/class_image.php');

$upload = new vB_Upload_Userpic($vbulletin);

$upload->data =& datamanager_init('Userpic_Avatar', $vbulletin, ERRTYPE_STANDARD, 'userpic');
$upload->image =& vB_Image::fetch_library($vbulletin);
$upload->maxwidth = $vbulletin->userinfo['permissions']['avatarmaxwidth'];
$upload->maxheight = $vbulletin->userinfo['permissions']['avatarmaxheight'];
$upload->maxuploadsize = $vbulletin->userinfo['permissions']['avatarmaxsize'];
$upload->allowanimation = ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cananimateavatar']) ? true : false;

if (!$upload->process_upload($vbulletin->GPC['avatarurl']))
{
eval(standard_error($upload->fetch_error()));
}

smiles
05-19-2006, 07:38 AM
that doesn't help a whole lot. I basically know nothing about what I am doing, and I am just going from another boards version of an avatar maker.
I would be willing to pay quite a bit for some help in developing this...

hambil
05-19-2006, 03:17 PM
PM me, I'm sure we can work something out. Actually, you might want to post in the Service forum.