<% Call OpenConn() function htmlencode2(str) dim result dim l if isNULL(str) then htmlencode2="" exit function end if l=len(str) result="" dim i for i = 1 to l select case mid(str,i,1) case "<" result=result+"<" case ">" result=result+">" case chr(13) result=result+"
" case chr(34) result=result+""" case "&" result=result+"&" if i+1<=l and i-1>0 then if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then result=result+" " else result=result+" " end if else result=result+" " end if case chr(9) result=result+" " case else result=result+mid(str,i,1) end select next htmlencode2=result end function dim cc_id cc_id=Request("cc_id") %> <%if Request.QueryString("action")="post" then%> <% dim ckpl,pc_adtime,aa_count,dp_time,pc_jtime,sc_ip set rs=server.CreateObject("adodb.recordset") rs.Open "select sc_ip from FSecConfig",conn,1,1 if rs.eof and rs.bof then sc_ip="" else sc_ip=rs("sc_ip") end if if InStr(trim(sc_ip),trim(Request.ServerVariables("REMOTE_ADDR")))>0 then response.Write "" response.End end if rs.Close set rs=nothing ckpl=0 set rs=server.CreateObject("adodb.recordset") rs.Open "select pc_ccid,pc_ip,pc_adtime from FPubComment where pc_ccid="&cc_id&" and pc_ip='"&Request.ServerVariables("REMOTE_ADDR")&"' order by pc_adtime desc",conn,1,1 aa_count=rs.RecordCount if aa_count>0 then pc_adtime=rs("pc_adtime") dp_time=DateDiff("s",""&pc_adtime&"",""&now()&"") if dp_time<86400 then if aa_count<3 then pc_jtime=1 end if if (aa_count>2 and aa_count<6) then pc_jtime=30 end if if (aa_count>5 and aa_count<11) then pc_jtime=1800 end if if aa_count>10 then pc_jtime=8640 end if if dp_time>pc_jtime then ckpl=1 end if else ckpl=1 end if else ckpl=1 end if rs.Close set rs=nothing %> <% if ckpl=1 then dim getcode,fbpl,add_name,pc_ip getcode=replace(trim(Request("getcode")),"'","") fbpl=htmlencode2(trim(Request("content"))) if S_Username<>"" then add_name=trim(S_Username) else add_name=trim(Request("nickname")) end if pc_ip=Request.ServerVariables("REMOTE_ADDR") if add_name="" then response.Write "" response.End end if if fbpl="" then response.Write "" response.End end if if getcode="" then response.Write "" response.End end if if getcode<>CStr(session("getcode")) then response.Write "" response.End end if set rs=server.CreateObject("adodb.recordset") rs.Open "select * from FPubComment ",conn,1,3 rs.AddNew rs("pc_content")=fbpl rs("pc_username")=add_name rs("pc_adtime")=now() rs("pc_ip")=Request.ServerVariables("REMOTE_ADDR") rs("pc_ccid")=cc_id if S_userid<>"" then rs("pc_userid")=S_userid end if rs.Update rs.Close set rs=nothing else response.Write "" response.End end if %> <%end if%>
<% dim rs,Sql,iCount,iPageSize,maxpage,page,x,i1,action set rs=server.CreateObject("adodb.recordset") rs.Open "Select pc_id,pc_ccid,pc_adtime,pc_ip,pc_content,pc_userid,pc_mark,pc_username From FPubComment Where pc_ccid="&cc_id&" And pc_mark=0 Order By pc_id Desc",conn,1,1 if not rs.eof then rs.PageSize =5 '每页记录条数 iCount=rs.RecordCount '记录总数 iPageSize=rs.PageSize maxpage=rs.PageCount page=request("page") if Not IsNumeric(page) or page="" then page=1 else page=cint(page) end if if page<1 then page=1 elseif page>maxpage then page=maxpage end if rs.AbsolutePage=Page if page=maxpage then x=iCount-(maxpage-1)*iPageSize else x=iPageSize end if dim i_1,i_count i_1=int(x) i1=iCount-(page-1)*iPageSize %> <%for i_count=1 to i_1%> <% rs.movenext i1=i1-1 next %>
第 <%=i1%> 楼
评论者:<%=rs("pc_username")%>    <%=rs("pc_adtime")%>
<% call PageControl(iCount,maxpage,page,"border=0 align=center","") Sub PageControl(iCount,pagecount,page,table_style,font_style) Dim query, a, x, temp action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") query = Split(Request.ServerVariables("QUERY_STRING"), "&") For Each x In query a = Split(x, "=") If StrComp(a(0), "page", vbTextCompare) <> 0 Then temp = temp & a(0) & "=" & a(1) & "&" End If Next Response.Write("" & vbCrLf ) Response.Write("" & vbCrLf ) Response.Write("" & vbCrLf ) Response.Write("" & vbCrLf ) Response.Write("
" & vbCrLf ) Response.Write(font_style & vbCrLf ) if page<=1 then Response.Write ("U乐娱乐 " & vbCrLf) Response.Write ("上一页 " & vbCrLf) else Response.Write("U乐娱乐 " & vbCrLf) Response.Write("上一页 " & vbCrLf) end if if page>=pagecount then Response.Write ("下一页 " & vbCrLf) Response.Write ("尾页 " & vbCrLf) else Response.Write("下一页 " & vbCrLf) Response.Write("尾页 " & vbCrLf) end if Response.Write(" 页次:" & page & "/" & pageCount & " " & vbCrLf) Response.Write(" 共 " & iCount & " " & vbCrLf & " 条评论 ") Response.Write(" 转到第" & "" & " " & vbCrLf & "页" & vbCrLf & "") Response.Write("
" & vbCrLf ) End Sub %>
<% end if rs.Close set rs=nothing %>
您的昵称: <%if S_Username<>"" then%> <%=S_Username%> <%else%> <%end if%> 注意事项:
评论内容: 1、请回复主题相关内容