让广告成为历史
来源:互联网 发布:mac tar.gz 解压命令 编辑:程序博客网 时间:2024/04/28 09:22
现在BLOG越来越流行了,但那些烦人的广告依旧层出不穷。今天闲来无事,写了一小段屏蔽广告的函数(当然只能用于有源代码的BLOG),和大家一起分享。如果那位有更好,也别忘了给介绍介绍。
代码如下:
<%
'/////////////////////////////////////////////////////////
'函数名:ADShield
'函数作用:广告屏蔽
'参数:strcontent
'参数含义:待处理的文本
'////////////////////////////////////////////////////////
function ADShield(strcontent)
dim strtext
dim mystring
dim i,j,n
j=1
ADShield=true
strtext=lcase(strcontent)
mystring=split(strtext,"url","-1","1")
n=UBound(MyString)
'评论中的超级连接超过3个句开始判断
if n<=6 then
ADShield=true
exit function
else
strtext=replace(replace(replace(strtext,"[url=http://","/"),"[/url]",""),"]","/")
mystring=split(strtext,"/","-1","1")
for i=lbound(mystring) to ubound(mystring)
if i+2<=ubound(mystring) then
if trim(mystring(i))=trim(mystring(i+2)) then
j=j+1
end if
end if
next
'连接域名和连接文字重复出现5次以上就不能发表评论
if j>=5 then
ADShield=false
exit function
end if
ADShield=true
exit function
end if
end function
%>
代码如下:
<%
'/////////////////////////////////////////////////////////
'函数名:ADShield
'函数作用:广告屏蔽
'参数:strcontent
'参数含义:待处理的文本
'////////////////////////////////////////////////////////
function ADShield(strcontent)
dim strtext
dim mystring
dim i,j,n
j=1
ADShield=true
strtext=lcase(strcontent)
mystring=split(strtext,"url","-1","1")
n=UBound(MyString)
'评论中的超级连接超过3个句开始判断
if n<=6 then
ADShield=true
exit function
else
strtext=replace(replace(replace(strtext,"[url=http://","/"),"[/url]",""),"]","/")
mystring=split(strtext,"/","-1","1")
for i=lbound(mystring) to ubound(mystring)
if i+2<=ubound(mystring) then
if trim(mystring(i))=trim(mystring(i+2)) then
j=j+1
end if
end if
next
'连接域名和连接文字重复出现5次以上就不能发表评论
if j>=5 then
ADShield=false
exit function
end if
ADShield=true
exit function
end if
end function
%>
- 让广告成为历史
- aiCache让WAP成为历史
- 掌纹识别技术解决安全问题 让密码成为历史
- TFS 2010 让安装更简单,也让VSS成为历史
- TFS 2010 让安装更简单,也让VSS成为历史
- 让木马病毒DNS数据传输成为历史:看我如何让XShell病毒失效
- 让分叉成为历史?一个区块链世界的新物种
- 医改让天价药单成为历史
- 计算广告的历史、现状及未来
- 让程序员成为正常人
- 让创新成为习惯
- 让思念成为动力
- 让学习成为习惯
- 让自己成为太阳
- 让这些成为习惯
- 让自己成为太阳
- 让自己成为太阳
- 让自己成为“太阳”
- 确定kernel32.dll基址的方法
- 创造者的鉴赏力
- SIS包和本地化资源文件
- 学习appfuse各种resource link
- javascript控制页面控件隐藏显示
- 让广告成为历史
- 2006/12/01 来日本的第一个项目
- RegisterStartupScript() 和 RegisterClientScriptBlock()
- 如何实现自编号
- 学习appfuse各种resource link
- 发个龙哥的精彩武打视频
- Java Serialization UID 问题的完美解决方案
- 用注册表修改XP之系统修改集
- vc项目过期解决办法