Seite 1 von 1

Avatarmod eingebaut, doch nun <Avatar not found>

Verfasst: 04.06.2005 17:15
von Crizzo
hi
ich hab den Resize Remote Avatars v1.1.0 eingebaut wie hier beschrieben:
#
#-----[ 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'] = '<Avatar not found>';
$lang['Avatar_too_large'] = '<Avatar too large>';


#-------------------------------------------------------------
# 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
Doch die Avatars werden nicht angezeigt, sondern es steht da <Avatar not found>. Nur der User selbst kann seinen Avatar unter Profil sehen, was ist den falsch gelaufen?
Link: http://blackhawk.bl.ohost.de gemeint ist der Testmember ich98

PS: Dieser Mod soll die extern verlinkten Avatare auf 113*113 Pixel begrenzen.

Verfasst: 25.09.2006 21:04
von NessD
Schon ein wenig her, habe aber dasselbe Problem, seit ich mit meiner SQL Datenbank und meinem Server umgezogen bin...

Verfasst: 24.11.2006 20:06
von NessD
*push*