Feb
13
二、根目录中的blogcomm.asp文件
修改后的源码:
<!--#include file="commond.asp" -->
<!--#include file="header.asp" -->
<!--#include file="class/cls_logAction.asp" -->
<div id="Tbody">
<div style="text-align:center;"><br/>
<%
'=====================================
' 评论处理页面
' 更新时间: 2006-1-12
'=====================================
IF not ChkPost() Then
response.write ("非法操作!!")
elseif Request.Form("action")="post" Then
'评论发表代码
Dim PostBComm
PostBComm=postcomm
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=PostBComm(0)%></div>
<div id="MsgBody">
<div class="<%=PostBComm(2)%>"></div>
<div class="MessageText"><%=PostBComm(1)%></div>
</div>
</div>
</div>
<%
elseif Request.QueryString("action")="del" then
Dim DelBComm
DelBComm=delcomm
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=DelBComm(0)%></div>
<div id="MsgBody">
<div class="<%=DelBComm(2)%>"></div>
<div class="MessageText"><%=DelBComm(1)%></div>
</div>
</div>
</div>
<%
elseif Request("action")="Reply" then
PostBComm=replyMsg
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=PostBComm(0)%></div>
<div id="MsgBody">
<div class="<%=PostBComm(2)%>"></div>
<div class="MessageText"><%=PostBComm(1)%></div>
</div>
</div>
</div>
<%
else
response.write ("非法操作!!")
end if
'============================ 删除评论函数 =================================================
function delcomm
dim post_commID,blog_Comm,blog_CommAuthor,logid
dim ReInfo
ReInfo=Array("错误信息","","MessageIcon")
post_commID=clng(CheckStr(request.QueryString("commID")))
set blog_Comm=Conn.ExeCute("select top 1 comm_ID,blog_ID,comm_Author from blog_Comment where comm_ID="&post_commID)
if blog_Comm.eof or blog_Comm.bof then
ReInfo(0)="错误信息"
ReInfo(1)="<b>不存在此评论,或该评论已经被删除!</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
delcomm=ReInfo
exit function
end if
blog_CommAuthor=blog_Comm("comm_Author")
if stat_Admin=true or (stat_CommentDel=true and memName=blog_CommAuthor) then
ReInfo(0)="评论删除成功"
ReInfo(1)="<b>评论已经被删除成功!</b><br/><a href=""default.asp?id="&blog_Comm("blog_ID")&""">单击返回</a>"
ReInfo(2)="MessageIcon"
logid=Conn.ExeCute("select blog_ID from blog_Comment where comm_ID="&post_commID)(0)
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums-1 where log_ID="&blog_Comm("blog_ID"))
Conn.ExeCute("Delete * FROM blog_Comment Where comm_ID="&post_commID)
Conn.ExeCute("update blog_Info set blog_CommNums=blog_CommNums-1")
PostArticle logid
getInfo(2)
NewComment(2)
delcomm=ReInfo
Session(CookieName&"_LastDo")="DelComment"
else
ReInfo(0)="错误信息"
ReInfo(1)="<b>你没有权限删除评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
delcomm=ReInfo
end if
end function
'====================== 评论发表函数 ===========================================================
function postcomm
dim username,post_logID,post_From,post_FromURL,post_disImg,post_DisSM,post_DisURL,post_DisKEY,post_DisUBB,post_Message,validate
dim password
dim ReInfo,LastMSG,FlowControl
ReInfo=Array("错误信息","","MessageIcon")
username=trim(CheckStr(request.form("username")))
password=trim(CheckStr(request.form("password")))
post_logID=clng(CheckStr(request.form("logID")))
validate=trim(request.form("validate"))
post_Message=CheckStr(request.form("Message"))
FlowControl=false
IF (memName=empty or blog_validate=true) and cstr(lcase(Session("GetCode")))<>cstr(lcase(validate)) or IsEmpty(Session("GetCode")) then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>验证码有误,请返回重新输入</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
Session("GetCode") = empty
exit function
end if
set LastMSG=conn.execute("select top 1 comm_Content from blog_Comment order by comm_ID desc")
if LastMSG.eof then
FlowControl=false
else
if trim(LastMSG("comm_Content")) = trim(post_Message) then FlowControl=true
end if
if stat_Admin = false then
'高级过滤规则
if regFilterSpam(post_Message,"reg.xml") then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>评论中包含被屏蔽的字符</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
'基本过滤规则
if filterSpam(post_Message,"spam.xml") then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>评论中包含被屏蔽的字符</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
end if
if FlowControl then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>禁止恶意灌水!</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
if DateDiff("s",Request.Cookies(CookieName)("memLastPost"),Now())<blog_commTimerout then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>发言太快,请 "&blog_commTimerout&" 秒后再发表评论</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
if len(username)<1 then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>请输入你的昵称.</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
if IsValidUserName(username)=false then
ReInfo(0)="错误信息"
ReInfo(1)="<b>非法用户名!<br/>请尝试使用其他用户名!</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
dim checkMem
if memName=empty then
if len(password)>0 then
Dim loginUser
loginUser=login(Request.Form("username"),Request.Form("password"))
if not request.Cookies(CookieName)("memName")=username then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>登录失败,请检查用户名和密码</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
else
set checkMem=Conn.ExeCute("select top 1 mem_id from blog_Member where mem_Name='"&username&"'")
if not checkMem.eof then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>该用户已经存在,无法发表评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
end if
end if
if not stat_CommentAdd then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>你没有权限发表评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
if Conn.ExeCute("select log_DisComment from blog_Content where log_ID="&post_logID)(0) then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>该日志不允许发表任何评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
post_DisSM=request.form("log_DisSM")
post_DisURL=request.form("log_DisURL")
post_DisKEY=request.form("log_DisKey")
if len(post_Message)<1 then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>不允许发表空评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
if len(post_Message)>blog_commLength then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="评论超过最大字数限制<br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
'UBB 特别属性
post_disImg=1
post_DisUBB=0
if post_DisSM=1 then post_DisSM=1 else post_DisSM=0
if post_DisURL=1 then post_DisURL=0 else post_DisURL=1
if post_DisKEY=1 then post_DisKEY=0 else post_DisKEY=1
'插入数据
Dim AddComm
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))
DBQuest "blog_Comment",AddComm,"insert"
'Conn.ExeCute("Insert INTO blog_Comment(blog_ID,comm_Content,comm_Author,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY) VALUES ("&post_logID&",'"&post_Message&"','"&username&"',"&post_DisSM&","&post_DisUBB&","&post_disImg&","&post_DisURL&",'"&getIP()&"',"&post_DisKEY&")")
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums+1 where log_ID="&post_logID)
Conn.ExeCute("update blog_Info set blog_CommNums=blog_CommNums+1")
Response.Cookies(CookieName)("memLastpost")=Now()
getInfo(2)
NewComment(2)
if memName<>empty then
conn.execute("update blog_Member set mem_PostComms=mem_PostComms+1 where mem_Name='"&memName&"'")
end if
SQLQueryNums=SQLQueryNums+3
ReInfo(0)="评论发表成功"
ReInfo(1)="<b>你成功地对该日志发表了评论</b><br/><a href=""default.asp?id="&post_logID&""">单击返回该日志</a>"
ReInfo(2)="MessageIcon"
Session("GetCode") = empty
Session(CookieName&"_LastDo")="AddComment"
postcomm=ReInfo
PostArticle post_logID
end function
function replyMsg
dim post_Message,MsgID,ReInfo,post_logID
ReInfo=Array("错误信息","","MessageIcon")
MsgID = CheckStr(Request.form("commID"))
post_Message=CheckStr(request.form("Message"))
post_logID=CheckStr(request.form("logID"))
if not (memName<>empty and stat_Admin) then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="你没有权限回复留言<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If MsgID=Empty then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If IsInteger(MsgID)=0 then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
Conn.ExeCute("update blog_Comment set Comm_reply='"&post_Message&"',Comm_replytime='"&now&"' where comm_ID=" & MsgID)
ReInfo(0)="评论回复成功"
ReInfo(1)="<b>你成功地对该评论进行了回复</b><br/><a href=""article.asp?id="&post_logID&""">单击返回该日志</a>"
ReInfo(2)="MessageIcon"
replyMsg=ReInfo
end function
%>
<br/></div>
</div>
<!--#include file="footer.asp" -->
修改后的源码:
<!--#include file="commond.asp" -->
<!--#include file="header.asp" -->
<!--#include file="class/cls_logAction.asp" -->
<div id="Tbody">
<div style="text-align:center;"><br/>
<%
'=====================================
' 评论处理页面
' 更新时间: 2006-1-12
'=====================================
IF not ChkPost() Then
response.write ("非法操作!!")
elseif Request.Form("action")="post" Then
'评论发表代码
Dim PostBComm
PostBComm=postcomm
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=PostBComm(0)%></div>
<div id="MsgBody">
<div class="<%=PostBComm(2)%>"></div>
<div class="MessageText"><%=PostBComm(1)%></div>
</div>
</div>
</div>
<%
elseif Request.QueryString("action")="del" then
Dim DelBComm
DelBComm=delcomm
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=DelBComm(0)%></div>
<div id="MsgBody">
<div class="<%=DelBComm(2)%>"></div>
<div class="MessageText"><%=DelBComm(1)%></div>
</div>
</div>
</div>
<%
elseif Request("action")="Reply" then
PostBComm=replyMsg
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=PostBComm(0)%></div>
<div id="MsgBody">
<div class="<%=PostBComm(2)%>"></div>
<div class="MessageText"><%=PostBComm(1)%></div>
</div>
</div>
</div>
<%
else
response.write ("非法操作!!")
end if
'============================ 删除评论函数 =================================================
function delcomm
dim post_commID,blog_Comm,blog_CommAuthor,logid
dim ReInfo
ReInfo=Array("错误信息","","MessageIcon")
post_commID=clng(CheckStr(request.QueryString("commID")))
set blog_Comm=Conn.ExeCute("select top 1 comm_ID,blog_ID,comm_Author from blog_Comment where comm_ID="&post_commID)
if blog_Comm.eof or blog_Comm.bof then
ReInfo(0)="错误信息"
ReInfo(1)="<b>不存在此评论,或该评论已经被删除!</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
delcomm=ReInfo
exit function
end if
blog_CommAuthor=blog_Comm("comm_Author")
if stat_Admin=true or (stat_CommentDel=true and memName=blog_CommAuthor) then
ReInfo(0)="评论删除成功"
ReInfo(1)="<b>评论已经被删除成功!</b><br/><a href=""default.asp?id="&blog_Comm("blog_ID")&""">单击返回</a>"
ReInfo(2)="MessageIcon"
logid=Conn.ExeCute("select blog_ID from blog_Comment where comm_ID="&post_commID)(0)
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums-1 where log_ID="&blog_Comm("blog_ID"))
Conn.ExeCute("Delete * FROM blog_Comment Where comm_ID="&post_commID)
Conn.ExeCute("update blog_Info set blog_CommNums=blog_CommNums-1")
PostArticle logid
getInfo(2)
NewComment(2)
delcomm=ReInfo
Session(CookieName&"_LastDo")="DelComment"
else
ReInfo(0)="错误信息"
ReInfo(1)="<b>你没有权限删除评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
delcomm=ReInfo
end if
end function
'====================== 评论发表函数 ===========================================================
function postcomm
dim username,post_logID,post_From,post_FromURL,post_disImg,post_DisSM,post_DisURL,post_DisKEY,post_DisUBB,post_Message,validate
dim password
dim ReInfo,LastMSG,FlowControl
ReInfo=Array("错误信息","","MessageIcon")
username=trim(CheckStr(request.form("username")))
password=trim(CheckStr(request.form("password")))
post_logID=clng(CheckStr(request.form("logID")))
validate=trim(request.form("validate"))
post_Message=CheckStr(request.form("Message"))
FlowControl=false
IF (memName=empty or blog_validate=true) and cstr(lcase(Session("GetCode")))<>cstr(lcase(validate)) or IsEmpty(Session("GetCode")) then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>验证码有误,请返回重新输入</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
Session("GetCode") = empty
exit function
end if
set LastMSG=conn.execute("select top 1 comm_Content from blog_Comment order by comm_ID desc")
if LastMSG.eof then
FlowControl=false
else
if trim(LastMSG("comm_Content")) = trim(post_Message) then FlowControl=true
end if
if stat_Admin = false then
'高级过滤规则
if regFilterSpam(post_Message,"reg.xml") then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>评论中包含被屏蔽的字符</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
'基本过滤规则
if filterSpam(post_Message,"spam.xml") then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>评论中包含被屏蔽的字符</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
end if
if FlowControl then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>禁止恶意灌水!</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
if DateDiff("s",Request.Cookies(CookieName)("memLastPost"),Now())<blog_commTimerout then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>发言太快,请 "&blog_commTimerout&" 秒后再发表评论</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
if len(username)<1 then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>请输入你的昵称.</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
if IsValidUserName(username)=false then
ReInfo(0)="错误信息"
ReInfo(1)="<b>非法用户名!<br/>请尝试使用其他用户名!</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
dim checkMem
if memName=empty then
if len(password)>0 then
Dim loginUser
loginUser=login(Request.Form("username"),Request.Form("password"))
if not request.Cookies(CookieName)("memName")=username then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>登录失败,请检查用户名和密码</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
else
set checkMem=Conn.ExeCute("select top 1 mem_id from blog_Member where mem_Name='"&username&"'")
if not checkMem.eof then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>该用户已经存在,无法发表评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
end if
end if
if not stat_CommentAdd then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>你没有权限发表评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
if Conn.ExeCute("select log_DisComment from blog_Content where log_ID="&post_logID)(0) then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>该日志不允许发表任何评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
post_DisSM=request.form("log_DisSM")
post_DisURL=request.form("log_DisURL")
post_DisKEY=request.form("log_DisKey")
if len(post_Message)<1 then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>不允许发表空评论</b><br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
if len(post_Message)>blog_commLength then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="评论超过最大字数限制<br/><a href=""javascript:history.go(-1);"">单击返回</a>"
ReInfo(2)="ErrorIcon"
postcomm=ReInfo
exit function
end if
'UBB 特别属性
post_disImg=1
post_DisUBB=0
if post_DisSM=1 then post_DisSM=1 else post_DisSM=0
if post_DisURL=1 then post_DisURL=0 else post_DisURL=1
if post_DisKEY=1 then post_DisKEY=0 else post_DisKEY=1
'插入数据
Dim AddComm
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))
DBQuest "blog_Comment",AddComm,"insert"
'Conn.ExeCute("Insert INTO blog_Comment(blog_ID,comm_Content,comm_Author,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY) VALUES ("&post_logID&",'"&post_Message&"','"&username&"',"&post_DisSM&","&post_DisUBB&","&post_disImg&","&post_DisURL&",'"&getIP()&"',"&post_DisKEY&")")
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums+1 where log_ID="&post_logID)
Conn.ExeCute("update blog_Info set blog_CommNums=blog_CommNums+1")
Response.Cookies(CookieName)("memLastpost")=Now()
getInfo(2)
NewComment(2)
if memName<>empty then
conn.execute("update blog_Member set mem_PostComms=mem_PostComms+1 where mem_Name='"&memName&"'")
end if
SQLQueryNums=SQLQueryNums+3
ReInfo(0)="评论发表成功"
ReInfo(1)="<b>你成功地对该日志发表了评论</b><br/><a href=""default.asp?id="&post_logID&""">单击返回该日志</a>"
ReInfo(2)="MessageIcon"
Session("GetCode") = empty
Session(CookieName&"_LastDo")="AddComment"
postcomm=ReInfo
PostArticle post_logID
end function
function replyMsg
dim post_Message,MsgID,ReInfo,post_logID
ReInfo=Array("错误信息","","MessageIcon")
MsgID = CheckStr(Request.form("commID"))
post_Message=CheckStr(request.form("Message"))
post_logID=CheckStr(request.form("logID"))
if not (memName<>empty and stat_Admin) then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="你没有权限回复留言<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If MsgID=Empty then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If IsInteger(MsgID)=0 then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
Conn.ExeCute("update blog_Comment set Comm_reply='"&post_Message&"',Comm_replytime='"&now&"' where comm_ID=" & MsgID)
ReInfo(0)="评论回复成功"
ReInfo(1)="<b>你成功地对该评论进行了回复</b><br/><a href=""article.asp?id="&post_logID&""">单击返回该日志</a>"
ReInfo(2)="MessageIcon"
replyMsg=ReInfo
end function
%>
<br/></div>
</div>
<!--#include file="footer.asp" -->
Feb
13
所谓给PJ博客加评论回复功能的简单方法就是直接替换需要替换的文件即可,现在把所需修改的文件修改后的源码发布:
一、class目录里的cls_article.asp文件
修改后的源码:
<%
'==================================
' 日志类文件
' 更新时间: 2006-1-22
'==================================
'SQL="Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment,log_Content,log_PostTime,log_edittype,log_ubbFlags,log_CommNums,log_QuoteNums,log_weather,log_level,log_Modify,log_FromUrl,log_From,log_tag FROM blog_Content Where log_ID="&id&" and log_IsDraft=false"
'row序号: 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19
'*******************************************
' 显示日志内容
'*******************************************
sub updateViewNums(logID,vNums)
if not blog_postFile then exit sub
dim LoadArticle,splitStr,getA,i,tempStr
splitStr="<"&"%ST(A)%"&">"
tempStr=""
LoadArticle=LoadFromFile("cache/"&LogID&".asp")
if LoadArticle(0)=0 then
getA=split(LoadArticle(1),splitStr)
getA(2)=vNums
for i=1 to ubound(getA)
tempStr=tempStr&splitStr&getA(i)
next
call SaveToFile (tempStr,"cache/" & LogID & ".asp")
end if
end sub
sub ShowArticle(LogID)
If (log_ViewArr(5,0)=memName And log_ViewArr(3,0)=False) or stat_Admin or log_ViewArr(3,0)=true then
else
showmsg "错误信息","该日志为隐藏日志,没有权限查看该日志!<br/><a href=""default.asp"">单击返回</a>","ErrorIcon",""
End if
If (Not getCate.cate_Secret) or (log_ViewArr(5,0)=memName And getCate.cate_Secret) or stat_Admin or (getCate.cate_Secret and stat_ShowHiddenCate) Then
else
showmsg "错误信息","该日志分类为保密类型,无法查看该日志!<br/><a href=""default.asp"">单击返回</a>","ErrorIcon",""
end if
if log_ViewArr(6,0) then comDesc="Desc" else comDesc="Asc" end If
'从文件读取日志
if blog_postFile then
dim LoadArticle,TempStr,TempArticle
LoadArticle=LoadFromFile("post/"&LogID&".asp")
if LoadArticle(0)=0 then
TempArticle=LoadArticle(1)
TempStr=""
if stat_EditAll or (stat_Edit and memName=log_ViewArr(5,0)) then
TempStr=TempStr&"<a href=""blogedit.asp?id="&LogID&""" title=""编辑该日志"" accesskey=""E""><img src=""images/icon_edit.gif"" alt="""" border=""0"" style=""margin-bottom:-2px""/></a> "
end if
if stat_DelAll or (stat_Del and memName=log_ViewArr(5,0)) then
TempStr=TempStr&"<a href=""blogedit.asp?action=del&id="&LogID&""" onclick=""if (!window.confirm('是否要删除该日志')) return false"" title=""删除该日志"" accesskey=""K""><img src=""images/icon_del.gif"" alt="""" border=""0"" style=""margin-bottom:-2px""/></a>"
end if
TempArticle=Replace(TempArticle,"<"&"%ST(A)%"&">","")
TempArticle=Replace(TempArticle,"<$EditAndDel$>",TempStr)
TempArticle=Replace(TempArticle,"<$log_ViewNums$>",log_ViewArr(4,0))
response.write TempArticle
ShowComm LogID,comDesc,log_ViewArr(7,0)
call updateViewNums(id,log_ViewArr(4,0))
else
response.write "读取日志出错.<br/>" & LoadArticle(0) & " : " & LoadArticle(1)
end if
exit sub
end If
'从数据库读取日志
'on error resume Next
set preLog=Conn.Execute("Select TOP 1 log_Title,log_ID FROM blog_Content Where log_PostTime<#"&DateToStr(log_ViewArr(9,0),"Y-m-d H:I:S")&"# and log_IsShow=true and log_IsDraft=false orDER BY log_PostTime DESC")
set nextLog=Conn.Execute("Select TOP 1 log_Title,log_ID FROM blog_Content Where log_PostTime>#"&DateToStr(log_ViewArr(9,0),"Y-m-d H:I:S")&"# and log_IsShow=true and log_IsDraft=false orDER BY log_PostTime ASC")
SQLQueryNums=SQLQueryNums+2
%>
<div id="Content_ContentList" class="content-width"><a name="body" accesskey="B" href="#body"></a>
<div class="pageContent">
<div style="float:right;width:180px !important;width:auto">
<%
if not preLog.eof then
response.write ("<a href=""?id="&preLog("log_ID")&""" title=""上一篇日志: "&preLog("log_Title")&""" accesskey="",""><img border=""0"" src=""images/Cprevious.gif"" alt=""""/> 上一篇</a>")
else
response.write ("<img border=""0"" src=""images/Cprevious1.gif"" alt=""这是最新一篇日志""/>上一篇")
end if
if not nextLog.eof then
response.write (" | <a href=""?id="&nextLog("log_ID")&""" title=""下一篇日志: "&nextLog("log_Title")&""" accesskey="".""><img border=""0"" src=""images/Cnext.gif"" alt=""""/> 下一篇</a>")
else
response.write (" | <img border=""0"" src=""images/Cnext1.gif"" alt=""这是最后一篇日志""/>下一篇")
end if
preLog.close
nextLog.close
set preLog=nothing
set nextLog=nothing
%>
</div>
<img src="<%=getCate.cate_icon%>" style="margin:0px 2px -4px 0px" alt=""/> <strong><a href="default.asp?cateID=<%=log_ViewArr(1,0)%>" title="查看所有<%=getCate.cate_Name%>的日志"><%=getCate.cate_Name%></a></strong> <a href="feed.asp?cateID=<%=log_ViewArr(1,0)%>" target="_blank" title="订阅所有<%=getCate.cate_Name%>的日志" accesskey="O"><img border="0" src="images/rss.png" alt="订阅所有<%=getCate.cate_Name%>的日志" style="margin-bottom:-1px"/></a>
</div>
<div class="Content">
<div class="Content-top"><div class="ContentLeft"></div><div class="ContentRight"></div>
<h1 class="ContentTitle"><strong><%=HtmlEncode(log_ViewArr(2,0))%></strong></h1>
<h2 class="ContentAuthor">作者:<%=log_ViewArr(5,0)%> 日期:<%=DateToStr(log_ViewArr(9,0),"Y-m-d")%></h2>
</div>
<div class="Content-Info">
<div class="InfoOther">字体大小: <a href="javascript:SetFont('12px')" accesskey="1">小</a> <a href="javascript:SetFont('14px')" accesskey="2">中</a> <a href="javascript:SetFont('16px')" accesskey="3">大</a></div>
<div class="InfoAuthor"><img src="images/weather/hn2_<%=log_ViewArr(14,0)%>.gif" style="margin:0px 2px -6px 0px" alt=""/><img src="images/weather/hn2_t_<%=log_ViewArr(14,0)%>.gif" alt=""/> <img src="images/<%=log_ViewArr(15,0)%>.gif" style="margin:0px 2px -1px 0px" alt=""/>
<%if stat_EditAll or (stat_Edit and log_ViewArr(5,0)=memName) then %> <a href="blogedit.asp?id=<%=log_ViewArr(0,0)%>" title="编辑该日志" accesskey="E"><img src="images/icon_edit.gif" alt="" border="0" style="margin-bottom:-2px"/></a><%end if%>
<%if stat_DelAll or (stat_Del and log_ViewArr(5,0)=memName) then %> <a href="blogedit.asp?action=del&id=<%=log_ViewArr(0,0)%>" onclick="if (!window.confirm('是否要删除该日志')) return false" accesskey="K"><img src="images/icon_del.gif" alt="" border="0" style="margin-bottom:-2px"/></a><%end if%>
</div>
</div>
<div id="logPanel" class="Content-body">
<%
keyword=CheckStr(Request.QueryString("keyword"))
if log_ViewArr(10,0)=1 then
response.write (highlight(UnCheckStr(UBBCode(HtmlEncode(log_ViewArr(8,0)),mid(log_ViewArr(11,0),1,1),mid(log_ViewArr(11,0),2,1),mid(log_ViewArr(11,0),3,1),mid(log_ViewArr(11,0),4,1),mid(log_ViewArr(11,0),5,1))),keyword))
else
response.write (highlight(UnCheckStr(log_ViewArr(8,0)),keyword))
end if %>
<br/><br/>
</div>
<div class="Content-body">
<%if len(log_ViewArr(16,0))>0 then response.write (log_ViewArr(16,0)&"<br/>")%>
<img src="images/From.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>文章来自:</strong> <a href="<%=log_ViewArr(17,0)%>" target="_blank"><%=log_ViewArr(18,0)%></a><br/>
<img src="images/icon_trackback.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>引用通告:</strong> <a href="<%="trackback.asp?tbID="&id&"&action=view"%>" target="_blank">查看所有引用</a> | <a href="javascript:;" title="获得引用文章的链接" onclick="getTrackbackURL(<%=id%>)">我要引用此文章</a><br/>
<%dim getTag
set getTag=new tag
%>
<img src="images/tag.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>Tags:</strong> <%=getTag.filterHTML(log_ViewArr(19,0))%><br/>
</div>
<div class="Content-bottom"><div class="ContentBLeft"></div><div class="ContentBRight"></div>评论: <%=log_ViewArr(12,0)%> | 引用: <%=log_ViewArr(13,0)%> | 查看次数: <%=log_ViewArr(4,0)%>
</div></div>
</div>
<% set getTag=nothing
ShowComm LogID,comDesc,log_ViewArr(7,0) '显示评论内容
end sub
'*******************************************
' 显示日志评论内容
'*******************************************
Sub ShowComm(LogID,comDesc,DisComment)
dim action,commID,CommReplyContent
action = trim(Request.QueryString("action"))
response.write ("<a name=""comm_top"" href=""#comm_top"" accesskey=""C""></a>")
dim blog_Comment,Pcount,comm_Num,blog_CommID,blog_CommAuthor,blog_CommContent,Url_Add,commArr,commArrLen
Set blog_Comment=Server.CreateObject("Adodb.RecordSet")
Pcount=0
if action="Reply" then
commID=request("commID")
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where comm_ID="&commID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
else
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where blog_ID="&LogID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
end if
blog_Comment.Open SQL,Conn,1,1
SQLQueryNums=SQLQueryNums+1
IF blog_Comment.EOF AND blog_Comment.BOF Then
else
blog_Comment.PageSize=blogcommpage
blog_Comment.AbsolutePage=CurPage
comm_Num=blog_Comment.RecordCount
commArr=blog_Comment.GetRows(comm_Num)
blog_Comment.close
set blog_Comment = nothing
commArrLen=Ubound(commArr,2)
Url_Add="?id="&LogID&"&"%>
<div class="pageContent"><%=MultiPage(comm_Num,blogcommpage,CurPage,Url_Add,"#comm_top","float:right")%></div>
<%
Do Until Pcount = commArrLen + 1 or Pcount=blogcommpage
blog_CommID=commArr(0,Pcount)
blog_CommAuthor=commArr(2,Pcount)
blog_CommContent=commArr(1,Pcount)
dim CommReplyConten
CommReplyContent=commArr(10,Pcount)
%>
<div class="comment">
<%IF blog_CommID=0 Then%>
<div class="commenttop"><img src="images/icon_trackback.gif" alt="" style="margin:0px 4px -3px 0px"/><strong><%=("<a href="""&commArr(4,Pcount)&""">"&commArr(5,Pcount)&"</a>")%></strong> <span class="commentinfo">[<%=DateToStr(commArr(3,Pcount),"Y-m-d H:I A")%><%if stat_Admin=true then response.write (" | <a href=""trackback.asp?action=deltb&tbID="&commArr(6,Pcount)&"&logID="&LogID&""" onclick=""if (!window.confirm('是否删除该引用?')) {return false}""><img src=""images/del1.gif"" alt=""删除该引用"" border=""0""/></a>") end if%>]</span></div>
<div class="commentcontent">
<b>标题:</b> <%=blog_CommAuthor%><br/>
<b>链接:</b> <%=("<a href="""&commArr(4,Pcount)&""" target=""_blank"">"&commArr(4,Pcount)&"</a>")%><br/>
<b>摘要:</b> <%=checkURL(HTMLDecode(blog_CommContent))%><br/>
<br/>
</div>
<%else%>
<div class="commenttop"><a name="comm_<%=blog_CommID%>" href="javascript:addQuote('<%=blog_CommAuthor%>','commcontent_<%=blog_CommID%>')"><img border="0" src="images/<%if memName=blog_CommAuthor then response.write ("icon_quote_author.gif") else response.write ("icon_quote.gif") end if%>" alt="" style="margin:0px 4px -3px 0px"/></a><a href="member.asp?action=view&memName=<%=Server.URLEncode(blog_CommAuthor)%>"><strong><%=blog_CommAuthor%></strong></a> <span class="commentinfo">[<%=DateToStr(commArr(3,Pcount),"Y-m-d H:I A")%> <%if stat_Admin then response.write (" | "&commArr(8,Pcount)) end if%><%if stat_Admin=true or (stat_CommentDel=true and memName=blog_CommAuthor) then response.write (" | <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><a href=""blogcomm.asp?action=del&commID="&blog_CommID&""" onclick=""if (!window.confirm('是否删除该评论?')) {return false}""><img src=""images/del1.gif"" alt=""删除该评论"" border=""0""/></a>") end if%>]</span></div>
<div class="commentcontent" id="commcontent_<%=blog_CommID%>"><%=UBBCode(HtmlEncode(blog_CommContent),commArr(4,Pcount),blog_commUBB,blog_commIMG,commArr(7,Pcount),commArr(9,Pcount))%></div>
<%if len(commArr(10,Pcount))>0 then %>
<div class="commenttop"><img src="images/reply.gif" alt="" border="0" style="margin:0px 3px -3px 0px"/><b><%=blog_master%>回复</b> <span class="commentinfo">[<%=DateToStr(commArr(11,Pcount),"Y-m-d H:I A")%>]</span></div>
<div class="commentcontent"><%=UBBCode(HtmlEncode(commArr(10,Pcount)),0,0,0,1,1)%></div>
<%end if%>
<%end if%>
</div>
<%
Pcount=Pcount+1
loop
%>
<div class="pageContent"><%=MultiPage(comm_Num,blogcommpage,CurPage,Url_Add,"#comm_top","float:right")%></div>
<%
end if
if not DisComment then
%>
<div id="MsgContent" style="width:94%;">
<div id="MsgHead"><%
if action="Reply" then
response.write "回复评论"
else
response.write "发表评论"
end if
%></div>
<div id="MsgBody">
<%
if not stat_CommentAdd then
response.write ("你没有权限发表留言!")
response.write ("</div></div>")
exit sub
end if
%>
<script type="text/javascript">
function checkCommentPost(){
if (!CheckPost) return false
// 备用方法
return true
}
</script>
<form name="frm" action="blogcomm.asp" method="post" onsubmit="return checkCommentPost()" style="margin:0px;">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td align="right" width="70"><strong>昵 称:</strong></td><td align="left" style="padding:3px;"><input name="username" type="text" size="18" class="userpass" maxlength="24" <%if not memName=empty then response.write ("value="""&memName&""" readonly=""readonly""")%>/></td></tr>
<%if memName=empty then%><tr><td align="right" width="70"><strong>密 码:</strong></td><td align="left" style="padding:3px;"><input name="password" type="password" size="18" class="userpass" maxlength="24"/> 游客发言不需要密码.</td></tr><%end if%>
<%if memName=empty or blog_validate=true then%><tr><td align="right" width="70"><strong>验证码:</strong></td><td align="left" style="padding:3px;"><input name="validate" type="text" size="4" class="userpass" maxlength="4"/> <%=getcode()%></td></tr><%end if%>
<tr><td align="right" width="70" valign="top"><strong>内 容:</strong><br/>
</td><td style="padding:2px;"><%
UBB_TextArea_Height="150px;"
UBB_Tools_Items="bold,italic,underline"
UBB_Tools_Items=UBB_Tools_Items&"||image,link,mail,quote,smiley"
if action="Reply" then
UBB_Msg_Value=UBBFilter(UnCheckStr(CommReplyContent))
end if
UBBeditor("Message")
%></td></tr>
<tr><td align="right" width="70" valign="top"><strong>选 项:</strong></td><td align="left" style="padding:3px;">
<label for="label5"><input name="log_DisSM" type="checkbox" id="label5" value="1" />禁止表情转换</label>
<label for="label6"><input name="log_DisURL" type="checkbox" id="label6" value="1" />禁止自动转换链接</label>
<label for="label7"><input name="log_DisKey" type="checkbox" id="label7" value="1" />禁止自动转换关键字</label>
</td></tr>
<tr>
<td colspan="2" align="center" style="padding:3px;">
<input name="logID" type="hidden" value="<%=LogID%>"/>
<%
if action="Reply" then
%>
<input name="action" type="hidden" value="Reply"/>
<input name="commID" type="hidden" value="<%=blog_CommID%>"/>
<%
else
%>
<input name="action" type="hidden" value="post"/>
<%
end if
%>
<input name="submit2" type="submit" class="userbutton" value="发表评论" accesskey="S"/>
<input name="button" type="reset" class="userbutton" value="重写"/></td>
</tr>
<tr>
<td colspan="2" align="right" >
<%if memName=empty then%>虽然发表评论不用注册,但是为了保护您的发言权,建议您<a href="register.asp">注册帐号</a>. <br/><%end if%>
字数限制 <b><%=blog_commLength%> 字</b> |
UBB代码 <b><%if (blog_commUBB=0) then response.write ("开启") else response.write ("关闭") %></b> |
[img]标签 <b><%if (blog_commIMG=0) then response.write ("开启") else response.write ("关闭") %></b>
</td>
</tr>
</table></form>
<%
response.write ("</div></div>")
end if
end sub
%>
一次发布不完,请继续第二篇第三篇
一、class目录里的cls_article.asp文件
修改后的源码:
<%
'==================================
' 日志类文件
' 更新时间: 2006-1-22
'==================================
'SQL="Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment,log_Content,log_PostTime,log_edittype,log_ubbFlags,log_CommNums,log_QuoteNums,log_weather,log_level,log_Modify,log_FromUrl,log_From,log_tag FROM blog_Content Where log_ID="&id&" and log_IsDraft=false"
'row序号: 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19
'*******************************************
' 显示日志内容
'*******************************************
sub updateViewNums(logID,vNums)
if not blog_postFile then exit sub
dim LoadArticle,splitStr,getA,i,tempStr
splitStr="<"&"%ST(A)%"&">"
tempStr=""
LoadArticle=LoadFromFile("cache/"&LogID&".asp")
if LoadArticle(0)=0 then
getA=split(LoadArticle(1),splitStr)
getA(2)=vNums
for i=1 to ubound(getA)
tempStr=tempStr&splitStr&getA(i)
next
call SaveToFile (tempStr,"cache/" & LogID & ".asp")
end if
end sub
sub ShowArticle(LogID)
If (log_ViewArr(5,0)=memName And log_ViewArr(3,0)=False) or stat_Admin or log_ViewArr(3,0)=true then
else
showmsg "错误信息","该日志为隐藏日志,没有权限查看该日志!<br/><a href=""default.asp"">单击返回</a>","ErrorIcon",""
End if
If (Not getCate.cate_Secret) or (log_ViewArr(5,0)=memName And getCate.cate_Secret) or stat_Admin or (getCate.cate_Secret and stat_ShowHiddenCate) Then
else
showmsg "错误信息","该日志分类为保密类型,无法查看该日志!<br/><a href=""default.asp"">单击返回</a>","ErrorIcon",""
end if
if log_ViewArr(6,0) then comDesc="Desc" else comDesc="Asc" end If
'从文件读取日志
if blog_postFile then
dim LoadArticle,TempStr,TempArticle
LoadArticle=LoadFromFile("post/"&LogID&".asp")
if LoadArticle(0)=0 then
TempArticle=LoadArticle(1)
TempStr=""
if stat_EditAll or (stat_Edit and memName=log_ViewArr(5,0)) then
TempStr=TempStr&"<a href=""blogedit.asp?id="&LogID&""" title=""编辑该日志"" accesskey=""E""><img src=""images/icon_edit.gif"" alt="""" border=""0"" style=""margin-bottom:-2px""/></a> "
end if
if stat_DelAll or (stat_Del and memName=log_ViewArr(5,0)) then
TempStr=TempStr&"<a href=""blogedit.asp?action=del&id="&LogID&""" onclick=""if (!window.confirm('是否要删除该日志')) return false"" title=""删除该日志"" accesskey=""K""><img src=""images/icon_del.gif"" alt="""" border=""0"" style=""margin-bottom:-2px""/></a>"
end if
TempArticle=Replace(TempArticle,"<"&"%ST(A)%"&">","")
TempArticle=Replace(TempArticle,"<$EditAndDel$>",TempStr)
TempArticle=Replace(TempArticle,"<$log_ViewNums$>",log_ViewArr(4,0))
response.write TempArticle
ShowComm LogID,comDesc,log_ViewArr(7,0)
call updateViewNums(id,log_ViewArr(4,0))
else
response.write "读取日志出错.<br/>" & LoadArticle(0) & " : " & LoadArticle(1)
end if
exit sub
end If
'从数据库读取日志
'on error resume Next
set preLog=Conn.Execute("Select TOP 1 log_Title,log_ID FROM blog_Content Where log_PostTime<#"&DateToStr(log_ViewArr(9,0),"Y-m-d H:I:S")&"# and log_IsShow=true and log_IsDraft=false orDER BY log_PostTime DESC")
set nextLog=Conn.Execute("Select TOP 1 log_Title,log_ID FROM blog_Content Where log_PostTime>#"&DateToStr(log_ViewArr(9,0),"Y-m-d H:I:S")&"# and log_IsShow=true and log_IsDraft=false orDER BY log_PostTime ASC")
SQLQueryNums=SQLQueryNums+2
%>
<div id="Content_ContentList" class="content-width"><a name="body" accesskey="B" href="#body"></a>
<div class="pageContent">
<div style="float:right;width:180px !important;width:auto">
<%
if not preLog.eof then
response.write ("<a href=""?id="&preLog("log_ID")&""" title=""上一篇日志: "&preLog("log_Title")&""" accesskey="",""><img border=""0"" src=""images/Cprevious.gif"" alt=""""/> 上一篇</a>")
else
response.write ("<img border=""0"" src=""images/Cprevious1.gif"" alt=""这是最新一篇日志""/>上一篇")
end if
if not nextLog.eof then
response.write (" | <a href=""?id="&nextLog("log_ID")&""" title=""下一篇日志: "&nextLog("log_Title")&""" accesskey="".""><img border=""0"" src=""images/Cnext.gif"" alt=""""/> 下一篇</a>")
else
response.write (" | <img border=""0"" src=""images/Cnext1.gif"" alt=""这是最后一篇日志""/>下一篇")
end if
preLog.close
nextLog.close
set preLog=nothing
set nextLog=nothing
%>
</div>
<img src="<%=getCate.cate_icon%>" style="margin:0px 2px -4px 0px" alt=""/> <strong><a href="default.asp?cateID=<%=log_ViewArr(1,0)%>" title="查看所有<%=getCate.cate_Name%>的日志"><%=getCate.cate_Name%></a></strong> <a href="feed.asp?cateID=<%=log_ViewArr(1,0)%>" target="_blank" title="订阅所有<%=getCate.cate_Name%>的日志" accesskey="O"><img border="0" src="images/rss.png" alt="订阅所有<%=getCate.cate_Name%>的日志" style="margin-bottom:-1px"/></a>
</div>
<div class="Content">
<div class="Content-top"><div class="ContentLeft"></div><div class="ContentRight"></div>
<h1 class="ContentTitle"><strong><%=HtmlEncode(log_ViewArr(2,0))%></strong></h1>
<h2 class="ContentAuthor">作者:<%=log_ViewArr(5,0)%> 日期:<%=DateToStr(log_ViewArr(9,0),"Y-m-d")%></h2>
</div>
<div class="Content-Info">
<div class="InfoOther">字体大小: <a href="javascript:SetFont('12px')" accesskey="1">小</a> <a href="javascript:SetFont('14px')" accesskey="2">中</a> <a href="javascript:SetFont('16px')" accesskey="3">大</a></div>
<div class="InfoAuthor"><img src="images/weather/hn2_<%=log_ViewArr(14,0)%>.gif" style="margin:0px 2px -6px 0px" alt=""/><img src="images/weather/hn2_t_<%=log_ViewArr(14,0)%>.gif" alt=""/> <img src="images/<%=log_ViewArr(15,0)%>.gif" style="margin:0px 2px -1px 0px" alt=""/>
<%if stat_EditAll or (stat_Edit and log_ViewArr(5,0)=memName) then %> <a href="blogedit.asp?id=<%=log_ViewArr(0,0)%>" title="编辑该日志" accesskey="E"><img src="images/icon_edit.gif" alt="" border="0" style="margin-bottom:-2px"/></a><%end if%>
<%if stat_DelAll or (stat_Del and log_ViewArr(5,0)=memName) then %> <a href="blogedit.asp?action=del&id=<%=log_ViewArr(0,0)%>" onclick="if (!window.confirm('是否要删除该日志')) return false" accesskey="K"><img src="images/icon_del.gif" alt="" border="0" style="margin-bottom:-2px"/></a><%end if%>
</div>
</div>
<div id="logPanel" class="Content-body">
<%
keyword=CheckStr(Request.QueryString("keyword"))
if log_ViewArr(10,0)=1 then
response.write (highlight(UnCheckStr(UBBCode(HtmlEncode(log_ViewArr(8,0)),mid(log_ViewArr(11,0),1,1),mid(log_ViewArr(11,0),2,1),mid(log_ViewArr(11,0),3,1),mid(log_ViewArr(11,0),4,1),mid(log_ViewArr(11,0),5,1))),keyword))
else
response.write (highlight(UnCheckStr(log_ViewArr(8,0)),keyword))
end if %>
<br/><br/>
</div>
<div class="Content-body">
<%if len(log_ViewArr(16,0))>0 then response.write (log_ViewArr(16,0)&"<br/>")%>
<img src="images/From.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>文章来自:</strong> <a href="<%=log_ViewArr(17,0)%>" target="_blank"><%=log_ViewArr(18,0)%></a><br/>
<img src="images/icon_trackback.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>引用通告:</strong> <a href="<%="trackback.asp?tbID="&id&"&action=view"%>" target="_blank">查看所有引用</a> | <a href="javascript:;" title="获得引用文章的链接" onclick="getTrackbackURL(<%=id%>)">我要引用此文章</a><br/>
<%dim getTag
set getTag=new tag
%>
<img src="images/tag.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>Tags:</strong> <%=getTag.filterHTML(log_ViewArr(19,0))%><br/>
</div>
<div class="Content-bottom"><div class="ContentBLeft"></div><div class="ContentBRight"></div>评论: <%=log_ViewArr(12,0)%> | 引用: <%=log_ViewArr(13,0)%> | 查看次数: <%=log_ViewArr(4,0)%>
</div></div>
</div>
<% set getTag=nothing
ShowComm LogID,comDesc,log_ViewArr(7,0) '显示评论内容
end sub
'*******************************************
' 显示日志评论内容
'*******************************************
Sub ShowComm(LogID,comDesc,DisComment)
dim action,commID,CommReplyContent
action = trim(Request.QueryString("action"))
response.write ("<a name=""comm_top"" href=""#comm_top"" accesskey=""C""></a>")
dim blog_Comment,Pcount,comm_Num,blog_CommID,blog_CommAuthor,blog_CommContent,Url_Add,commArr,commArrLen
Set blog_Comment=Server.CreateObject("Adodb.RecordSet")
Pcount=0
if action="Reply" then
commID=request("commID")
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where comm_ID="&commID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
else
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where blog_ID="&LogID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
end if
blog_Comment.Open SQL,Conn,1,1
SQLQueryNums=SQLQueryNums+1
IF blog_Comment.EOF AND blog_Comment.BOF Then
else
blog_Comment.PageSize=blogcommpage
blog_Comment.AbsolutePage=CurPage
comm_Num=blog_Comment.RecordCount
commArr=blog_Comment.GetRows(comm_Num)
blog_Comment.close
set blog_Comment = nothing
commArrLen=Ubound(commArr,2)
Url_Add="?id="&LogID&"&"%>
<div class="pageContent"><%=MultiPage(comm_Num,blogcommpage,CurPage,Url_Add,"#comm_top","float:right")%></div>
<%
Do Until Pcount = commArrLen + 1 or Pcount=blogcommpage
blog_CommID=commArr(0,Pcount)
blog_CommAuthor=commArr(2,Pcount)
blog_CommContent=commArr(1,Pcount)
dim CommReplyConten
CommReplyContent=commArr(10,Pcount)
%>
<div class="comment">
<%IF blog_CommID=0 Then%>
<div class="commenttop"><img src="images/icon_trackback.gif" alt="" style="margin:0px 4px -3px 0px"/><strong><%=("<a href="""&commArr(4,Pcount)&""">"&commArr(5,Pcount)&"</a>")%></strong> <span class="commentinfo">[<%=DateToStr(commArr(3,Pcount),"Y-m-d H:I A")%><%if stat_Admin=true then response.write (" | <a href=""trackback.asp?action=deltb&tbID="&commArr(6,Pcount)&"&logID="&LogID&""" onclick=""if (!window.confirm('是否删除该引用?')) {return false}""><img src=""images/del1.gif"" alt=""删除该引用"" border=""0""/></a>") end if%>]</span></div>
<div class="commentcontent">
<b>标题:</b> <%=blog_CommAuthor%><br/>
<b>链接:</b> <%=("<a href="""&commArr(4,Pcount)&""" target=""_blank"">"&commArr(4,Pcount)&"</a>")%><br/>
<b>摘要:</b> <%=checkURL(HTMLDecode(blog_CommContent))%><br/>
<br/>
</div>
<%else%>
<div class="commenttop"><a name="comm_<%=blog_CommID%>" href="javascript:addQuote('<%=blog_CommAuthor%>','commcontent_<%=blog_CommID%>')"><img border="0" src="images/<%if memName=blog_CommAuthor then response.write ("icon_quote_author.gif") else response.write ("icon_quote.gif") end if%>" alt="" style="margin:0px 4px -3px 0px"/></a><a href="member.asp?action=view&memName=<%=Server.URLEncode(blog_CommAuthor)%>"><strong><%=blog_CommAuthor%></strong></a> <span class="commentinfo">[<%=DateToStr(commArr(3,Pcount),"Y-m-d H:I A")%> <%if stat_Admin then response.write (" | "&commArr(8,Pcount)) end if%><%if stat_Admin=true or (stat_CommentDel=true and memName=blog_CommAuthor) then response.write (" | <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><a href=""blogcomm.asp?action=del&commID="&blog_CommID&""" onclick=""if (!window.confirm('是否删除该评论?')) {return false}""><img src=""images/del1.gif"" alt=""删除该评论"" border=""0""/></a>") end if%>]</span></div>
<div class="commentcontent" id="commcontent_<%=blog_CommID%>"><%=UBBCode(HtmlEncode(blog_CommContent),commArr(4,Pcount),blog_commUBB,blog_commIMG,commArr(7,Pcount),commArr(9,Pcount))%></div>
<%if len(commArr(10,Pcount))>0 then %>
<div class="commenttop"><img src="images/reply.gif" alt="" border="0" style="margin:0px 3px -3px 0px"/><b><%=blog_master%>回复</b> <span class="commentinfo">[<%=DateToStr(commArr(11,Pcount),"Y-m-d H:I A")%>]</span></div>
<div class="commentcontent"><%=UBBCode(HtmlEncode(commArr(10,Pcount)),0,0,0,1,1)%></div>
<%end if%>
<%end if%>
</div>
<%
Pcount=Pcount+1
loop
%>
<div class="pageContent"><%=MultiPage(comm_Num,blogcommpage,CurPage,Url_Add,"#comm_top","float:right")%></div>
<%
end if
if not DisComment then
%>
<div id="MsgContent" style="width:94%;">
<div id="MsgHead"><%
if action="Reply" then
response.write "回复评论"
else
response.write "发表评论"
end if
%></div>
<div id="MsgBody">
<%
if not stat_CommentAdd then
response.write ("你没有权限发表留言!")
response.write ("</div></div>")
exit sub
end if
%>
<script type="text/javascript">
function checkCommentPost(){
if (!CheckPost) return false
// 备用方法
return true
}
</script>
<form name="frm" action="blogcomm.asp" method="post" onsubmit="return checkCommentPost()" style="margin:0px;">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td align="right" width="70"><strong>昵 称:</strong></td><td align="left" style="padding:3px;"><input name="username" type="text" size="18" class="userpass" maxlength="24" <%if not memName=empty then response.write ("value="""&memName&""" readonly=""readonly""")%>/></td></tr>
<%if memName=empty then%><tr><td align="right" width="70"><strong>密 码:</strong></td><td align="left" style="padding:3px;"><input name="password" type="password" size="18" class="userpass" maxlength="24"/> 游客发言不需要密码.</td></tr><%end if%>
<%if memName=empty or blog_validate=true then%><tr><td align="right" width="70"><strong>验证码:</strong></td><td align="left" style="padding:3px;"><input name="validate" type="text" size="4" class="userpass" maxlength="4"/> <%=getcode()%></td></tr><%end if%>
<tr><td align="right" width="70" valign="top"><strong>内 容:</strong><br/>
</td><td style="padding:2px;"><%
UBB_TextArea_Height="150px;"
UBB_Tools_Items="bold,italic,underline"
UBB_Tools_Items=UBB_Tools_Items&"||image,link,mail,quote,smiley"
if action="Reply" then
UBB_Msg_Value=UBBFilter(UnCheckStr(CommReplyContent))
end if
UBBeditor("Message")
%></td></tr>
<tr><td align="right" width="70" valign="top"><strong>选 项:</strong></td><td align="left" style="padding:3px;">
<label for="label5"><input name="log_DisSM" type="checkbox" id="label5" value="1" />禁止表情转换</label>
<label for="label6"><input name="log_DisURL" type="checkbox" id="label6" value="1" />禁止自动转换链接</label>
<label for="label7"><input name="log_DisKey" type="checkbox" id="label7" value="1" />禁止自动转换关键字</label>
</td></tr>
<tr>
<td colspan="2" align="center" style="padding:3px;">
<input name="logID" type="hidden" value="<%=LogID%>"/>
<%
if action="Reply" then
%>
<input name="action" type="hidden" value="Reply"/>
<input name="commID" type="hidden" value="<%=blog_CommID%>"/>
<%
else
%>
<input name="action" type="hidden" value="post"/>
<%
end if
%>
<input name="submit2" type="submit" class="userbutton" value="发表评论" accesskey="S"/>
<input name="button" type="reset" class="userbutton" value="重写"/></td>
</tr>
<tr>
<td colspan="2" align="right" >
<%if memName=empty then%>虽然发表评论不用注册,但是为了保护您的发言权,建议您<a href="register.asp">注册帐号</a>. <br/><%end if%>
字数限制 <b><%=blog_commLength%> 字</b> |
UBB代码 <b><%if (blog_commUBB=0) then response.write ("开启") else response.write ("关闭") %></b> |
[img]标签 <b><%if (blog_commIMG=0) then response.write ("开启") else response.write ("关闭") %></b>
</td>
</tr>
</table></form>
<%
response.write ("</div></div>")
end if
end sub
%>
一次发布不完,请继续第二篇第三篇
Feb
13
一.打开class\cls_article.asp
1.找到
在下面插入:
2.搜索
替换为
3.找到
在它之前插入
4.找到
将 发表评论 替换为
5.找到
替换为
6.找到
在下面插入
7.找到
在下面插入(注意:如果出错了请将里面的10修改为12)
8.找到
在下面插入
二.打开blogcomm.asp
1.在最下面的一个
之前插入如下代码
2.找到
在上面插入如下代码
三.打开ConContent.asp
1.找到
替换为
2.找到第二处的(有两处)
在下面插入
3.找到
修改为:
四.下载附件,上传Update.ASP到博客目录执行升级数据库.然后到后台重建数据缓存.你就可以实现这个效果了!
文件内容如下:
1.找到
引用
Sub ShowComm(LogID,comDesc,DisComment)
在下面插入:
引用
dim action,commID,CommReplyContent
2.搜索
引用
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY FROM blog_Comment Where blog_ID="&LogID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
替换为
引用
if action="Reply" then
commID=request("commID")
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where comm_ID="&commID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
else
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where blog_ID="&LogID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
end if
commID=request("commID")
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where comm_ID="&commID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
else
SQL="Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_DisSM,comm_DisUBB,comm_DisIMG,comm_AutoURL,comm_PostIP,comm_AutoKEY,comm_Reply,comm_Replytime FROM blog_Comment Where blog_ID="&LogID&" UNION ALL Select 0,tb_Intro,tb_Title,tb_PostTime,tb_URL,tb_Site,tb_ID,0,'127.0.0.1',0,0,0 FROM blog_Trackback Where blog_ID="&LogID&" orDER BY comm_PostTime "&comDesc
end if
3.找到
引用
<a href=""blogcomm.asp?action=del&commID="&blog_CommID&""" onclick=""if (!window.confirm('是否删除该评论?')) {return false}"">
在它之前插入
引用
<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>
4.找到
引用
<div id="MsgHead">发表评论</div>
将 发表评论 替换为
引用
<%
if action="Reply" then
response.write "回复评论"
else
response.write "发表评论"
end if
%>
if action="Reply" then
response.write "回复评论"
else
response.write "发表评论"
end if
%>
5.找到
引用
<input name="action" type="hidden" value="post"/>
替换为
引用
<%
if action="Reply" then
%>
<input name="action" type="hidden" value="Reply"/>
<input name="commID" type="hidden" value="<%=blog_CommID%>"/>
<%
else
%>
<input name="action" type="hidden" value="post"/>
<%
end if
%>
if action="Reply" then
%>
<input name="action" type="hidden" value="Reply"/>
<input name="commID" type="hidden" value="<%=blog_CommID%>"/>
<%
else
%>
<input name="action" type="hidden" value="post"/>
<%
end if
%>
6.找到
引用
<div class="commentcontent" id="commcontent_<%=blog_CommID%>"><%=UBBCode(HtmlEncode(blog_CommContent),commArr(4,Pcount),blog_commUBB,blog_commIMG,commArr(7,Pcount),commArr(9,Pcount))%></div>
在下面插入
引用
<%if len(commArr(10,Pcount))>0 then %>
<div class="commenttop"><img src="images/reply.gif" alt="" border="0" style="margin:0px 3px -3px 0px"/><b><%=blog_master%>回复</b> <span class="commentinfo">[<%=DateToStr(commArr(11,Pcount),"Y-m-d H:I A")%>]</span></div>
<div class="commentcontent"><%=UBBCode(HtmlEncode(commArr(10,Pcount)),0,0,0,1,1)%></div>
<%end if%>
<div class="commenttop"><img src="images/reply.gif" alt="" border="0" style="margin:0px 3px -3px 0px"/><b><%=blog_master%>回复</b> <span class="commentinfo">[<%=DateToStr(commArr(11,Pcount),"Y-m-d H:I A")%>]</span></div>
<div class="commentcontent"><%=UBBCode(HtmlEncode(commArr(10,Pcount)),0,0,0,1,1)%></div>
<%end if%>
7.找到
引用
blog_CommContent=commArr(1,Pcount)
在下面插入(注意:如果出错了请将里面的10修改为12)
引用
dim CommReplyConten
CommReplyContent=commArr(10,Pcount)
CommReplyContent=commArr(10,Pcount)
8.找到
引用
UBB_Tools_Items=UBB_Tools_Items&"||image,link,mail,quote,smiley"
在下面插入
引用
if action="Reply" then
UBB_Msg_Value=UBBFilter(UnCheckStr(CommReplyContent))
end if
UBB_Msg_Value=UBBFilter(UnCheckStr(CommReplyContent))
end if
二.打开blogcomm.asp
1.在最下面的一个
引用
%>
之前插入如下代码
引用
function replyMsg
dim post_Message,MsgID,ReInfo,post_logID
ReInfo=Array("错误信息","","MessageIcon")
MsgID = CheckStr(Request.form("commID"))
post_Message=CheckStr(request.form("Message"))
post_logID=CheckStr(request.form("logID"))
if not (memName<>empty and stat_Admin) then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="你没有权限回复留言<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If MsgID=Empty then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If IsInteger(MsgID)=0 then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
Conn.ExeCute("update blog_Comment set Comm_reply='"&post_Message&"',Comm_replytime='"&now&"' where comm_ID=" & MsgID)
ReInfo(0)="评论回复成功"
ReInfo(1)="<b>你成功地对该评论进行了回复</b><br/><a href=""article.asp?id="&post_logID&""">单击返回该日志</a>"
ReInfo(2)="MessageIcon"
replyMsg=ReInfo
end function
dim post_Message,MsgID,ReInfo,post_logID
ReInfo=Array("错误信息","","MessageIcon")
MsgID = CheckStr(Request.form("commID"))
post_Message=CheckStr(request.form("Message"))
post_logID=CheckStr(request.form("logID"))
if not (memName<>empty and stat_Admin) then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="你没有权限回复留言<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If MsgID=Empty then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
If IsInteger(MsgID)=0 then
ReInfo(0)="评论回复错误信息"
ReInfo(1)="非法操作<a href=""javascript:history.go(-1)"">单击返回</a>"
ReInfo(2)="ErrorIcon"
end if
Conn.ExeCute("update blog_Comment set Comm_reply='"&post_Message&"',Comm_replytime='"&now&"' where comm_ID=" & MsgID)
ReInfo(0)="评论回复成功"
ReInfo(1)="<b>你成功地对该评论进行了回复</b><br/><a href=""article.asp?id="&post_logID&""">单击返回该日志</a>"
ReInfo(2)="MessageIcon"
replyMsg=ReInfo
end function
2.找到
引用
<%
else
response.write ("非法操作!!")
else
response.write ("非法操作!!")
在上面插入如下代码
引用
<%
elseif Request("action")="Reply" then
PostBComm=replyMsg
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=PostBComm(0)%></div>
<div id="MsgBody">
<div class="<%=PostBComm(2)%>"></div>
<div class="MessageText"><%=PostBComm(1)%></div>
</div>
</div>
</div>
elseif Request("action")="Reply" then
PostBComm=replyMsg
%>
<div style="text-align:center;">
<div id="MsgContent" style="width:300px">
<div id="MsgHead"><%=PostBComm(0)%></div>
<div id="MsgBody">
<div class="<%=PostBComm(2)%>"></div>
<div class="MessageText"><%=PostBComm(1)%></div>
</div>
</div>
</div>
三.打开ConContent.asp
1.找到
引用
conn.execute("Update blog_Comment SET comm_Content='"&checkStr(Request.form("message_"&doCommID(i)))&"' Where comm_ID="&doCommID(i))
替换为
引用
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))
2.找到第二处的(有两处)
引用
<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>
3.找到
引用
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"
四.下载附件,上传Update.ASP到博客目录执行升级数据库.然后到后台重建数据缓存.你就可以实现这个效果了!
文件内容如下:
引用
<!--#include file="const.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="common/function.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body{
font-size:12px;
font-family:verdana;
}
</style>
<h3>PJBlog 公告等升级程序</h3><br/>
<b>开始执行升级 SQL 语句</b><br/>
- 说明: <span style="color:#004000"><b>绿色文字</b></span> 代表已经升级过的字段,<span style="color:#0000a0"><b>蓝色字代</b></span> 表正在执行的语句
<br/>
<br/>
<div style="border:1px solid #4b372e;background:#fefded;padding:6px;line-height:160%;">
<%
SQL="Alter TABLE `blog_Comment` ADD `Comm_reply` memo"
UpdateSQL SQL
SQL="Alter TABLE `blog_Comment` ADD `Comm_replytime` date"
UpdateSQL SQL
Conn.ExeCute("update blog_Comment set Comm_replytime='"&now&"'")
%>
</div>
<%
Conn.Close
Set Conn=Nothing
function UpdateSQL(SQLString)
On Error Resume Next
Conn.execute SQLString
if err then
response.write "<span style=""color:#004000""><b></b> "&err.description&"</span><br/>"
else
response.write "<span style=""color:#0000a0""><b>执行:</b> "&SQLString&"</span><br/>"
end if
end function
%>
<div style="border:1px solid #4b372e;background:#fefded;padding:6px;line-height:160%;margin-top:2px">
升级完成为了保证你的系统安全,请删除升级文件。<br/>升级后到后台 <b>"站点基本设置-初试化数据"</b> 执行 <b>"重建数据缓存"</b>
</div>
<!--#include file="conn.asp" -->
<!--#include file="common/function.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body{
font-size:12px;
font-family:verdana;
}
</style>
<h3>PJBlog 公告等升级程序</h3><br/>
<b>开始执行升级 SQL 语句</b><br/>
- 说明: <span style="color:#004000"><b>绿色文字</b></span> 代表已经升级过的字段,<span style="color:#0000a0"><b>蓝色字代</b></span> 表正在执行的语句
<br/>
<br/>
<div style="border:1px solid #4b372e;background:#fefded;padding:6px;line-height:160%;">
<%
SQL="Alter TABLE `blog_Comment` ADD `Comm_reply` memo"
UpdateSQL SQL
SQL="Alter TABLE `blog_Comment` ADD `Comm_replytime` date"
UpdateSQL SQL
Conn.ExeCute("update blog_Comment set Comm_replytime='"&now&"'")
%>
</div>
<%
Conn.Close
Set Conn=Nothing
function UpdateSQL(SQLString)
On Error Resume Next
Conn.execute SQLString
if err then
response.write "<span style=""color:#004000""><b></b> "&err.description&"</span><br/>"
else
response.write "<span style=""color:#0000a0""><b>执行:</b> "&SQLString&"</span><br/>"
end if
end function
%>
<div style="border:1px solid #4b372e;background:#fefded;padding:6px;line-height:160%;margin-top:2px">
升级完成为了保证你的系统安全,请删除升级文件。<br/>升级后到后台 <b>"站点基本设置-初试化数据"</b> 执行 <b>"重建数据缓存"</b>
</div>
Feb
8
因为现在好多网站都有Realplayer10.5版本的漏洞后门非常讨厌,昨天晚上就把Realplayer10.5升级为Realplayer11版本(Realplayer官方称以前版本的漏洞已解决),可是又出现新的问题,本人一直使用超级兔子快乐影音播放影音文件,可今天播放.rmvb文件却只有画面没有声音,刚开始我以为声卡的驱动丢失了呢?但在设备管理器里没有看见声卡前面有黄色的图标,然后我就用Realplayer11播放.rmvb文件,结果一切正常,用Windows Media Player播放也是一样,『说明一下:不是其他的播放器播放任何文件都没有声音,仅播放.rmvb时没有声音,』
开始在网上寻找解决办法,在超级兔子官方网站没有找到解决的办法,发现网上不只我自己遇到这样的问题,暴风影音、Kamplayer等其他的播放软件也出现和超级兔子快乐影音一样的问题,最终还是功夫不负有心人,让我找到了一个解决方案,如果你也出现了播放.rmvb文件没有声音的情况你可以试一下看,替换 cook.dll文件,下载 RealPlayer 10.5 的 cook.dll 文件, 点击这里下载 cook.dll 文件【右键目标另存为】,把下载回来的 cook.dll 替换掉“X:\Program Files\Common Files\Real\Codecs ” 下的 cook.dll 即可解决。“X”指你的系统盘,如果你使用的是Kamplayer,你可以设置Kamplayer 参数,在 kmp 选项——参数设置——滤镜控制里——directshow项中,将 MMST:// 后的 .RM .RMVB 都去掉。(没有测试,本人用的是超级兔子快乐影音3.65,替换dll文件的方法解决的)
※转载请注明出处※
开始在网上寻找解决办法,在超级兔子官方网站没有找到解决的办法,发现网上不只我自己遇到这样的问题,暴风影音、Kamplayer等其他的播放软件也出现和超级兔子快乐影音一样的问题,最终还是功夫不负有心人,让我找到了一个解决方案,如果你也出现了播放.rmvb文件没有声音的情况你可以试一下看,替换 cook.dll文件,下载 RealPlayer 10.5 的 cook.dll 文件, 点击这里下载 cook.dll 文件【右键目标另存为】,把下载回来的 cook.dll 替换掉“X:\Program Files\Common Files\Real\Codecs ” 下的 cook.dll 即可解决。“X”指你的系统盘,如果你使用的是Kamplayer,你可以设置Kamplayer 参数,在 kmp 选项——参数设置——滤镜控制里——directshow项中,将 MMST:// 后的 .RM .RMVB 都去掉。(没有测试,本人用的是超级兔子快乐影音3.65,替换dll文件的方法解决的)
※转载请注明出处※







Flash Player文件


