Forum admın paneldeki izin verilen maximum avatar boyutlarına Uyelerin avatarını uyduran mod

AC

viewtopic.php

BUL

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

Kod:
                ////////////////////////////////////////////////////////
                // Resize Remote Avatars mod
                // Make sure that both dimensions of remote avatars conform to the limits
                // set in the admin control panel. Use the width and height attributes 
                // on the <img> tag to control the image size in the browser. 
                // Reduce the largest dimension of the remote image to the maximum allowed 
                // in the ACP, then reduce the other dimension to maintain the aspect ratio.
                //
                // phpbb 2.0.6 impl
                // $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';

                // new impl
                list($width, $height) = @getimagesize($postrow[$i]['user_avatar']);
                $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'] . '"';
                    }
                }
                $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0"' . $width_attr . $height_attr . '/>' : '';
                // end Resize Remote Avatars mod
                ////////////////////////////////////////////////////////