Well written code, but pages load really slow! Not good for a big site.
Heres what Ive done, which works on client-side:
PHP Code:
//replace (around line 1015) in includes/functions_bbcodeparse.php
return '<img src="' . $link . '" border="0" alt="" />';
//with
return '<img src="' . $link . '" alt="" OnLoad="if(this.width > 500) {this.width=500; this.style.cursor=\'hand\'; this.title=\'Click Here to open the image in a new window\';}" onClick="javascript:window.open(\'' . $link . '\',\'\',\'scrollbars=1,toolbar=0,resizable=1,menubar=0,directories=0,status=0\')" border="0" />';
Thats it. It works fine, but if the images load from your cache, this fails! If theres something that can be done to cached images, this code will work perfectly!