ShowReview_Ajax.asp
Upload User: jisenq
Upload Date: 2014-06-29
Package Size: 7216k
Code Size: 4k
Category:

ADO-ODBC

Development Platform:

ASP/ASPX

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <% Option Explicit %>
  3. <%session.CodePage="936"%>
  4. <!--#include file="FS_Inc/Const.asp" -->
  5. <!--#include file="FS_InterFace/MF_Function.asp" -->
  6. <!--#include file="FS_Inc/Function.asp" -->
  7. <%
  8. Response.Buffer = True
  9. Response.Expires = -1
  10. Response.ExpiresAbsolute = Now() - 1
  11. Response.Expires = 0
  12. Response.CacheControl = "no-cache"
  13. response.Charset = "gb2312"
  14. Dim User_Conn,review_Sql,review_RS,review_RS1,strShowErr,Cookie_Domain
  15. Dim Server_Name,Server_V1,Server_V2
  16. Dim TmpStr,TmpArr,ReviewTypes
  17. Dim stype,Id,SpanId
  18. TmpStr = "" 
  19. Dim Conn 
  20.   
  21. MF_Default_Conn
  22. Cookie_Domain = Get_MF_Domain()
  23. if Cookie_Domain="" then 
  24. Cookie_Domain = "localhost"
  25. else
  26. if left(lcase(Cookie_Domain),len("http://"))="http://" then Cookie_Domain = mid(Cookie_Domain,len("http://")+1)
  27. if right(Cookie_Domain,1)="/" then Cookie_Domain = mid(Cookie_Domain,1,len(Cookie_Domain) - 1)
  28. end if
  29. ''防盗连
  30. Server_Name = Len(Request.ServerVariables("SERVER_NAME"))
  31. Server_V1 = Left(Replace(Cstr(Request.ServerVariables("HTTP_REFERER")),"http://",""),Server_Name)
  32. Server_V2 = Left(Cstr(Request.ServerVariables("SERVER_NAME")),Server_Name)
  33. if Server_V1 <> Server_V2 and Server_V1 <> "" and Server_V2 <> "" then
  34. response.Write("没有权限,请访问<a href=""http://"&Cookie_Domain&""">"&Cookie_Domain&"</a>.")
  35. response.End()
  36. end if
  37. stype = NoSqlHack(request.QueryString("type")) 'NS
  38. Id = NoSqlHack(request.QueryString("Id")) 'Id
  39. SpanId = NoSqlHack(request.QueryString("SpanId"))
  40. if stype="" then response.Write("Error:type is null!")  :  response.End()
  41. if Id="" or not isnumeric(Id) then response.Write("Error:Id is no Validata!")  :  response.End()
  42. if SpanId="" then response.Write("Error:SpanId is null!")  :  response.End()
  43. select case stype
  44. case "NS"
  45. ReviewTypes=0
  46. case "DS"
  47. ReviewTypes=1
  48. case "MS"
  49. ReviewTypes=2
  50. case "HS"
  51. ReviewTypes=3
  52. case "SD"
  53. ReviewTypes=4
  54. case "LOG"
  55. ReviewTypes=5
  56. case else
  57. response.Write("Error:type("&stype&") is not found!")  :  response.End()
  58. end select
  59. MF_User_Conn
  60. Function review_Data()
  61. Dim UserName
  62. UserName=""
  63. review_Sql = "select top 10 ReviewID,UserNumber,Title,Content,AddTime,ReviewIP from FS_ME_Review where isLock=0 and AdminLock=0 and ReviewTypes="&ReviewTypes&" and InfoID="&ID&" order by ReviewID desc"
  64. set review_RS = CreateObject(G_FS_RS)
  65. review_RS.Open review_Sql,User_Conn,1,1
  66. if not review_RS.eof then
  67. review_Data = "<table border=0 width=""100%"" align=center>"&vbNewLine
  68. review_Data = review_Data &"<tr><td align=right bgcolor=""#efefef""><a href=""#"" onClick=""window.open ('http://"&Cookie_Domain&"/ShowReviewList.asp?Type="&stype&"&Id="&Id&"', 'newwindow', 'height=500, width=600, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');return false;"">更多评论</td></tr>"&vbNewLine
  69. do while not review_RS.eof 
  70. set review_RS1=User_Conn.execute("select UserName from FS_ME_Users where UserNumber='"&review_RS("UserNumber")&"'")
  71. if not review_RS1.eof then 
  72. UserName = review_RS1("UserName")
  73. 'if session("FS_UserNumber")<>"" then 
  74. UserName = "<a href=""http://"&Cookie_Domain&"/"&G_USER_DIR&"/ShowUser.asp?UserNumber="&review_RS("UserNumber")&""" title=""点击查看该用户信息"" target=""_blank"">"&UserName&"</a>"
  75. 'end if
  76. else
  77. UserName = "匿名"
  78. end if
  79. review_Data = review_Data &"<tr><td>"&UserName&"&nbsp;&nbsp;"&GetCStrLen(review_RS("Title"),20)&"&nbsp;&nbsp;"&review_RS("AddTime")&"&nbsp;&nbsp;"&showip(review_RS("ReviewIP"))&"</td></tr>"&vbNewLine
  80. review_Data = review_Data &"<tr><td>"&GetCStrLen(review_RS("Content"),60)&"..."&"</td></tr>"&vbNewLine
  81. review_RS1.close
  82. if review_RS.eof then exit do : exit Function 
  83. review_RS.movenext
  84. loop
  85. review_Data = review_Data &"</table>"&vbNewLine
  86. end if
  87. End Function
  88. function showip(ip)
  89. dim tmp_1,arr_1,ii_1
  90. tmp_1 = ""
  91. if ip="" or isnull(ip) then showip="":exit function
  92. arr_1 = split(ip,".")
  93. for ii_1=0 to ubound(arr_1)
  94. if ii_1<2 then 
  95. tmp_1 = tmp_1 &"."&arr_1(ii_1)
  96. else
  97. tmp_1 = tmp_1 & ".*"
  98. end if
  99. next
  100. showip = mid(tmp_1,2)
  101. end function
  102. response.Write(review_Data())
  103. User_ConnClose()
  104. Sub RsClose()
  105. review_RS.Close
  106. Set review_RS = Nothing
  107. end Sub
  108. Sub User_ConnClose()
  109. Set Conn = Nothing
  110. Set User_Conn = Nothing
  111. response.End()
  112. End Sub
  113. %>