resize remote avatar mod umschreiben?

Du suchst einen bestimmten Mod, weißt aber nicht genau wo bzw. ob er überhaupt existiert? Wenn dir dieser Artikel nicht weiterhilft, kannst du hier den von dir gewünschten/gesuchten Mod beschreiben ...
Falls ein Mod-Autor eine der Anfragen hier aufnimmt um einen neuen Mod zu entwicklen, geht's in phpBB 2.0: Mods in Entwicklung weiter.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Shadowproject
Mitglied
Beiträge: 281
Registriert: 05.05.2005 14:32
Wohnort: Echterdingen
Kontaktdaten:

resize remote avatar mod umschreiben?

Beitrag von Shadowproject »

kann mir jmd den resize remote avatar mod umschreiben damit die avatare in der memberlist (ava in memberlist mod) dort alle eine feste gr��e haben?

hier sind beide:

resize remote avatar:

Code: Alles auswählen

# 
#-----[ 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
avatar in memberlist:

Code: Alles auswählen

// Directions: -----------------------------------------

� Open /templates/themename/memberlist_body.tpl

Find: >>>
 <th class="thCornerR" nowrap="nowrap">{L_WEBSITE}</th>
After add: >>>
 <th class="thCornerR" nowrap="nowrap">Avatar</th>
 

Find: >>>
 <td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.WWW_IMG}&nbsp;</td>
After add: >>>
 <td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.AVATAR_IMG}&nbsp;</td>
 
 
Find: >>>
 <td class="catbottom" colspan="9"
NOTE: if u have installed other hacks that modify the memberlist, there could be different nunber (not 9)
Replace with: >>>
 <td class="catbottom" colspan="10"
 


� Open /memberlist.php

Find: >>>
 $www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
After add: >>>
 $avatar_img = ($row['user_avatar'] && $row['user_avatar_type']==2 ? '<img src=' . $row['user_avatar'] . '>' : ($row['user_avatar'] && $row['user_avatar_type']==3 ? '<img src=images/avatars/gallery/' . $row['user_avatar'] . '>' : false));
 
 
Find: >>>
 'WWW' => $www,
After add: >>>
 'AVATAR_IMG' => $avatar_img,
Antworten

Zurück zu „phpBB 2.0: Mod Suche/Anfragen“