Warning: Division by zero in /.../ on line 80
grrr, warum bekomme ich hier immer Division by zero ????

Code: Alles auswählen
global $dbi, $user_prefix;
$allowed_width = 120;
$allowed_height = 120;
$imageborder = 0;
$imagelist = array();
$activenames = array();
$direktory = "images/members";
$handle = opendir ( $direktory );
while ( $file = readdir ( $handle ) ) {
if ( eregi("\.jpe?g$", $file) || eregi("\.gif$", $file) || eregi("\.png$", $file ) ) {
$imagelist[] = $file;
}
}
closedir($handle);
$result = sql_query ( "SELECT uname FROM ".$user_prefix."_users WHERE user_image_active='1'", $dbi );
$activenames_num = sql_num_rows ( $result, $dbi );
if ( intval ( $activenames_num ) >= 1){
$content = "";
while ( list ( $active_uname ) = sql_fetch_row ( $result, $dbi ) ) {
$activenames[] = $active_uname;
}
sql_free_result ( $result );
$random = 0;
shuffle ( $activenames );
$linktarget = "modules.php?name=Your_Account&op=userinfo&uname=$activenames[$random]";
$linkname = "".$activenames[$random]."'s Profil";
$imagedescription = "".$activenames[$random]."'s Bild";
for ( $i = 0; $i < count($imagelist); $i++ ) {
if ( eregi ( "\.jpeg$", $imagelist[$i] ) ) {
$str_file = 5;
} else {
$str_file = 4;
}
if ( $activenames[$random] == substr ( $imagelist[$i], 0, strlen ( $imagelist[$i] )-$str_file ) ) {
$random_member_pic = $imagelist[$i];
$info = @getimagesize ( "images/members/$imagelist[$i]" );
} else {
}
}
$width = $info['0'];
$height = $info['1'];
$x_ratio = $allowed_width / $width;
$y_ratio = $allowed_height / $height;
if ( $width <= $allowed_width && $height <= $allowed_height ) {
$resized_width = $width;
$resized_height = $height;
} elseif ( ( $x_ratio * $height ) < $allowed_height ) {
$resized_height = ceil ( $x_ratio * $height );
$resized_width = $allowed_width;
} else {
$resized_width = ceil ($y_ratio * $width );
$resized_height = $allowed_height;
Zeile 80: $y_ratio = $allowed_height / $height;