![]() |
| | |||||||
Webmaster Dünyası katogorisi php nuke forumu içinde "Resize Avatar (avatar boyutlandırma)" başlıklı konu görüntüleniyor, "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" ..."
![]() |
| | LinkBack | Seçenekler | Stil |
| | #1 |
| SITE ADMİN ![]() Üyelik tarihi: Nov 2005 Nerden: Samsun/TURKEY Yaş: 33
Mesajlar: 5.310
Blog Mesajları: 21
Cinsiyet: Rep Gücü: 284 Rep: 27642 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Resize Avatar (avatar boyutlandırma) 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" />' : ''; 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
////////////////////////////////////////////////////////
__________________ Akıllı bir adam yalnız kendi tecrübelerinden, çok akıllı bir adam başkalarının da tecrübelerinden yararlanır |
| | |
| Sponsored Links |
![]() |
| Seçenekler | |
| Stil | |
| | |
Benzer Konular | ||||
| Konu | Konuyu Başlatan | Forum | Cevap | Son Mesaj |
| 700 Avatar + 800 Avatar | LeGeND_SmH | Msn, icq, skype, chat, irc, mirc | 0 | 06-10-2007 10:00 PM |
| No Avatar | YukseLL | vBulletin 3.5.X | 1 | 18-04-2006 08:47 AM |
| | |