2006-04-15, 02:54 AM
I'm using javascript code to resize images (created by msone). How can I get this javascript to work with the updated functions_post.php?
Code from 1.1.0 using javascript:
Code from 1.1.1 without javascript:
The header includes this code:
Code from 1.1.0 using javascript:
if($allowimgcode)
{
$message = preg_replace("#\[img\]([a-z]+?://){1}(.+?)\[/img\]#i", "<img src=\"$1$2\" border=\"0\" alt=\"\" onload=\"if(largerThan(this.width,500)) {this.width=500;this.alt='Click for full version';}\" onmouseover=\"if(this.alt) this.style.cursor='pointer';\" onclick=\"if(this.alt) window.open('$1$2');\" border=\"0\" />", $message);
$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3})\]([a-z]+?://){1}(.+?)\[/img\]#i", "<img src=\"$3$4\" style=\"border: 0; width: $1px; height: $2px;\" alt=\"\" />", $message);
}
Code from 1.1.1 without javascript:
if($allowimgcode)
{
$message = preg_replace("#\[img\](https?://([^<>\"']+))\[/img\]#i", "<img src=\"$1\" border=\"0\" alt=\"\" />", $message);
$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3})\](https?://([^<>\"']+))\[/img\]#i", "<img src=\"$3\" style=\"border: 0; width: $1px; height: $2px;\" alt=\"\" />", $message);
}
The header includes this code:
<script type="text/javascript">
function largerThan(a,b)
{
return a>b;
}
</script>