<a name="top">
<a href="#top" title="返回顶部">↑TOP</a>
9.图片自动缩小及添加链接
c_function.asp 435行
If Instr(strType,"[image]")>0 And ZC_UBB_IMAGE_ENABLE Then
'[img]
objRegExp.Pattern="(\[IMG=)([0-9]*),([0-9]*),(.*)(\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$6"" target=_blank><img src=""$6"" alt=""$4"" title=""$4"" width=""$2"" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG=)([0-9]*),(.*)(\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$5"" target=_blank><img src=""$5"" alt=""$3"" title=""$3"" width=""$2"" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$2"" target=_blank><img src=""$2"" alt="""" title="""" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG_LEFT=)([0-9]*),([0-9]*),(.*)(\])(.+?)(\[\/IMG_LEFT\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$6"" target=_blank><img style=""float:left"" src=""$6"" alt=""$4"" title=""$4"" width=""$2"" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG_LEFT=)([0-9]*),(.*)(\])(.+?)(\[\/IMG_LEFT\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$5"" target=_blank><img style=""float:left"" src=""$5"" alt=""$3"" title=""$3"" width=""$2"" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG_LEFT\])(.+?)(\[\/IMG_LEFT\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$2"" target=_blank><img style=""float:left"" src=""$2"" alt="""" title="""" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG_RIGHT=)([0-9]*),([0-9]*),(.*)(\])(.+?)(\[\/IMG_RIGHT\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$6"" target=_blank><img style=""float:right"" src=""$6"" alt=""$4"" title=""$4"" width=""$2"" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG_RIGHT=)([0-9]*),(.*)(\])(.+?)(\[\/IMG_RIGHT\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$5"" target=_blank><img style=""float:right"" src=""$5"" alt=""$3"" title=""$3"" width=""$2"" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
objRegExp.Pattern="(\[IMG_RIGHT\])(.+?)(\[\/IMG_RIGHT\])"
strContent= objRegExp.Replace(strContent,"<a onfocus='this.blur()' href=""$2"" target=_blank><img style=""float:right"" src=""$2"" alt="""" title="""" onload='javascript:if(this.width>screen.width-520)this.width=screen.width-520' /></a>")
End If
