冰封王座宇宙法:如何让ubb控制图片大小

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 21:52:03
要求实现图片宽度如果大于500 缩放的500显示 请帮助修改

------代码----------
<%
const ImagePath="images/"
function UBBCode(strContent)
strContent= FilterJS(strContent)
dim re
dim po,ii
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
po=0
ii=0

re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
strContent=re.Replace(strContent,"<a onfocus=this.blur() href=""$1://$2"" target=_blank><IMG SRC=""$1://$2"" width='500' border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></a>")
re.Pattern="\[UPLOAD=(gif|jpg|jpeg|bmp|png)\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/UPLOAD\]"
strContent= re.Replace(strContent,"<br><IMG SRC="""&ImagePath&"$1.gif"" border=0>此主题相关图片如下:<br><A HREF=""$2$1"" TARGET=_blank><IMG SRC=""$2$1"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></A>")

re.Pattern="\[UPLOAD=(.[^\[]*)\](.[^\[]*)\[\/UPLOAD\]"
strContent= re.Replace(strContent,"<br><IMG SRC="""&ImagePath&"$1.gif"" border=0> <a href=""$2"">点击浏览该文件</a>")

........

onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""

改成onload=""javascript:if(this.width>500)this.width=500""