📄 inc_ubb.asp
字号:
<%
dim CurrentPage '首页显示分页使用
public Function detable(strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
strOutput=strHTML
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "</?table[^>]*>"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "</?tr[^>]*>"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "</?td[^>]*>"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "</?th[^>]*>"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "</?BLOCKQUOTE[^>]*>"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "</?tbody[^>]*>"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "<style[^\s]*"
strOutput = objRegExp.replace(strOutput, "")
detable = strOutput
Set objRegExp = Nothing
End Function
public function profilthtm(strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
strOutput=strHTML
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<img"
strOutput = objRegExp.replace(strOutput,"♂")
objRegExp.Pattern = "(♂[^>]*)>"
strOutput = objRegExp.replace(strOutput,"$1♀")
objRegExp.Pattern = "<[^>]*>"
strOutput = objRegExp.replace(strOutput,"")
objRegExp.Pattern = "style[^\s]*"
strOutput = objRegExp.replace(strOutput, "")
objRegExp.Pattern = "♂"
strOutput = objRegExp.replace(strOutput,"<img")
objRegExp.Pattern = "♀"
strOutput = objRegExp.replace(strOutput,">")
profilthtm = strOutput
Set objRegExp = Nothing
end function
public Function RemoveHTML(strHTML)
ON ERROR RESUME NEXT
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
strOutput = objRegExp.replace(strHTML, "")
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
RemoveHTML = strOutput
Set objRegExp = Nothing
End Function
public Function filtimg(strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
strOutput=strHTML
objRegExp.IgnoreCase = True
objRegExp.Global = True
'感谢官方论坛网友半支烟提供修改思路
' objRegExp.Pattern = "width(>|\s)+=?"
' strOutput = objRegExp.Replace(strOutput,"width=")
' objRegExp.Pattern = "height(>|\s)+=?"
' strOutput = objRegExp.Replace(strOutput,"height=")
objRegExp.Pattern="<img([^>]*)src(=|\s)+([\'\u0022]([\w\./=\?%\-&~`@[\]\':+!]+)[\'\u0022])[^>]*"
strOutput=objRegExp.Replace(strOutput,"<img src=$3" )
'以上只取IMG对象SRC的值,其他全部丢弃
objRegExp.Pattern = "<img(.[^>]*)>"
if oblog.cacheConfig(44) = "1" then
strOutput = objRegExp.Replace(strOutput, "<img$1 onmousewheel=""return bbimg(this)"" >")
end if
if oblog.cacheConfig(43)>0 then
'此处改为JS函数控制大小,防止IMG标记内出现">"造成正则判定出错
strOutput = objRegExp.Replace(strOutput,"<img$1 onclick=""javascript:window.open(this.src);"" style=""CURSOR: pointer"" onload=""rsimg(this,"&oblog.CacheConfig(43)&")"">")
end if
filtimg = strOutput
Set objRegExp = Nothing
End Function
public Function filtskinpath(strHTML)
On Error Resume Next
Dim objRegExp, strOutput
'blogurl="/oblog4/"
Set objRegExp = New Regexp
strOutput=strHTML
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "href=\u0022(attachment\.asp\?[^\u0022]+)"
strOutput=objRegExp.Replace(strOutput,"href="""&blogurl&"$1")
objRegExp.Pattern="src=([^\'^\u0022^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
strOutput=objRegExp.replace(strOutput,"src="""&blogurl&"$1""")
objRegExp.Pattern="src=[\'\u0022]([^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)[\'\u0022]"
strOutput=objRegExp.replace(strOutput,"src="""&blogurl&"$1""")
objRegExp.Pattern="href=([^\'^\u0022^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
strOutput=objRegExp.replace(strOutput,"href="""&blogurl&"$1""")
objRegExp.Pattern="href=[\'\u0022]([^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)[\'\u0022]"
strOutput=objRegExp.replace(strOutput,"href="""&blogurl&"$1""")
objRegExp.Pattern="url[\(]([^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)[\)]"
strOutput=objRegExp.replace(strOutput,"url("&blogurl&"$1)")
objRegExp.Pattern="background=([^\'^\u0022^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
strOutput=objRegExp.replace(strOutput,"background="""&blogurl&"$1""")
objRegExp.Pattern="background=[\'\u0022]([^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)[\'\u0022]"
strOutput=objRegExp.replace(strOutput,"background="""&blogurl&"$1""")
objRegExp.Pattern="value=([^\'^\u0022^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][^# ]*\.[^# \'\u0022^]*)"
strOutput=objRegExp.replace(strOutput,"value="""&blogurl&"$1""")
objRegExp.Pattern="value=[\'\u0022]([^\/^http^http\s^ftp^rt\sp^mm\s^#^\'^\.\.][^# ]*\.[^# ]*)[\'\u0022]"
strOutput=objRegExp.replace(strOutput,"value="""&blogurl&"$1""")
if f_ext="asp" then
strOutput=Replace(strOutput,"<%","<%")
'objRegExp.Pattern="\%\>"
'strOutput=objRegExp.replace(strOutput,"%>")
objRegExp.Pattern="(runat)[^>]*=[^>]*(server)"
strOutput=objRegExp.replace(strOutput,"$1=$2")
end if
filtskinpath=strOutput
set objRegExp=nothing
end Function
public function filt_inc(strHTML)
On Error Resume Next
Dim objRegExp, strOutput
Set objRegExp = New Regexp
strOutput=strHTML
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "#include"
strOutput = objRegExp.replace(strOutput, "#i nclude")
objRegExp.Pattern = "#echo"
strOutput = objRegExp.replace(strOutput, "#e cho")
objRegExp.Pattern = "#flastmod"
strOutput = objRegExp.replace(strOutput, "#f lastmod")
objRegExp.Pattern = "#fsize"
strOutput = objRegExp.replace(strOutput, "#f size")
objRegExp.Pattern = "#exec"
strOutput = objRegExp.replace(strOutput, "#e xec")
objRegExp.Pattern = "#config"
strOutput = objRegExp.replace(strOutput, "#c onfig")
strOutput=Replace(strOutput,"#此前在首页部分显示#","")
' filt_inc = UBBCode(strOutput,1)
filt_inc = strOutput
Set objRegExp = Nothing
end function
public Function filt_include(strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
strOutput=strHTML
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<!-- #include file=[^>]*>"
strOutput = objRegExp.replace(strOutput, oblog.cacheConfig(41))
filt_include = strOutput
Set objRegExp = Nothing
End Function
public Function filtscript(V)
If Not Isnull(V) Then
Dim t,test,Replacelist,t1,re,s,rnum
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
t=v
t1=v
s=v
re.Pattern="$"
t1=re.replace(t1,"$")
re.Pattern="$"
t1=re.replace(t1,"$")
re.Pattern="'"
t1=re.replace(t1,"'")
re.Pattern="'"
t1=re.replace(t1,"'")
If InStr(str_htmlfilt,"|")=0 Then
Replacelist="(&#([0-9][0-9]*)|function|meta|window\.|script|js:|about:|file:|Document\.|vbs:|frame|cookie|on(finish|mouse|Exit=|error|click|key|load|focus|Blur))"
Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -