rendered paste bodyfunction img_check($string, $width) {
if($width > "475") {
return "<b><img src=http://www.chill-plaza.nl/hrose/forum/images/error.gif width=12 border=0> Image too big!<br>Please use thumbnails<br></b><font color=black><a href=\"".$string."\" border=\"0\" alt=\"\">Click here for the image</font></a>";
} else {
$string = trim($string);
if(preg_match("/^(ht|f)tp:\/\/([a-z0-9-]+(\.[a-z0-9-]+)*\.[a-z0-9]{1,4})(\/[\w%~!*().\'[:space:]-]+)+\.(jpe?g|png|gif|bmp)(\?[=&+\w%@:\/.~!*()\'-]*)?$/ix", $string)) {
return "<img width=\"".$width."\" src=\"".$string."\" border=\"0\" alt=\"\">";
} else {
return "<b><img src=http://www.chill-plaza.nl/hrose/forum/images/error.gif border=0> Invalid Image!</b>";
}
}
}
function img_check2($string) {
$string = trim($string);
if(preg_match("/^(ht|f)tp:\/\/([a-z0-9-]+(\.[a-z0-9-]+)*\.[a-z0-9]{1,4})(\/[\w%~!*().\'[:space:]-]+)+\.(jpe?g|png|gif|bmp)(\?[=&+\w%@:\/.~!*()\'-]*)?$/ix", $string)) {
$size = @getimagesize($string);
$width = $size[0];
if ($width > "475") {
return "<b><img src=http://www.chill-plaza.nl/hrose/forum/images/error.gif width=12 border=0> Image too big!<br>Please use thumbnails<br></b><a href=\"".$string."\" border=\"0\" alt=\"\"><font color=\"black\">Click here for the image</font></a>";
} else {
$new_width = "".$width."";
}
return "<img width=\"".$new_width."\" src=\"".$string."\" border=\"0\" alt=\"\">";
} else {
return "<b><img src=http://www.chill-plaza.nl/hrose/forum/images/error.gif width=12 border=0> Invalid Image!</b>";
}
}