[MOD] Remote avatar resize

Avatars...nice...
But we have to put restrictions to their size, or they can ruin the layout...
Those restrictions work for uploading, that's OK...
But for pictures from other sites (remote), there's no restriction at all...
So this time, I didn't just follow instructions to integrate a MOD...
This is the first time that I've gone this far in PHP-coding... <img>
Never thought I could do this, but I really did it !!!!
Here it is:
[size=99px] ) ? '<img>' ]
REPLACE
[size=99px]
[size=99px] ) ? '<img>' ]
REPLACE
[size=99px]
[size=99px] ) ? '<img>' ]
REPLACE
or even better:
See [url=http][MOD] Better avatar restriction on blocks[/url] for improvements on blocks for avatar display...
But we have to put restrictions to their size, or they can ruin the layout...
Those restrictions work for uploading, that's OK...

But for pictures from other sites (remote), there's no restriction at all...

So this time, I didn't just follow instructions to integrate a MOD...
This is the first time that I've gone this far in PHP-coding... <img>
Never thought I could do this, but I really did it !!!!
Here it is:
[size=99px] ) ? '<img>' ]
REPLACE
- Code: Select all
case USER_AVATAR_REMOTE] ) { list($width, $height) = @getimagesize($user_avatar); $percentage = ($height / $width * 100); $newheight = round($board_config['avatar_max_width'] * $percentage / 100); if ( ($width > $board_config['avatar_max_width']) && ($newheight <board_config> $board_config['avatar_max_height']) { $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : ''; } else // No width/height in the user's profile { $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : ''; } } else // remote avatars not allowed $avatar_img = ''; break;
[size=99px]
[size=99px] ) ? '<img>' ]
REPLACE
- Code: Select all
case USER_AVATAR_REMOTE] ) { list($width, $height) = @getimagesize($view_userdata[$field_name]); $percentage = ($height / $width * 100); $newheight = round($board_config['avatar_max_width'] * $percentage / 100); if ( ($width > $board_config['avatar_max_width']) && ($newheight <board_config> $board_config['avatar_max_height']) { $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : ''; } else // No width/height in the user's profile { $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : ''; } } else // remote avatars not allowed $img = ''; break;
[size=99px]
[size=99px] ) ? '<img>' ]
REPLACE
- Code: Select all
case USER_AVATAR_REMOTE] ) { list($width, $height) = @getimagesize($userdata['user_avatar']); $percentage = ($height / $width * 100); $newheight = round($board_config['avatar_max_width'] * $percentage / 100); if ( ($width > $board_config['avatar_max_width']) && ($newheight <board_config> $board_config['avatar_max_height']) { $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : ''; } else // No width/height in the user's profile { $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : ''; } } else // remote avatars not allowed $avatar_img = ''; break;
or even better:
See [url=http][MOD] Better avatar restriction on blocks[/url] for improvements on blocks for avatar display...