给日志评论增加回复功能for pjblog (4/5凌晨更新,修改越权提交的BUG,危险)
作者:小戒 日期:2007-12-12
0; conn.execute("Update blog_Comment SET comm_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',comm_Reply='"&checkStr(Request.form("reply_"&doCommID(i)))&"',Comm_replytime='"&now&"' Where comm_ID="&doCommID(i))
找到第二处的(有两处)在下面插入:4.找到修改为:5.
找到到中间的几行代码,全部替换为:6。下载附件,上传Update.ASP到博客目录执行升级数据库。
OK。全文完。
点击下载此文件
找到第二处的(有两处)
复制内容到剪贴板
程序代码
程序代码 <div class="content"><textarea name="message_<%=commArr(0,Pcount)%>" onFocus="focusMe(this)" onBlur="blurMe(this)" onMouseOver="overMe(this)" onMouseOut="outMe(this)"><%=UnCheckStr(commArr(1,Pcount))%></textarea></div>
复制内容到剪贴板
程序代码
程序代码 <div class="reply"><h5>回复内容:<%if len(trim(commArr(7,Pcount)))<1 or IsNull(commArr(7,Pcount)) then response.write "<span class=""tip"">(无回复留言)</span>"%></h5><textarea name="reply_<%=commArr(0,Pcount)%>" onFocus="focusMe(this)" onBlur="blurMe(this)" onMouseOver="overMe(this)" onMouseOut="outMe(this)" onChange="checkMe(this)"><%=UnCheckStr(commArr(7,Pcount))%></textarea></div>
复制内容到剪贴板
程序代码
程序代码 SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_PostIP,blog_ID,T.log_Title from blog_Comment C,blog_Content T Where C.blog_ID=T.log_ID orDER BY C.comm_PostTime desc"
复制内容到剪贴板
程序代码
程序代码 SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_PostIP,blog_ID,T.log_Title,comm_Reply from blog_Comment C,blog_Content T Where C.blog_ID=T.log_ID orDER BY C.comm_PostTime desc"
找到
复制内容到剪贴板
程序代码
程序代码elseif Request.form("doModule")="Update" then
for i=0 to ubound(doCommID)
if Request.form("whatdo")="msg" then
for i=0 to ubound(doCommID)
if Request.form("whatdo")="msg" then
复制内容到剪贴板
程序代码
程序代码doTitle="评论"
doRedirect=""
end if
next
doRedirect=""
end if
next
复制内容到剪贴板
程序代码
程序代码 dim blog_book_reply
set blog_book_reply=Conn.Execute("select book_reply FROM blog_book Where book_ID="&doCommID(i))
if blog_book_reply("book_reply")=checkStr(Request.form("reply_"&doCommID(i))) then
conn.execute("Update blog_book SET book_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',book_replyAuthor='"&memName&"' Where book_ID="&doCommID(i))
else
conn.execute("Update blog_book SET book_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',book_replyAuthor='"&memName&"',book_replyTime=#"&DateToStr(now(),"Y-m-d H:I:S")&"#,book_reply='"&checkStr(Request.form("reply_"&doCommID(i)))&"' Where book_ID="&doCommID(i))
end if
doTitle="留言"
doRedirect="msg"
elseif Request.form("whatdo")="comment" then
dim blogcommid
set blogcommid=Conn.ExeCute("select comm_Reply from blog_Comment where comm_ID="&doCommID(i))
if blogcommid("comm_Reply")=checkStr(Request.form("reply_"&doCommID(i))) then
conn.execute("Update blog_Comment SET comm_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"' Where comm_ID="&doCommID(i))
else
conn.execute("Update blog_Comment SET comm_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',comm_Reply='"&checkStr(Request.form("reply_"&doCommID(i)))&"',Comm_replytime=#"&DateToStr(now(),"Y-m-d H:I:S")&"# Where comm_ID="&doCommID(i))
end if
set blog_book_reply=Conn.Execute("select book_reply FROM blog_book Where book_ID="&doCommID(i))
if blog_book_reply("book_reply")=checkStr(Request.form("reply_"&doCommID(i))) then
conn.execute("Update blog_book SET book_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',book_replyAuthor='"&memName&"' Where book_ID="&doCommID(i))
else
conn.execute("Update blog_book SET book_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',book_replyAuthor='"&memName&"',book_replyTime=#"&DateToStr(now(),"Y-m-d H:I:S")&"#,book_reply='"&checkStr(Request.form("reply_"&doCommID(i)))&"' Where book_ID="&doCommID(i))
end if
doTitle="留言"
doRedirect="msg"
elseif Request.form("whatdo")="comment" then
dim blogcommid
set blogcommid=Conn.ExeCute("select comm_Reply from blog_Comment where comm_ID="&doCommID(i))
if blogcommid("comm_Reply")=checkStr(Request.form("reply_"&doCommID(i))) then
conn.execute("Update blog_Comment SET comm_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"' Where comm_ID="&doCommID(i))
else
conn.execute("Update blog_Comment SET comm_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"',comm_Reply='"&checkStr(Request.form("reply_"&doCommID(i)))&"',Comm_replytime=#"&DateToStr(now(),"Y-m-d H:I:S")&"# Where comm_ID="&doCommID(i))
end if
OK。全文完。
点击下载此文件[本日志由 小戒 于 2008-09-18 08:47 PM 编辑]
上一篇: 留言评论邮件通知博主For pjblog2.6|2.7
下一篇: Sql Server 和 Access 操作数据库结构Sql语句
文章来自: 本站原创
Tags: 评论 留言 PJBLOG
相关日志:
评论: 16 | 引用: 0 | 查看次数: -
请问我照上述步骤修改了之后是可以用了,也确实把第2步中的***去掉了,
但为何时间显示是为 y-d-m 呢?请问是否我有哪个步骤改错了?

小戒 于 回复
但为何时间显示是为 y-d-m 呢?请问是否我有哪个步骤改错了?

我一直打不开你的图,升级到157后已经集成了此功能,请问你的是什么版本呢?
引用来自 weixing都按照步骤做了啊,之前功能是完全正常的,最近才出现这个问题的。而且期间我也没有对Blog做任何改动,也没装任何插件。
老大,装了AJAX评论的应该如何修改? 
Microsoft VBScript 编译器错误 错误 '800a0409'
未结束的字符串常量
/class/cls_article.asp,行 56
TempStr=TempStr&"<a href=""article.asp?action=Reply&commID="&blog_CommID&"&ID="&LogID&"#comm_"&blog_CommID&"""><img src=""Plugins/guestbook/reply.gif"" alt=""回复"" border=""0"" style=""margin-bottom:-3px""/></a>
小戒 于 回复
未结束的字符串常量
/class/cls_article.asp,行 56
TempStr=TempStr&"<a href=""article.asp?action=Reply&commID="&blog_CommID&"&ID="&LogID&"#comm_"&blog_CommID&"""><img src=""Plugins/guestbook/reply.gif"" alt=""回复"" border=""0"" style=""margin-bottom:-3px""/></a>
可能是错误断行了,后面少了个双引号。
修改完成后一点击日志就出错,出错原因为DATETIME,请问......
都按照步骤做了啊,之前功能是完全正常的,最近才出现这个问题的。而且期间我也没有对Blog做任何改动,也没装任何插件。
就是我对别人的评论回复后,系统提示成功了
但是在我评论的地方没有发现我的回复啊~这是什么情况
小戒 于 回复
但是在我评论的地方没有发现我的回复啊~这是什么情况
第1.3步改了吗?
发表评论


回复




我用的版本是PJBlog2 v2.7 Build05