pjblog的ubbcodeasp文件(5)


  re.Pattern="\[code\](.*?)\[\/code\]"
  strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/code.gif""margin:0px 2px -3px 0px"" alt=""程序代码""/> 程序代码</div><divUBBContent"">$1</div></div>")

re.Pattern="\[quote\](.*?)\[\/quote\]"
  strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/quote.gif""margin:0px 2px -3px 0px"" alt=""引用内容""/> 引用内容</div><divUBBContent"">$1</div></div>")
  re.Pattern="\[quote=(.[^\]]*)\](.*?)\[\/quote\]"
  strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/quote.gif""margin:0px 2px -3px 0px"" alt=""引用来自 $1""/> 引用来自 $1</div><divUBBContent"">$2</div></div>")

re.Pattern="\[hidden\](.*?)\[\/hidden\]"
  if len(memName)>0 then  
   strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/quote.gif""margin:0px 2px -3px 0px"" alt=""显示被隐藏内容""/> 显示被隐藏内容</div><divUBBContent"">$1</div></div>")
   else
   strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/quote.gif""margin:0px 2px -3px 0px"" alt=""隐藏内容""/> 隐藏内容</div><divUBBContent"">该内容已经被作者隐藏,只有会员才允许查阅 <a href=""https://www.jb51.net/login.asp"">登录</a> | <a href=""https://www.jb51.net/register.asp"">注册</a></div></div>")
  end if

  re.Pattern="\[hidden=(.[^\]]*)\](.*?)\[\/hidden\]"
  if len(memName)>0 then  
   strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/quote.gif""margin:0px 2px -3px 0px"" alt=""显示被隐藏内容 $1""/> 显示被隐藏内容来自 $1</div><divUBBContent"">$2</div></div>")
   else
   strContent= re.Replace(strContent,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/quote.gif""margin:0px 2px -3px 0px"" alt=""隐藏内容 $1""/> 隐藏内容</div><divUBBContent"">该内容已经被作者隐藏,只有会员才允许查阅 <a href=""https://www.jb51.net/login.asp"">登录</a> | <a href=""https://www.jb51.net/register.asp"">注册</a></div></div>")
  end if

re.Pattern="\[html\](.*?)\[\/html\]"
  Set strMatchs=re.Execute(strContent)
  For Each strMatch in strMatchs
   RAndomize
   rndID="temp"&Int(100000 * Rnd)
   strContent=Replace(strContent,strMatch.Value,"<divUBBPanel""><divUBBTitle""><img src=""https://www.jb51.net/images/html.gif""margin:0px 2px -3px 0px""> HTML代码</div><divUBBContent""><TEXTAREA rows=""8"""&rndID&""">"&UBBFilter(HTMLDecode(strMatch.SubMatches(0)))& "</TEXTAREA><br/><INPUTrunEx('"&rndID&"')""  type=""button"" value=""运行此代码""/> <INPUTdoCopy('"&rndID&"')""  type=""button"" value=""复制此代码""/><br/> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]</div></div>",1,-1,0)
  Next
  Set strMatchs=nothing
'-----------List标签----------------
   strContent = Replace(strContent,"[list]","<ul>")
   re.Pattern = "\[list=(.[^\]]*)\]"
   strContent = re.Replace(strContent,"<ullist-style-type:$1"">")
   re.Pattern = "\[\*\](.[^\[]*)(\n|)"
   strContent = re.Replace(strContent,"<li>$1</li>")
   strContent = Replace(strContent,"[/list]","</ul>")

'-----------表情图标----------------
  IF Not DisSM=1 Then
   dim log_Smilies,log_SmiliesContent
   For Each log_Smilies IN Arr_Smilies
    log_SmiliesContent=Split(log_Smilies,"|")
    strContent=Replace(strContent,log_SmiliesContent(2)," <img src=""https://www.jb51.net/images/smilies/"&log_SmiliesContent(1)&"""0""margin:0px 0px -2px 0px"" alt=""""/>")
   Next
  End IF

'-----------关键词识别----------------
  IF AutoKEY=1 Then
   dim log_Keywords,log_KeywordsContent
   For Each log_Keywords IN Arr_Keywords
    log_KeywordsContent=Split(log_Keywords,"$|$")
    IF log_KeywordsContent(3)<>"None" Then
     strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""https://www.jb51.net/&log_KeywordsContent(2)&""" target=""_blank""><img src=""https://www.jb51.net/images/keywords/"&log_KeywordsContent(3)&"""0"" alt=""""/> "&log_KeywordsContent(1)&"</a>")
    Else
     strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""https://www.jb51.net/&log_KeywordsContent(2)&""" target=""_blank"">"&log_KeywordsContent(1)&"</a>")
    End IF
   Next
  End IF

Set re=Nothing

UBBCode=strContent
 End IF
End Function
%>

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

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