好了,现在博客升级程序了,看了七夜兄的博客修改方法改了一下,已经很完美了.
Wednesday, August 10, 2005 | Author: chun
增加了返回顶部.

<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



发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。