<!--#include file="../Include_func.asp"-->
<!--#include file="../openconn.asp"-->
<%
'评论信息保存
'保存评论次数
IF Not ChkPost() Then
	'response.Redirect "./"
	'response.End()
End IF
Response.Buffer=True
response.contenttype="text/html;charset=gb2312"

bdcolor=replace(request("bdcolor"),"'","")
alink=replace(request("alink"),"'","")
bgcolor_1=replace(request("bgcolor"),"'","")
numb=replace(request("numb"),"'","")
numb=StayNub(numb)
bgcolor_arr=split(bgcolor_1,"|")
IF Ubound(bgcolor_arr)=0 Then
	bgcolor=bgcolor_arr(0)
	pinglun_border_1=1
ElseIF Ubound(bgcolor_arr)=1 Then
	bgcolor=bgcolor_arr(0)
	pinglun_border_1=bgcolor_arr(1)
End IF

Gb_css_1="width:99%"
Gb_css_2="height:24px;line-height:24px;border-width:"&pinglun_border_1&"px "&pinglun_border_1&"px 0px "&pinglun_border_1&"px;border-style:solid;font-size:14px;border-color:#"&bdcolor&";background-color:#"&bgcolor&";WIDTH:100%;"
Gb_css_3="border-width:0px "&pinglun_border_1&"px "&pinglun_border_1&"px "&pinglun_border_1&"px;border-style:solid;border-color:#"&bdcolor&";margin-bottom:12px;WIDTH:100%;"
Gb_css_4="width:90%"
Gb_css_5="font-size:14px;line-height:22px;table-layout:fixed; word-wrap:break-word;padding:5px 5px 5px 8px;"
Gb_Link_color="#"&alink
IF numb="" Then
	Gb_numb=5
Else
	Gb_numb=numb
End IF



Dim ranNum

Dim u,c,ip,datee
IF request.Cookies("q")("soojs_u")<>"" Then
	u=request.Cookies("q")("soojs_u")
Else
	'产生随机数，避免与现在的ID重复 
	randomize
	ranNum=int(900*rnd)+100
	u=replace(request("n_name"),"'","")	
End IF
'
Dim p_id

p_id_f=replace(request("t_id"),"'","")
IF Instr(p_id_f,"1000000000")>0 Then
	'专题 id
	g_topic_id=Replace(p_id_f,"1000000000","")
	g_topic_id=Bint(g_topic_id)
	p_id=0
Else
	g_topic_id=0
	p_id=Bint(p_id_f)
End IF
	'if p_id="" or isnull(p_id) then
	'	response.Redirect "../"
	'	response.End()
	'end if


Dim v
v=checkStr(request("v"))
Dim temp_sql,gb_jiange
c=checkStr(request("n_content"))
datee=FormatDate(now,55)
ip=getIP()
gb_jiange=request.cookies("gbook")("add_t")
Dim temp_jg
temp_jg=DateDiff("s",gb_jiange,now())

IF u<>"" and trim(c)<>""  Then
	IF temp_jg<30 Then
		response.Write "<div style=""text-align:center"" id=""liuyan_jiange""><font color=red>您的评论发布的太频繁，还有"&Cint(30-temp_jg)&"秒您才可以发布下一次评论谢谢！</font></div>"
	Else
		Dim ss_sql
		ss_sql="select * from g_b"
		Set ss_rs=server.CreateObject(G_RS)
		ss_rs.open ss_sql,Conn,1,3
		ss_rs.addnew
		ss_rs("g_name")=u
		ss_rs("g_content")=c
		ss_rs("g_ip")=ip
		ss_rs("g_date")=datee
		ss_rs("g_t_id")=p_id
		ss_rs("g_topic_id")=g_topic_id
		ss_rs.update
		Response.cookies("gbook")("add_t")=now()'评论间隔
	End IF
End IF
Set rs=server.CreateObject(G_RS)

