|
发表于 2013-11-28 15:09:14
|
|阅读模式
来自 中国浙江温州
- If SettingArray(9) = "1" Then
- '自动识别网址
- re.Pattern="(^|[^<>='""])((http|https|ftp|rtsp|mms|ed2k):(\/\/|\\\\)(([\w\/\\\+\-~`@:%\/\|])+\.)+([\w\/\\\.\=\?\+\-~`@\':!%#\/\|]|(&))+)"
- strContent=re.Replace(strContent,"$1<a target=""_blank"" href=""$2"">$2</a>")
- '自动识别www等开头的网址
- 're.Pattern="(^|[^\/\\\w\=])((www|bbs)\.(\w)+\.([\w\/\\\.\=\?\+\-~`@\'!%#]|(&))+)"
- 'strContent=re.Replace(strContent,"$1<a target=""_blank"" href=""http://$2"">$2</a>")
- End If
- If SettingArray(10) = "0" Then
- strContent=ProcessUbbCode_Key(strContent)
- End If
- re.Pattern="(<div style=""page-break-after: always""[^>]*?>([\w\W]*?)<\/div>)"
- strContent=re.Replace(strContent, "[page_break]")
- re.Pattern="((\[NextPage\])|(\[Page_Break\]))"
- strContent=re.Replace(strContent,"[page_break]")
- re.Pattern="(<br[^>]*?>)"
- strContent=re.Replace(strContent, "<br/>")
- strContent = xmldecode(strContent)
- maxpagesize = Newasp.ChkNumeric(SettingArray(12))
- If IsPagination And maxpagesize > 99 Then
- strContent = InsertPageBreak(strContent)
- End If
- IsPagination = False
- If m_intCurrentID>0 And EnabledUbbSession Then
- Session("NowContents")=strContent
- End If
- UBBCode = strContent
- End Function
- Private Function checkXHTML()
- checkXHTML=xmldecode(Mid(xml.documentElement.xml,6,Len (xml.documentElement.xml)-11))
- End Function
- Function checkimg(textstr)
- Dim node,srctext,newnode
- If xml.loadxml("<div>" & xmlencode(textstr) &"</div>")Then
- For Each Node in xml.documentElement.getElementsByTagName("img")
- '-- 是否开启滚轮改变图片大小的功能,如果不需要可以屏蔽
- '-- Node.attributes.setNamedItem(xml.createNode(2,"onmousewheel","")).text="return bbimg(this);"
- Node.attributes.setNamedItem(xml.createNode(2,"border","")).text=0
- If m_intResize = 9 Then
- Node.attributes.removeNamedItem("onload")
- Node.attributes.removeNamedItem("onclick")
- Node.attributes.removeNamedItem("style")
- Else
- Node.attributes.setNamedItem(xml.createNode(2,"onload","")).text=m_strImgzoom
- Node.attributes.setNamedItem(xml.createNode(2,"style","")).text="cursor:pointer;"
- Node.attributes.setNamedItem(xml.createNode(2,"onclick","")).text="javascript:window.open(this.src);"
- End If
- '--删除相关节点
- If m_strTitle <> "" Then
- Node.attributes.setNamedItem(xml.createNode(2,"alt","")).text=m_strTitle
- End If
- Node.attributes.removeNamedItem("title")
- Node.attributes.removeNamedItem("twffan")
- Node.attributes.removeNamedItem("onerror")
- If Not Node.parentNode is Nothing Then
- If Node.parentNode.nodename = "a" Then
- Node.attributes.removeNamedItem("onclick")
- Node.attributes.setNamedItem(xml.createNode(2,"target","")).text="_blank"
- End If
- End If
- Next
- checkimg=xmldecode(Mid(xml.documentElement.xml,6,Len (xml.documentElement.xml)-11))
- Else
- checkimg=textstr
- End If
- End Function
- Private Function bbimg(strText)
- Dim s
- s=strText
- re.Pattern="<img(\w*) style\s*=""*([^>|""]*)""([^>]*)>"
- s=re.Replace(s,"<img$1$3>")
- re.Pattern="<img(.[^>]*)>"
- s=re.Replace(s, "<img$1/>")
- re.Pattern="(\/\/>)"
- s=re.Replace(s, "/>")
- re.Pattern="<img(.[^>]*)([/| ])>"
- s=re.Replace(s,"<img$1/>")
- If m_intResize <> 9 Then
- re.Pattern="<img(.[^>]*)/>"
- s=re.Replace(s,"<a href=""图片地址这里怎么填 "" rel=""lightbox""><img$1 onload="""&m_strImgzoom&""" onclick=""javascript:window.open(this.src);"" style=""cursor:pointer;""/></a>")
- End If
- bbimg=s
- End Function
复制代码 |
|