Quote:
Originally Posted by makaveli420
I would prefer to just display the original size of the persons avatar.
|
try this.
in login_inc.php find
PHP Code:
$userid=$vbulletin->userinfo['userid'];
$file = $forumpath."/image.php?u=$userid";
list($width, $height, $type) = getimagesize($file);
if ( $width <= $maxw AND $height <= $maxh )// check width and height
{// if width and height under size display unchanged
echo "<img src=\"$file.$type\" align=\"center\" border=\"0\">";
}
else
{
if ($width > $maxw)//check if width is too wide
{ // if it is, resize
$ratio = $width / $maxw; //work out resize ratio
$newwidth = $maxw; // new width
$newheight = ($height / $ratio); // new height at this resize
}
else
{
$newheight = $height; // if width is ok, set this cos we need it later
$newwidth = $width; // if width was ok, set this cos we ned it later
}
If ($newheight <= $maxh )
{
// if current height is ok, were done.
}
else // either origional or resized height is too big
if( $newheight >= $maxh )
{ // if resized height is still too big we resize it
$ratio2 = $newheight / $maxh; //work out resize ratio
$newheight = $maxh; // give $newheight a new value
$newwidth = ($newwidth / $ratio2); // new width at this resize
} // the value of $newwidth has just been changed
else
{// if were here then origional height is too big so we resize it
$ratio2 = $newheight / $maxh; //work out resize ratio
$newheight = $maxh; // give $newheight a new value
$newwidth = ($newwidth / $ratio2); // new width at this resize
}
// now we can finally display resized pic
echo "<img src=\"$file.$type\" border=\"0\" width = \"$newwidth\" height = \"$newheight\" align=\"center\">"; // display resized pic
}
// +++++++++++++++++++++++
// end avatar display code
// +++++++++++++++++++++++
and replace it with
PHP Code:
$userid=$vbulletin->userinfo['userid'];
$file = $forumpath."/image.php?u=$userid";
echo "<img src=\"$file\" border=\"0\" align=\"center\">"; // display resized pic
// +++++++++++++++++++++++
// end avatar display code
// +++++++++++++++++++++++
I havent tested it, so let me know it it does not work.