code的显示方式修改,现在还有一个问题就是code里面的链接也自动识别了,需要取消
找到ubbcode.asp以下代码并加入,
[code]ElseIF DisUBB=1 Then
code的显示方式修改,现在还有一个问题就是code里面的链接也自动识别了,需要取消
找到ubbcode.asp以下代码并加入,
[code]ElseIF DisUBB=1 Then
strContent=Replace(strContent,"","")
UBBCode=strContent
Exit Function
Else
strContent=Replace(strContent,"","")
Dim re, strMatches, strMatch, tmpStr1, tmpStr2, tmpStr3, tmpStr4, RNDStr
[/code]
[code]re.Pattern = "\[url=(.[^\]]*)\](.*?)\[\/url]"
Set strMatches=re.Execute(strContent)
For Each strMatch In strMatches
tmpStr1=CheckLinkStr(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=Replace(strContent,strMatch.Value,""&tmpStr2&"")
Next
Set strMatches=Nothing
re.Pattern = "\[url](.*?)\[\/url]"
Set strMatches=re.Execute(strContent)
For Each strMatch In strMatches
tmpStr1=CheckLinkStr(strMatch.SubMatches(0))
tmpStr2=CutURL(tmpStr1)
strContent=Replace(strContent,strMatch.Value,""&tmpStr2&"")
Next
Set strMatches=Nothing
re.Pattern = "\[email=(.[^\]]*)\](.*?)\[\/email]"
strContent = re.Replace(strContent,"$2")[/code]
[code]re.Pattern="\[code\](.*?)\[\/code\]"
Set strMatches=re.Execute(strContent)
For Each strMatch In strMatches
RNDStr=Int(7999 * Rnd + 2000)
tmpStr1=strMatch.SubMatches(0)
strContent= Replace(strContent,strMatch.Value,"
程序代码: | [ 复制代码到剪贴板 ] |
Next
Set strMatches=Nothing[/code]
在文件最后加入
[code]Function CutURL(URLStr)
Dim URLLen
URLLen=Len(URLStr)
If URLLen>65 Then
CutURL=Left(URLStr,URLLen*0.5)&" ... "&Right(URLStr,URLLen*0.3)
Else
CutURL=URLStr
End If
End Function
%>[/code]
再修改样式表:
[code].code_head { margin: 2px; font: bold 12px Verdana, Tahoma, "宋体"; table-layout: fixed; word-wrap: break-word;}[/code]