All pastes #105755 Raw Edit

Something

public text v1 · immutable
#105755 ·published 2006-07-29 22:05 UTC
rendered paste body
function 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>";
	}
}