百独托管7500 紫田网络超高转化播放器收cps[推荐]速盾CDN 免实名免备防屏蔽阿里云 爆款特卖9.9元封顶提升alexa、IP流量7Q5团队
【腾讯云】中小企福利专场【腾讯云】多款产品1折起高防 随时退换 好耶数据小飞国外网赚带你月入万元炎黄网络4H4G10M 99每月
香港带宽CN2/美国站群优惠中客数据中心 服务器租用联盟系统移动广告平台 中易企业专场腾讯云服务器2.5折九九数据 工信部正规资质
腾讯云新用户大礼包代金券高价收cpa注册量高价展示【腾讯云】2核2G/9.93起租服务器找45互联 随时退换阿里云 短信服务 验证秒达

[技术交流] 求大神帮帮忙看下这段代码 [复制链接]
查看:3543 | 回复:1

23

主题

42

帖子

56

积分

落伍者(一心一意)

Rank: 1

贡献
5
鲜花
1
注册时间
2013-10-26

落伍微信绑定QQ绑定落伍手机绑定

发表于 2013-11-28 15:09:14 | |阅读模式 来自 中国浙江温州
  1.                 If SettingArray(9) = "1" Then
  2.                         '自动识别网址
  3.                         re.Pattern="(^|[^<>='""])((http|https|ftp|rtsp|mms|ed2k):(\/\/|\\\\)(([\w\/\\\+\-~`@:%\/\|])+\.)+([\w\/\\\.\=\?\+\-~`@\':!%#\/\|]|(&amp;))+)"
  4.                         strContent=re.Replace(strContent,"$1<a target=""_blank"" href=""$2"">$2</a>")

  5.                         '自动识别www等开头的网址
  6.                         're.Pattern="(^|[^\/\\\w\=])((www|bbs)\.(\w)+\.([\w\/\\\.\=\?\+\-~`@\'!%#]|(&amp;))+)"
  7.                         'strContent=re.Replace(strContent,"$1<a target=""_blank"" href=""http://$2"">$2</a>")
  8.                 End If
  9.                 If SettingArray(10) = "0" Then
  10.                         strContent=ProcessUbbCode_Key(strContent)
  11.                 End If
  12.                 re.Pattern="(<div style=""page-break-after: always""[^>]*?>([\w\W]*?)<\/div>)"
  13.                 strContent=re.Replace(strContent, "[page_break]")
  14.                 re.Pattern="((\[NextPage\])|(\[Page_Break\]))"
  15.                 strContent=re.Replace(strContent,"[page_break]")
  16.                 re.Pattern="(<br[^>]*?>)"
  17.                 strContent=re.Replace(strContent, "<br/>")
  18.                 strContent = xmldecode(strContent)

  19.                 maxpagesize = Newasp.ChkNumeric(SettingArray(12))
  20.                 If IsPagination And maxpagesize > 99 Then
  21.                         strContent = InsertPageBreak(strContent)
  22.                 End If
  23.                 IsPagination = False
  24.                 If m_intCurrentID>0 And EnabledUbbSession Then
  25.                         Session("NowContents")=strContent
  26.                 End If
  27.                 UBBCode = strContent
  28.         End Function

  29.         Private Function checkXHTML()
  30.                 checkXHTML=xmldecode(Mid(xml.documentElement.xml,6,Len (xml.documentElement.xml)-11))
  31.         End Function
  32.         Function checkimg(textstr)
  33.                 Dim node,srctext,newnode
  34.                 If xml.loadxml("<div>" & xmlencode(textstr) &"</div>")Then
  35.                         For Each Node in xml.documentElement.getElementsByTagName("img")
  36.                                 '-- 是否开启滚轮改变图片大小的功能,如果不需要可以屏蔽
  37.                                 '-- Node.attributes.setNamedItem(xml.createNode(2,"onmousewheel","")).text="return bbimg(this);"
  38.                                 Node.attributes.setNamedItem(xml.createNode(2,"border","")).text=0
  39.                                 If m_intResize = 9 Then
  40.                                         Node.attributes.removeNamedItem("onload")
  41.                                         Node.attributes.removeNamedItem("onclick")
  42.                                         Node.attributes.removeNamedItem("style")
  43.                                 Else
  44.                                         Node.attributes.setNamedItem(xml.createNode(2,"onload","")).text=m_strImgzoom
  45.                                         Node.attributes.setNamedItem(xml.createNode(2,"style","")).text="cursor:pointer;"
  46.                                         Node.attributes.setNamedItem(xml.createNode(2,"onclick","")).text="javascript:window.open(this.src);"
  47.                                 End If
  48.                                 '--删除相关节点
  49.                                 If m_strTitle <> "" Then
  50.                                         Node.attributes.setNamedItem(xml.createNode(2,"alt","")).text=m_strTitle
  51.                                 End If
  52.                                 Node.attributes.removeNamedItem("title")
  53.                                 Node.attributes.removeNamedItem("twffan")
  54.                                 Node.attributes.removeNamedItem("onerror")
  55.                                 If Not Node.parentNode is Nothing Then
  56.                                         If Node.parentNode.nodename = "a" Then
  57.                                                 Node.attributes.removeNamedItem("onclick")
  58.                                                 Node.attributes.setNamedItem(xml.createNode(2,"target","")).text="_blank"
  59.                                         End If
  60.                                 End If
  61.                         Next
  62.                         checkimg=xmldecode(Mid(xml.documentElement.xml,6,Len (xml.documentElement.xml)-11))
  63.                 Else
  64.                         checkimg=textstr
  65.                 End If
  66.         End Function
  67.         Private Function bbimg(strText)
  68.                 Dim s
  69.                 s=strText
  70.                 re.Pattern="<img(\w*) style\s*=""*([^>|""]*)""([^>]*)>"
  71.                 s=re.Replace(s,"<img$1$3>")
  72.                 re.Pattern="<img(.[^>]*)>"
  73.                 s=re.Replace(s, "<img$1/>")
  74.                 re.Pattern="(\/\/>)"
  75.                 s=re.Replace(s, "/>")
  76.                 re.Pattern="<img(.[^>]*)([/| ])>"
  77.                 s=re.Replace(s,"<img$1/>")
  78.                 If m_intResize <> 9 Then
  79.                         re.Pattern="<img(.[^>]*)/>"
  80.                         s=re.Replace(s,"<a href=""图片地址这里怎么填 "" rel=""lightbox""><img$1 onload="""&m_strImgzoom&""" onclick=""javascript:window.open(this.src);"" style=""cursor:pointer;""/></a>")
  81.                 End If
  82.                 bbimg=s
  83.         End Function
复制代码
广西在线www.999fl.cc

353

主题

4410

帖子

5738

积分

落伍热心会员

傻哥

Rank: 7Rank: 7Rank: 7

贡献
1309
鲜花
56
注册时间
2010-6-21

落伍草根英雄QQ绑定落伍者落伍手机绑定

发表于 2013-12-4 11:08:41 | 来自 中国湖北武汉
不知道你想表达什么
vx:8914137  qcmks.com  汽车域名出售~
论坛客服/商务合作/投诉举报:2171544 (QQ)
落伍者创建于2001/03/14,本站内容均为会员发表,并不代表落伍立场!
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论!
落伍官方微信:2030286 邮箱:(djfsys@gmail.com|tech@im286.com)
© 2001-2014

浙公网安备 33060302000191号

浙ICP备11034705号 BBS专项电子公告通信管[2010]226号

  落伍法律顾问: ITlaw-庄毅雄

手机版|找回帐号|不能发帖?|Archiver|落伍者

GMT+8, 2024-5-4 15:39 , Processed in 0.102879 second(s), 33 queries , Gzip On.

返回顶部