
03-14-2006, 04:38 PM
|
|
|
Join Date: Jan 2006
Location: Germany
Posts: 333
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by S@NL - BlackBik
OK guys,
Here is the last revision of my code. Finaly got it working:
Code:
/* Start hack Image RESIZE */
// Check to see if image exists
$link = str_replace(" " , "%20", $link);
$link = str_replace("&" , "%26", $link);
// Get host url name for fsockopen to see if server is reachable
$img_host=str_replace('http://','',$link);
$img_host=substr($img_host,0,strpos($img_host,'/'));
// Check is server is reachable and timeout in 5 seconds if not
if (@fclose(@fsockopen($img_host, 80, $fsockerr1, $fsockerr2, 5))) {
// Check if image is on server
if (@fclose(@fopen("$link", "rb"))) {
// Check image size and if oversize, change bbtag
$img_width = getimagesize($link);
if ($img_width[0] > 600) {
$navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($navigator_user_agent, "msie")) {
return '<a href="' . $link . '" target="_blank"><img src="' . $link . '" border="0" alt="' . $vbphrase['click_for_larger_image'] . '" style="width: expression(this.width > 600 ? 600 : true);" /></a>';
} else {
return '<a href="' . $link . '" target="_blank"><img src="' . $link . '" border="0" alt="' . $vbphrase['click_for_larger_image'] . '" style="max-width: 600px;" /></a>';
}
} else {
return '<img src="' . $link . '" border="0" alt="" />';
}
} else {
// Image not found
return '<table border="1" cellpadding="2" id="image_found"><tr><td><FONT color="#FF0000">' . $vbphrase['image_link_broken'] . '</font></td></tr></table>';
}
} else {
// Server is down
return '<table border="1" cellpadding="2" id="image_found"><tr><td><FONT color="#FF0000">' . $vbphrase['image_server_down'] . '</font></td></tr></table>';
}
/* End hack Image RESIZE */
// /* Original code: return '<img src="' . $link . '" border="0" alt="" />'; */
If you are gonna use this, be sure to add the three phrases.
|
What you mean? witch phrases?
And i have the problem, that the screens not in the same width and height... not in proportion. there are to high.
What shel i do?
|