sqll="select g_name,g_content,g_ip,g_date,g_hname,g_hcontent,id,g_hdate,g_t_id  from g_b where g_t_id="&p_id&"   order by id desc"
IF p_id<>0 Then
	sqll="select g_name,g_content,g_ip,g_date,g_hname,g_hcontent,id,g_hdate,g_t_id  from g_b where g_t_id="&p_id&"   order by id desc"
End IF
IF g_topic_id<>0 Then
	sqll="select g_name,g_content,g_ip,g_date,g_hname,g_hcontent,id,g_hdate,g_t_id  from g_b where g_topic_id="&g_topic_id&"   order by id desc"
End IF

rs.open sqll ,conn,1,1

'输出内容
		response.Write "<div style=""text-align:center"" id=""liuyan_jiange""></div>"
Dim s_str
s_str=""

if rs.eof then
	s_str=s_str&"<DIV style='"&Gb_css_1&"'>"&vbcrlf
	s_str=s_str&"<DIV style='"&Gb_css_2&"'><SPAN style=""PADDING-RIGHT: 10px; FLOAT: right"">"&FormatDate(now,55)&"</SPAN><SPAN style=""PADDING-LEFT: 10px;font-weight:bold""><CS2 /></SPAN></DIV>"&vbcrlf
	s_str=s_str&"<DIV style='"&Gb_css_3&"'>"&vbcrlf
	s_str=s_str&"<DIV style='"&Gb_css_4&"'>"&vbcrlf
	s_str=s_str&"<DIV style='"&Gb_css_5&"'>大家有对此影片有什么意见或看法，请在这里发表！</DIV>"&vbcrlf
	s_str=s_str&"</div>"&vbcrlf
	response.Write s_str
else
	count=ubound(rs.getrows,2)+1
	IF Gb_numb="" Then
		pagesize=5
	Else
		pagesize=Gb_numb
	End IF
	if (count mod pagesize)=0 then pagecount= count \ pagesize else pagecount= (count \ pagesize)+1
	curpage_=StayNub(request("page"))
	if curpage_<>"" then 
		page=int(request("page"))
	Else
		page=1
	End IF
	if page<=0 or page = "" then page=1
	if page>pagecount then page=pagecount
	rs.movefirst
	rs.move pagesize*(page-1)
'分页
	str=""
	if pagecount>1 Then
		if page>1 Then
			str=str&" <a href=javascript:void(0) target=_self onclick=ff(1)><font color='"&Gb_Link_color&"'>首页</font></a>"
			str=str&" <a href=javascript:void(0) target=_self onclick=ff("&page-1&")><font color='"&Gb_Link_color&"'>上一页</font></a>"
			if page<pagecount Then
				str=str&" <a href=javascript:void(0) target=_self onclick=ff("&page+1&")><font color='"&Gb_Link_color&"'>下一页</font></a>"
				str=str&" <a href=javascript:void(0) target=_self onclick=ff("&pagecount&")><font color='"&Gb_Link_color&"'>尾页</font></a>"
			else
				str=str&" 下一页"
				str=str&" 尾页"		
			end if
		else
			str=str&" 首页"
			str=str&" 上一页"
			str=str&" <a href=javascript:void(0) target=_self onclick=ff("&page+1&")><font color='"&Gb_Link_color&"'>下一页</font></a>"
			str=str&" <a href=javascript:void(0) target=_self onclick=ff("&pagecount&")><font color='"&Gb_Link_color&"'>尾页</font></a>"	
		end if
	end if
