pjblog的ubbcodeasp文件(4)

'-----------字体格式----------------
      re.Pattern="\[align=(\w{4,6})\]([^\r]*?)\[\/align\]"
   strContent=re.Replace(strContent,"<div$1"">$2</div>")
        re.Pattern="\[color=(#\w{3,10}|\w{3,10})\]([^\r]*?)\[\/color\]"
   strContent=re.Replace(strContent,"<spancolor:$1"">$2</span>")
      re.Pattern="\[size=(\d{1,2})\]([^\r]*?)\[\/size\]"
   strContent=re.Replace(strContent,"<spanfont-size:$1pt"">$2</span>")
      re.Pattern="\[font=([^\r]*?)\]([^\r]*?)\[\/font\]"
   strContent=re.Replace(strContent,"<spanfont-family:$1"">$2</span>")
   re.Pattern="\[b\]([^\r]*?)\[\/b\]"
   strContent=re.Replace(strContent,"<strong>$1</strong>")
      re.Pattern="\[i\]([^\r]*?)\[\/i\]"
   strContent=re.Replace(strContent,"<i>$1</i>")
      re.Pattern="\[u\]([^\r]*?)\[\/u\]"
   strContent=re.Replace(strContent,"<u>$1</u>")
      re.Pattern="\[s\]([^\r]*?)\[\/s\]"
   strContent=re.Replace(strContent,"<s>$1</s>")
      re.Pattern="\[sup\]([^\r]*?)\[\/sup\]"
   strContent=re.Replace(strContent,"<sup>$1</sup>")
      re.Pattern="\[sub\]([^\r]*?)\[\/sub\]"
   strContent=re.Replace(strContent,"<sub>$1</sub>")
      re.Pattern="\[fly\]([^\r]*?)\[\/fly\]"
   strContent=re.Replace(strContent,"<marquee90%"" behavior=""alternate"" scrollamount=""3"">$1</marquee>")

  End IF

'-----------特殊标签----------------
  re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
  Set strMatchs=re.Execute(strContent)
  For Each strMatch in strMatchs
   tmpStr1=checkURL(strMatch.SubMatches(0))
   tmpStr2=strMatch.SubMatches(1)
   strContent=replace(strContent,strMatch.Value,"<img src=""https://www.jb51.net/images/download.gif"" alt=""下载文件""margin:0px 2px -4px 0px""/> <a href="""https://www.jb51.net/&tmpStr1&""" target=""_blank"">"https://www.jb51.net/&tmpStr2&"</a>",1,-1,0)
  Next  

  re.Pattern = "\[down\](.[^\[]*)\[\/down]"
  Set strMatchs=re.Execute(strContent)
  For Each strMatch in strMatchs
   tmpStr1=checkURL(strMatch.SubMatches(0))
   strContent=replace(strContent,strMatch.Value,"<img src=""https://www.jb51.net/images/download.gif"" alt=""下载文件""margin:0px 2px -4px 0px""/> <a href="""https://www.jb51.net/&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
  Next

re.Pattern = "\[mDown=(.[^\]]*)\](.[^\[]*)\[\/mDown]"
  Set strMatchs=re.Execute(strContent)
  For Each strMatch in strMatchs
   tmpStr1=checkURL(strMatch.SubMatches(0))
   tmpStr2=strMatch.SubMatches(1)
   if len(memName)>0 then
    strContent=replace(strContent,strMatch.Value,"<img src=""https://www.jb51.net/images/download.gif"" alt=""下载文件""margin:0px 2px -4px 0px""/> <a href="""https://www.jb51.net/&tmpStr1&""" target=""_blank"">"https://www.jb51.net/&tmpStr2&"</a>",1,-1,0)
    else
    strContent=replace(strContent,strMatch.Value,"<img src=""https://www.jb51.net/images/download.gif"" alt=""只允许会员下载""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""https://www.jb51.net/login.asp"">登录</a> | <a href=""https://www.jb51.net/register.asp"">注册</a>",1,-1,0)
   end if
  Next

re.Pattern = "\[mDown\](.[^\[]*)\[\/mDown]"
  Set strMatchs=re.Execute(strContent)
  For Each strMatch in strMatchs
   tmpStr1=checkURL(strMatch.SubMatches(0))
   if len(memName)>0 then
    strContent=replace(strContent,strMatch.Value,"<img src=""https://www.jb51.net/images/download.gif"" alt=""下载文件""margin:0px 2px -4px 0px""/> <a href="""https://www.jb51.net/&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
    else
    strContent=replace(strContent,strMatch.Value,"<img src=""https://www.jb51.net/images/download.gif"" alt=""只允许会员下载""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""https://www.jb51.net/login.asp"">登录</a> | <a href=""https://www.jb51.net/register.asp"">注册</a>",1,-1,0)
   end if
  Next

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wfzzgs.html