MyBB Hacks

Full Version: [SOLVED] Need to fix Profile Buddies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

I have installed this plugin in my forum:
http://mods.mybb.com/view/profile-buddies

And I think that I found a "little" bug, take a look here:
[Image: pHKob.png]

Some users are using same avatar... How can I fix that?
I contacted the plugin author but he is not replying me...

Help please Smile
Try this, find:

PHP Code:
$avatar_default='';

replace with

PHP Code:
$buddy_avatar=$avatar_default='';

Hi ZiNgA BuRgA, thank you for trying to help me Smile

Doing that, appears like that:
[Image: WCmga.png]

Note: The avatars that appeared was the ones that the avatar was uploaded to the server... the other members avatars are remote urls.

Any suggestion? Smile
Bug someone to fix the code, is my suggestion.
Cant I "bug" you? Smile
Please? You're almost there...
Maybe you can check in the users table whether the users have the avatardimensions value?
RateU, thank you for your reply bud.

What do you mean? Checking database in phpmyadmin?
What do I need to look? Can you give me an example?

Note: avatars works fine in my all forum, only have problems in this plugin...
Try to change this code:

PHP Code:
if($avatar_dimensions[0]&&$avatar_dimensions[1])
{
	if($avatar_dimensions[0]>$max_width||$avatar_dimensions[1]>$max_height)
	{
		$scaled_dimensions=scale_image($avatar_dimensions[0],$avatar_dimensions[1],$max_width,$max_height);
		$avatar_width_height='width="'.$scaled_dimensions['width'].'" height="'.$scaled_dimensions['height'].'"';
	}
	else
	{
		$avatar_width_height='width="'.$avatar_dimensions[0].'" height="'.$avatar_dimensions[1].'"';
	}
	$buddy_avatar='<a href="'.get_profile_link($buddy['uid']).'"><img src="'.$buddy['avatar'].'" alt="'.htmlspecialchars_uni($buddy['username']).'" '.$avatar_width_height.' '.$avatar_default.'/></a>';
}

to this:

PHP Code:
if($avatar_dimensions[0]&&$avatar_dimensions[1])
{
	if($avatar_dimensions[0]>$max_width||$avatar_dimensions[1]>$max_height)
	{
		$scaled_dimensions=scale_image($avatar_dimensions[0],$avatar_dimensions[1],$max_width,$max_height);
		$avatar_width_height='width="'.$scaled_dimensions['width'].'" height="'.$scaled_dimensions['height'].'"';
	}
	else
	{
		$avatar_width_height='width="'.$avatar_dimensions[0].'" height="'.$avatar_dimensions[1].'"';
	}
}
$buddy_avatar='<a href="'.get_profile_link($buddy['uid']).'"><img src="'.$buddy['avatar'].'" alt="'.htmlspecialchars_uni($buddy['username']).'" '.$avatar_width_height.' '.$avatar_default.'/></a>';

Fixed, thank you very much my friend Biggrin
Reference URL's