Markus67 hat geschrieben:Hi
BlackHawk87 hat geschrieben:wie kann ich denn den Mod einbauen?
Öffne die Datei
Resize_Remote_Avatars_v1.1.0.mod mit einem Editor und du findest eine Anleitung welche Dateien du wie ändern musst
Markus
da kommt dann folgendes
#
#-----[ 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
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
muss ich die Dateien auch mit nem Editor öffnen? Bei dem 2. Schritt soll ich die ganze ersetzen und das andere eintragen?
Gruß
Edit: Habs so gemacht, wird aber nichts angezeigt

Das Bild wird nur angezeigt, wenn der User in sein Profil geht, aber nicht wenn man ihn anklickt oder im Forum