评论留言加上邮箱和网址
作者:小戒 日期:2007-12-08
到
修改为:
打开common下的function.asp,在最后一个之前插入如下代码.
以下第4和第5点只针对留言插件.
4.打开Plugins/GuestBook/bookaction.asp,找到在其下插入
找
复制内容到剪贴板
程序代码
程序代码 AddComm=array(array("blog_ID",post_logID),array("comm_Content",post_Message),array("comm_Author",username),array("comm_DisSM",post_DisSM),array("comm_DisUBB",post_DisUBB),array("comm_DisIMG",post_disImg),array("comm_AutoURL",post_DisURL),Array("comm_PostIP",getIP),Array("comm_AutoKEY",post_DisKEY))
修改为:
复制内容到剪贴板
程序代码
程序代码 AddComm=array(array("blog_ID",post_logID),array("comm_Content",post_Message),array("comm_Author",username),array("comm_DisSM",post_DisSM),array("comm_DisUBB",post_DisUBB),array("comm_DisIMG",post_disImg),array("comm_AutoURL",post_DisURL),Array("comm_PostIP",getIP),Array("comm_AutoKEY",post_DisKEY),Array("email",email),Array("siteurl",siteurl))
打开common下的function.asp,在最后一个
复制内容到剪贴板
程序代码
程序代码%>
复制内容到剪贴板
程序代码
程序代码Function IsRightUrl(UrlStrng) '网址判断
Dim regEx, retVal
Set regEx = New RegExp
regEx.Pattern = "^https?:\/\/[\u4E00-\u9FA5a-zA-Z\.\/0-9]{3,}[\u4E00-\u9FA5a-zA-Z\/0-9]{2,}$"
regEx.IgnoreCase = False
retVal = regEx.Test(UrlStrng)
If retVal Then
IsRightUrl = true
Else
IsRightUrl = false
End If
End Function
Public function IsValidEmail(email) '邮箱判断
dim names, name, i, c
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
Dim regEx, retVal
Set regEx = New RegExp
regEx.Pattern = "^https?:\/\/[\u4E00-\u9FA5a-zA-Z\.\/0-9]{3,}[\u4E00-\u9FA5a-zA-Z\/0-9]{2,}$"
regEx.IgnoreCase = False
retVal = regEx.Test(UrlStrng)
If retVal Then
IsRightUrl = true
Else
IsRightUrl = false
End If
End Function
Public function IsValidEmail(email) '邮箱判断
dim names, name, i, c
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
以下第4和第5点只针对留言插件.
4.打开Plugins/GuestBook/bookaction.asp,找到
复制内容到剪贴板
程序代码
程序代码 post_Message=request.form("Message")
复制内容到剪贴板
程序代码
程序代码 dim email,siteurl
email=trim(CheckStr(request.form("myblogemail")))
siteurl=trim(CheckStr(request.form("myblogsiteurl")))
email=trim(CheckStr(request.form("myblogemail")))
siteurl=trim(CheckStr(request.form("myblogsiteurl")))
找
[本日志由 小戒 于 2008-05-27 05:25 AM 编辑]
上一篇: PJBLOG去掉最新評論及留言中ubb代碼的方法[本站原創]
下一篇: 留言评论邮件通知博主For pjblog2.6|2.7
文章来自:
Tags: 评论 留言 PJBLOG
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
回复
|
|
]谢谢,我想加上QQ怎么改
我试下看看!
你这个方法修改是必填吗?评论会出错。
Server ?ԏont> ?펳 'ASP 0178 : 80070005'
Server.CreateObject ?Îʴ펳
/common/function.asp??А 8
?첩ȨϞʱ???ԠServer.CreateObject ?ĵ???ܡ??ܾ??ԏÎʡ?
Server ?ԏont> ?펳 'ASP 0178 : 80070005'
Server.CreateObject ?Îʴ펳
/common/function.asp??А 8
?첩ȨϞʱ???ԠServer.CreateObject ?ĵ???ܡ??ܾ??ԏÎʡ?
新版本pj blogcomm.asp代码部分修改了 行不通了哦 
小戒 于 回复
没测试过新版本。呵呵。
prefect! 支持
你的皮肤在1024x768下严重错位。
www.nextway.cn
www.nextway.cn
这样不错了,可以把信箱和主页文字去掉保留图片即可了~
不写邮箱和网址会提示...格式错误啊~
不写邮箱和网址会提示...格式错误啊~
邮箱和网址不要是必须项的为好啊~
要不会给访客带来麻烦,有心的人自然会写这些~
要不会给访客带来麻烦,有心的人自然会写这些~
可以把邮箱和网址以带链接的图片显示出来,效果更佳~
发表评论

