I wanted some help with bbcode, if someone post an image this bbcode do his job:
$bbcode = eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]", do_image_post("\\1"),$bbcode);
function do_image_post($link) {
$link = str_replace('\\"', '', $link);
$link = str_replace(' ', '%20', $link);
/*
$size = getimagesize($link);
$height = $size[1];
$width = $size[0];
$extra = "";
if ($width > 400) {
$width = 400;
$percent = ($size[0] / $width);
$height = ($size[1] / $percent);
$extra = "<br><a href=\"" . $link . "\"><b>See Image Full Size</b></a>";
}
$link = "<img src=\"". $link ."\" border=\"0\" height=\"" . $height . "\" width=\"" . $width . "\" >". $extra;
*/
$link = "<img src=\"" . $link . "\" border=\"0\" onLoad=\" if(this.width > 400) { this.width = 400; } \" >";
// onclick=\"if(this.width > 400) { window.open('".$link."','','scrollbars=1,toolbar=0,resizable=1,menubar=0,directories=0,status=0') } \" >";
return $link;
}
I saw that i cant request the imagelink because the php code will see the image link as \1 and not as a full image link.
So what i want to do is if the width is larger then 400 then resize the width to 400 (which work with the javascript though) and i wanted an image url right under the image that shows the full image in a blank window (that i dont get working also not in javascript)
How can i do this?