📄 comment.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<%
dim rs,sql,rsc,groups,ID,sender,isuser
dim table,title,comment,commentDetail
ID=request("ID")
groups=request("groups")
if groups=6 then
table="news"
elseif groups=7 then
table="article"
end if
select case request("action")
case "saveAdd"
if cint(anysale.asGroups(59))=0 then
anysale.errWin("<li>你所在的用户组没有发表评论的权限。</li>")
response.end
end if
if cint(anysale.asGroups(60))>0 and cint(anysale.userInfo(12))>=cint(anysale.asGroups(60)) then
anysale.errWin("<li>你所在的用户组已超过发布评论"&cint(anysale.asGroups(60))&"条的总数。</li>")
response.end
end if
if request("detail")="" then
anysale.errWin("<li>请填写评论内容。</li>")
response.end
end if
if anysale.username="" or request("noname")<>"" then
sender="匿名"
isuser=0
else
sender=anysale.username
isuser=1
end if
sql="insert into as_comment (ID,groups,username,userIP,detail,isuser) values ("&ID&","&groups&",'"&sender&"','"&anysale.userTrueIP&"','"&anysale.checkStr(trim(request.form ("detail")))&"',"&isuser&")"
conn.execute(sql)
call anysale.setValue("as_config","siteInfo","",14,clng(anysale.siteInfo(14))+1)
if anysale.userID<>"" then
call anysale.setValue("as_user","userInfo","userID="&anysale.userID,12,clng(anysale.userInfo(12))+1)
call anysale.setMoney(cint(anysale.asMoney(8)),"userID="&anysale.userID)
end if
conn.execute("update as_"&table&" set comment=comment+1 where "&table&"ID="&ID)
'上传采用信息分组及信息ID
conn.execute("update as_upfile set ID="&clng(ID)&" where username='"&anysale.username&"' and [group]="&clng(groups)&" and ID=0")
sucNote="<li>发表成功!</li>|||<button onclick=""location.href='comment.asp?groups="&groups&"&ID="&ID&"';winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">查看评论</button>"
sucNote=sucNote+" <button onclick=""location.href='"&table&"detail.asp?ID="&ID&"';winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">返 回</button>"
anysale.sucWin(sucNote)
case else
set rsc=conn.execute("select * from as_"&table&" where "&table&"ID="&ID)
if not(rsc.bof and rsc.eof) then
title=rsc("title")
comment=rsc("comment")
end if
rsc.close:set rsc=nothing
if request("quote")<>"" then
set rs=conn.execute("select username,addtime,detail from as_comment where islock=0 and commentID="&request("quote"))
if not (rs.bof or rs.eof) then
commentDetail="<div class=""quote""><strong>以下是引用<em>"&rs(0)&"</em>在"&rs(1)&"的发言:</strong><br />"&rs(2)&"</div><br />"
end if
rs.close:set rs=nothing
end if
call main()
end select
sub main()
call anysale.minHead(title&" - 评论","","")
%>
<div class="line5"></div>
<div class="bodyer">
<!--2-->
<div> </div>
<div><h3 class="right"><a href="<%=table%>detail.asp?ID=<%=ID%>">查看原文</a></h3><h1>话题:<%=title%></h1></div>
<div> </div>
<div class="tab" style="width:948px;">
<div class="tabList">
<div><ul class="tabH"><li class="tabL"> </li><li class="tabM">本话题共有评论<%=comment%>条</li><li class="tabR"> </li></ul></div>
</div>
<div style="padding:20px;">
<%
dim page,ipage,npage,search
page = clng(request("page"))
if page="" or page<1 then page=1 end if
search="&groups="&groups&"&ID="&ID
set rs= Server.CreateObject("ADODB.Recordset")
sql="select commentID,detail,userIP,username,addtime,detail,isuser,islock,isbest,agree,against from as_comment where groups="&groups&" and ID="&ID&" order by isbest desc,vote desc,commentID desc"
rs.open sql,conn,1
if not rs.eof then
rs.pageSize = 50
if page>rs.pageCount then page=rs.pageCount end if
rs.absolutePage = page
npage=rs.pageCount
for ipage = 1 to rs.pageSize
%>
<ul class="borderB <%if ipage mod 2=0 then response.write" bg" end if%>" style="padding:0 10px;">
<li class="line5"><a name="<%=rs("commentID")%>"></a> </li>
<li><span class="right f12">时间:<%=rs("addtime")%> IP:<%=rs("userIP")%></span> <strong><%if rs("isuser")=1 then%><a href="companydetail.asp?u=<%=rs("username")%>"><%=rs("username")%></a><%else%><%=rs("username")%><%end if%></strong></li>
<li> </li>
<li id="detail<%=rs("commentID")%>" class="detail" style="width:888px;overflow:hidden;word-wrap:break-word;word-break:normal;"><p><%if rs("islock")=0 then%><%=rs("detail")%><%else response.write"本评论内容被屏蔽!" end if%></p></li>
<li> </li>
<li class="f12">
<span class="right">
<a href="?action=quote&page=<%=page%>&groups=<%=groups%>&ID=<%=ID%>&quote=<%=rs("commentID")%>#sendComment">引用</a> |
<%if anysale.isAdmin and rs("isuser")=1 then%>
<%if rs("isbest")=0 then%>
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=commentBest&username=<%=rs("username")%>&ID=<%=rs("commentID")%>&value=1','best<%=rs("commentID")%>')">精华</a> |
<%else%>
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=commentBest&username=<%=rs("username")%>&ID=<%=rs("commentID")%>&value=0','best<%=rs("commentID")%>')">取消精华</a> |
<%end if%>
<%if rs("islock")=0 then%>
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=commentLock&ID=<%=rs("commentID")%>&value=1','detail<%=rs("commentID")%>')">屏蔽</a> |
<%else%>
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=commentLock&ID=<%=rs("commentID")%>&value=0','detail<%=rs("commentID")%>')">取消屏蔽</a> |
<%end if%>
<%end if%>
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=message&username=admin&title=<%=server.urlEncode("举报评论")%>&detail=<%=server.urlEncode(anysale.asInfo(1)&"comment.asp?groups="&groups&"&ID="&ID&"&page="&page&"#"&rs("commentID"))%>');">举报</a>
</span>
<span class="red" id="best<%=rs("commentID")%>"><%if rs("isbest")=1 then%>本评论被加为精华<%end if%></span>
<span id="vote<%=rs("commentID")%>">
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=commentVote&ID=<%=rs("commentID")%>&value=1','vote<%=rs("commentID")%>')">支持[<span class="red"><%=rs("agree")%></span>]</a> |
<a href="javascript:anysale();" onclick="getPage('windows.asp?action=commentVote&ID=<%=rs("commentID")%>&value=0','vote<%=rs("commentID")%>')">反对[<span class="red"><%=rs("against")%></span>]</a>
</span>
</li>
<li class="line5"> </li>
</ul>
<%
rs.moveNext
if rs.eof then exit for end if
next
else
response.write "<ul class=""line10""><li></li></ul><ul><li>暂无相关评论!</li></ul>"
end if
rs.close
set rs=nothing
%>
</div>
<div class="line30">
<ul><li class="txtCen f14"> <%=anysale.pagelink(page,npage,"comment.asp?",search)%></li></ul>
</div>
</div>
<div class="line5"> </div>
<div class="tab" style="width:948px;">
<div class="tabList">
<a name="sendComment"></a>
<div><ul class="tabH"><li class="tabL"> </li><li class="tabM">发表评论</li><li class="tabR"> </li></ul></div>
</div>
<form name="commentForm" id="commentForm" method="post">
<div class="list line30" id="saveComment">
<ul><li> </li></ul>
<ul>
<li class="name txtRig"><span class="red">*</span> 评论内容:</li>
<li>
<textarea name="detail" id="commentDetails" style="display:none"><%=commentDetail%></textarea>
<iframe name="editor" src="editor/anysale.htm?groups=@@@<%=groups%>@@@1@@@0@@@id=commentDetails" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:318px;width:602px;"></iframe>
</li>
</ul>
<ul>
<li class="name"> </li>
<li>
<input type="button" name="button" value="发表评论"
onclick="getPage('comment.asp?action=saveAdd','saveComment',1,'commentForm');"
class="button" onmouseover="this.className='buttonH'" onmouseout="this.className='button'" />
<input type="hidden" name="ID" value="<%=ID%>" />
<input type="hidden" name="groups" value="<%=groups%>" />
<input type="checkbox" name="noname" vlaue="1" /> 匿名
</li>
</ul>
<ul>
<li class="name"> </li>
<li><%if anysale.userID="" then response.write"您可匿名发表评论,或登录后再发表评论。" end if%></li>
</ul>
</div>
</form>
</div>
<div> </div><div> </div>
<!--2.end-->
</div>
<%
anysale.minFoot
end sub
call closeConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -