PDA

View Full Version : WBB3: Avatars are not being imported


Mystics
Tue 20th May '08, 9:20am
As an (ugly) workaround I added some code above this code in wbb3/004.php:
// Check if object is valid

if ($sessionobject->get_session_var('get_avatars') AND $data['avatarID'] != NULL AND $data['avatarID'] != '0')
{
// Its going to be in the images/avatars/ dir somewhere hopefully.
$ava_path = $sessionobject->get_session_var('get_avatars_path');
if(substr($ava_path, -1) != '/')
{
$ava_path .= '/';
}
if(is_file($ava_path . 'avatar-' . $data['avatarID'] . '.gif'))
{
$try->set_value('nonmandatory', 'avatar', $ava_path . 'avatar-' . $data['avatarID'] . '.gif');
}
else if(is_file($ava_path . 'avatar-' . $data['avatarID'] . '.jpg'))
{
$try->set_value('nonmandatory', 'avatar', $ava_path . 'avatar-' . $data['avatarID'] . '.jpg');
}
else if(is_file($ava_path . 'avatar-' . $data['avatarID'] . '.bmp'))
{
$try->set_value('nonmandatory', 'avatar', $ava_path . 'avatar-' . $data['avatarID'] . '.bmp');
}
else if(is_file($ava_path . 'avatar-' . $data['avatarID'] . '.png'))
{
$try->set_value('nonmandatory', 'avatar', $ava_path . 'avatar-' . $data['avatarID'] . '.png');
}
}
I'm sure there is a better solution :)

Jerry
Fri 27th Jun '08, 12:23pm
So I'm guessing the file extension isn't stored any where?

Mystics
Fri 27th Jun '08, 3:02pm
Well....the extension is stored in wcf1_avatar.avatarExtension but I was to lazy to include this table in 004.php :)

Jerry
Mon 21st Jul '08, 5:50pm
Ok, will put it in like that for the moment