%>
<br />
<div align=center style=" font-size:12px;">共 <font color=red><b><%=count%></b></font> 条记录  每页显示<%=pagesize%>条记录 <%=str%>   <%=page%>/<%=pagecount%> 跳转到 <input type="text" size="2" id="p" value="<%=page%>"/> 页 <span onclick="ff($('p').value)" class="pinglun_Go" style="cursor:pointer"/>Go</span></div>
<br />
<%	
		Dim i_i_a
		i_i_a=1
	for i=1 to pagesize
		if rs.eof then exit for
			l_floor=count-(pagesize*(page-1)+i)+1
			if request.Cookies(Sky_Admin_Cookies_1)("admin_u")<>"" Then
				's_u_str=" | <span onclick='modify("&rs(6)&")' style='cursor:pointer'>修改</span> | <span onclick='del("&rs(6)&",this,"&rs(8)&")' style='cursor:pointer'>删除</span> | <span onclick='hf("&rs(6)&","&rs(8)&")' style='cursor:pointer'>回复</span>"
			else
				s_u_str=""
			End IF	
			response.Write "<a name="&i_i_a&"></a>"	&vbcrlf
			response.Write "<DIV style='"&Gb_css_1&"'>"&vbcrlf
			response.Write "<DIV style='"&Gb_css_2&"'><SPAN style=""PADDING-RIGHT: 10px; FLOAT: right"">"&rs(3)&s_u_str&"&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' class='t_top Gb_ook_red'  target=_self>"&l_floor&"楼</a>"&vbcrlf
			'1为普通会员，2可以添加修改和删除
			Dim s_u_str,s_ip_where
			
			s_ip_where=rs(2)
			
			IF s_ip_where="" THen s_ip_where=Request.ServerVariables("REMOTE_ADDR")
			IF G_pinglun_where Then
				s_ip_where_name=rs(0)&"(来自："&Disp_IPAddressData(s_ip_where,2)&")"
			Else
				s_ip_where_name=rs(0)
			End IF
			response.Write "</SPAN><SPAN style=""PADDING-LEFT: 10px;"">"&s_ip_where_name&"</SPAN></DIV>"&vbcrlf
			'response.Write "<div class='clear2'></div>"&vbcrlf
			response.Write "<DIV style='"&Gb_css_3&"'>"&vbcrlf
			response.Write "<DIV style='"&Gb_css_4&"'>"&vbcrlf
			Dim mmm_content
			mmm_content=HTMLEncode(rs(1))
			mmm_content=replace(mmm_content,"[face","<img src='"&Add_Root_Dir("/p_inc/pinglun/images/face/")&"")
			mmm_content=replace(mmm_content,"]",".gif'>")
			'过滤关键词----------------------------------------
			pL=Qingtiandy_getfilecontent(server.MapPath(Add_Root_Dir("/p_inc/Tag/pinglunlist.txt")))
			p_a=split(pL,"|")
			For j=Lbound(p_a) To Ubound(p_a)
				pL_1=p_a(j)
				mmm_content=replace(mmm_content,pL_1,"**")
			Next
	
			'过滤关键词----------------------------------------		
			response.Write "<DIV style='"&Gb_css_5&"'><CD>"&mmm_content&"</CD></DIV>"&vbcrlf
			IF rs(4)<>"" Then
				response.Write "<div id=""Lg""></div>"&vbcrlf
				response.Write "<table border=""0"" cellpadding=""0"" cellspacing=""0"">"&vbcrlf
				response.Write "<tr valign=""top"">"&vbcrlf
				response.Write "	<td class=""f14 redhf"">"&vbcrlf
				response.Write rs(5)&vbcrlf
				response.Write "	</td></tr></table>"&vbcrlf
				response.Write "<DIV class=gray align=right>回复者："&rs(4)&" "&rs(7)&"</DIV>"&vbcrlf
			End IF
			response.Write"</div></div></DIV>"	&vbcrlf
		i_i_a=i_i_a+1
		rs.movenext
	next
	'---------------------------------------
	'for i=1 to pagecount
	'pagelist=pagelist & " <a href=# onclick=f("&i&")>"&i&"</a>"
	'next
	'---------------------------------


'------------

%>
<div align=center style=" font-size:12px;">共 <font color=red><b><%=count%></b></font> 条记录  每页显示<%=pagesize%>条记录 <%=str%>   <%=page%>/<%=pagecount%> 跳转到 <input type="text" size="2" id="p" value="<%=page%>"/> 页 <span onclick="ff($('p').value)" class="pinglun_Go" style="cursor:pointer"/>Go</span>
<%end if%>


