View Full Version : phpbb avatars


thezeppzone
04-23-2005, 01:06 AM
ok, so, i have a new phpbb forum, and i think i have most of the controls down, but, i have my avatar max width and height to be 80, and yet, one of my friends managed to post one thats like, 150x150, how did that manage to work out? is there somewhere else i have to edit besides the phpbb_config in php myadmin?


thanks...zepp

bejayel
04-23-2005, 10:03 AM
can i see your forum by any chance? maybe take a screenie of your settings fromt he admin page, blanking out any important information.

thezeppzone
04-23-2005, 12:59 PM
http://www.howellbands.com/forum/ is the forum...its the newest member with the avatar

http://www.howellbands.com/ss.jpg is the screenshot of phpbb_config, highlighted it so you knew, page 2 under "browse", which is where settings get changed.

*Jen*
04-23-2005, 03:08 PM
I think you can only set the width and height of the avatar they upload.

kiwee
04-23-2005, 05:36 PM
go to;
phpBB Administration > General Admin > Configuration

then find;
Avatar Settings

change;
Maximum Avatar Dimensions

there you go :)

thezeppzone
04-23-2005, 05:47 PM
i already have them set at 80x80, through my database, im thinking its true what jen said, even though no where does it say images from another site cant have maximum settings, so i have no clue where to go from here

kiwee
04-23-2005, 05:54 PM
why don't you disable avatar uploading

thezeppzone
04-23-2005, 07:05 PM
avatar uploading is disabled, all i have is so users can link from other sites so it takes up none of my space, that is all that the avatar max size works for, im trying to figure out how to limit the avatar size of those who link from another website

kiwee
04-23-2005, 07:14 PM
this is a toughy

bejayel
04-23-2005, 11:08 PM
wow that is a toughie. i think vbulletin is the only one that supports scanning of linked images, but i am not sure.

pb&j
04-26-2005, 02:19 PM
found this on phpbb hacks...

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
// Resize Remote Avatars mod
// $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';
// set these vars to your preference for viewtopic (these are only a suggestion)
$max_width = 400;
$max_height = 400;
$poster_avatar = get_remote_img_tag( $postrow[$i]['user_avatar'], $max_width, $max_height );
// end Resize Remote Avatars mod

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Start Resize Remote Avatars mod
function get_remote_img_tag( $url, $max_width, $max_height )
{
global $lang;
global $board_config;
$tag = '';

// @getimagesize returns false if the remote image is not found
$size = @getimagesize( $url );

if ( $size )
{
$width = $size[0];
$height = $size[1];


if ( $width > $max_width || $height > $max_height)
{
$tag = $lang['Avatar_too_large'];
}
// otherwise dynamically resize the avatar
else
{
$width_attr = '';
$height_attr = '';
// resize the avatar in the browser if either dimension is too large
$resize = $width > $board_config['avatar_max_width'] || $height > $board_config['avatar_max_height'];

// set max dimension and adjust the other according to the ratio
if ( $resize )
{
if ( $width == $height )
{
$width_attr = ' width="' . $board_config['avatar_max_width'] . '"';
$height_attr = ' height="' . $board_config['avatar_max_height'] . '"';
}
else if ( $width > $height )
{
$width_attr = ' width="' . $board_config['avatar_max_width'] . '"';
$height_attr = ' height="' . $board_config['avatar_max_width'] * $height / $width . '"';
}
else // $height > $width
{
$width_attr = ' width="' . $board_config['avatar_max_height'] * $width / $height . '"';
$height_attr = ' height="' . $board_config['avatar_max_height'] . '"';
}
}
$tag = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $url . '" alt="" border="0"' . $width_attr . $height_attr . '/>' : '';
}
}
// if the image was not found, display a configurable message
else
{
$tag = $lang['Avatar_not_found'];
}
return $tag;
}
// End Resize Remote Avatars mod

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// note: place whatever text you like here for the error tags, including an empty string ''
$lang['Avatar_not_found'] = '&lt;Avatar not found&gt;';
$lang['Avatar_too_large'] = '&lt;Avatar too large&gt;';


#-------------------------------------------------------------
# OPTIONAL: edit the next file *only* if you also wish to resize avatars on the profile page
#-------------------------------------------------------------

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php (optional)

#
#-----[ FIND ]------------------------------------------
#
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#
// Resize Remote Avatars mod
// $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';
// set these vars to your preference for viewprofile (these are only a suggestion)
$max_width = 800;
$max_height = 800;
$avatar_img = get_remote_img_tag( $postrow[$i]['user_avatar'], $max_width, $max_height );
// end Resize Remote Avatars mod


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------