<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../core/Conn.asp"-->
<!--#include file="../core/fun/fun.asp"-->
<!--#include file="../core/class/tr_page.asp"-->
<!--#include file="charsetasp.asp"-->
<%
If application(siternd & "55tropencomment") = 1 Then
  Const dbpath = "../"
  Set ctr_page = New tr_page
  id = tr_killstr(request.querystring("id"), 1, 8, 1, "", "", "", "", 2)
%>
var tmpstr=("<div class=\"trunotice810901\"> <%=application(siternd & "55trcommentnotice")%> </div>");
tmpstr=tmpstr+("<form id=\"form1\" name=\"form1\" method=\"post\" action=\"<%if ishtml=2 then%>../<%end if%>user/usersave.asp\" target=\"ifr1\" onSubmit=\"return checkguest(this)\">");
tmpstr=tmpstr+("<table class=\"trsendtb\" >");
tmpstr=tmpstr+("<tr>");
tmpstr=tmpstr+("<td align=\"center\" colspan=\"11\"><textarea id=\"content\" name=\"content\" class=\"trgcontent trinput6\"></textarea></td>");
tmpstr=tmpstr+("</tr>");
tmpstr=tmpstr+("<tr>");
tmpstr=tmpstr+("<td align=\"left\" nowrap> </td>");
tmpstr=tmpstr+("<td align=\"left\" >昵称 <span class=\"trfont2\"> * </span><input type=\"text\" value=\"游客\" name=\"username\" id=\"username\" class=\" trinput3810901\" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;验证码 <span class=\"trfont2\"> * </span> <input name=\"vcode\" type=\"text\" class=\" trinput3810901\" id=\"vcode\" value=\"\" maxlength=\"4\" /> <%if ishtml=2 then%><img id=\"codeimg\" src=\"../core/Code.asp?rd=<%=gen_key(5)%>\" style=\"cursor:hand; \" title=\"点击更换\" onClick=\"javascript:this.src='../core/Code.asp?rd='+randomString(10)+''\" height=\"24\" border=\"0\" width=\"70\"><%else%><img id=\"codeimg\" src=\"./core/Code.asp?rd=<%=gen_key(5)%>\" style=\"cursor:hand; \" title=\"点击更换\" onClick=\"javascript:this.src='./core/Code.asp?rd='+randomString(10)+''\" height=\"24\" border=\"0\" width=\"70\"><%end if%></td>");
tmpstr=tmpstr+("<td align=\"left\" nowrap></td>");
tmpstr=tmpstr+("<td align=\"left\" ><input type=\"hidden\" value=\"\" name=\"mail\" id=\"mail\" class=\" trinput3\" /></td>");
tmpstr=tmpstr+("<td align=\"left\" nowrap></td>");
tmpstr=tmpstr+("<td align=\"left\" ><input type=\"hidden\" value=\"\" name=\"homepage\" id=\"homepage\" class=\" trinput3\" /></td>");
tmpstr=tmpstr+("<td align=\"left\" nowrap> </td>");
//tmpstr=tmpstr+("<td align=\"left\" ></td>");
<%if ishtml=2 then%>
tmpstr=tmpstr+("<td align=\"left\"></td>");
<%else%>
tmpstr=tmpstr+("<td align=\"left\"></td>");
<%end if%>
tmpstr=tmpstr+("<td align=\"right\"><input type=\"submit\" value=\"提交评论\" name=\"submit1\" id=\"submit1\" class=\"trbt3810901 trmar1\" />");
tmpstr=tmpstr+("<input type=\"hidden\" value=\"comment\" name=\"action\" />");
tmpstr=tmpstr+("<input type=\"hidden\" value=\"<%=id%>\" name=\"ownarticle\" />");
tmpstr=tmpstr+("<input type=\"hidden\" value=\"\" name=\"owncolumn\" />");
tmpstr=tmpstr+("<input type=\"hidden\" value=\"\" name=\"owncolumnqueue\" /></td>");
tmpstr=tmpstr+("</tr>");
tmpstr=tmpstr+("</table>");
tmpstr=tmpstr+("</form>");
tmpstr=tmpstr+("<table align=\"center\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" id=\"mytable\" class=\"trtable2\" >");
<%
pageno = tr_killstr(request.querystring("pageno"), 1, 8, 1, "", "", "", "", 1)
sql = "select id,username,content,addtime,homepage,asuser,answer,astime from tr_comment where types=1 and ownarticle="&id&" and ispass=1 and isdel=0 order by addtime desc , id desc  "
page_size = 20
pagei = 0
n = (pageno -1) * page_size
Call ctr_page.create_rs(sql, rs, conn, page_size, pageno)
If Not rs.EOF Then
  Do While Not rs.EOF
    If pagei>= page_size Then Exit Do
    pagei = pagei + 1
    n = n + 1
%>
tmpstr=tmpstr+("<tr class=\"\">");
tmpstr=tmpstr+("<td width=\"\">");
tmpstr=tmpstr+("<div class=\"trcontents trfl trbookbt\">");
tmpstr=tmpstr+("<p class=\"trp1\"> <span class=\"uname \">");
  <%if isweburl(rs("homepage")) then%>
tmpstr=tmpstr+("<a href=\"#\"><%=tojs2(rs("username"),"")%></a>");
  <%else%>
  <%=tojs2(rs("username"),"tmpstr")%>
  <%end if%>
tmpstr=tmpstr+("</span> 说： <%=tojs2(rs("content"),"")%> </p>")
tmpstr=tmpstr+("<p class=\"trp2\"><%=tojs2(FormatDate(rs("addtime"), 1),"") %> </p>")
<%if len(rs("answer"))>1 then%>
tmpstr=tmpstr+("<p class=\"trp3\">管理员 回复：<%=tojs2(rs("answer"),"")%></p>");
tmpstr=tmpstr+("<p class=\"trp2\"><%=tojs2(FormatDate(rs("astime"), 1),"") %> </p>");
<%end if%>
tmpstr=tmpstr+("</div>");
tmpstr=tmpstr+("</td>");
tmpstr=tmpstr+("</tr>");
<%
rs.movenext
Loop
Else
%>
tmpstr=tmpstr+("<tr>");
tmpstr=tmpstr+("<td>还没有人评论，赶快抢个沙发吧。</td>");
tmpstr=tmpstr+("</tr>");
<%
End If
rs.Close
%>
tmpstr=tmpstr+("</table>");
<%if ctr_page.page_count>1 then%>
<%= tojs2(ctr_page.create_page2("",ctr_page.page_count,pageno,"trpage","dataload"),"tmpstr")%>
<% end if%>
function changeText(tmp){
top.document.getElementById('showcomment').innerHTML = tmp;
top.document.getElementById('showcomment').className  = "trcomment ";
}
changeText(tmpstr)
<%End If
%>
