ShowNote.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:12k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/ns_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <!--#include file="../../FS_Inc/Func_page.asp" -->
  7. <%
  8. response.buffer=true
  9. Response.CacheControl = "no-cache"
  10. Dim Conn,User_Conn
  11. MF_Default_Conn
  12. 'session判断
  13. MF_Session_TF 
  14. if not MF_Check_Pop_TF("WS001") then Err_Show
  15. '---分页
  16. Dim int_Start,int_RPP,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  17. int_RPP=10 '设置每页显示数目
  18. toF_="<font face=webdings>9</font>"    '首页 
  19. str_nonLinkColor_="#999999" '非热链接颜色
  20. int_showNumberLink_=10 '数字导航显示数目
  21. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  22. toF_="<font face=webdings>9</font>"    '首页 
  23. toP10_=" <font face=webdings>7</font>" '上十
  24. toP1_=" <font face=webdings>3</font>" '上一
  25. toN1_=" <font face=webdings>4</font>" '下一
  26. toN10_=" <font face=webdings>8</font>" '下十
  27. toL_="<font face=webdings>:</font>"
  28. %>
  29. <html>
  30. <HEAD>
  31. <TITLE>FoosunCMS留言系统</TITLE>
  32. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  33. </HEAD>
  34. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  35. <script language="javascript">
  36. function AddNote(ClassID)
  37. {
  38. location="AddNewNote.asp?ClassID="+ClassID;
  39. }
  40. function showRep(cat)
  41. {
  42.   cat.style.display="";
  43.   cat.focus();
  44. }
  45. function ShowNote(NoteID,ClassName,ClassID)
  46. {
  47. alert(ClassID);
  48. location="ShowNote.asp?NoteID="+NoteID+"&ClassName="+ClassName+"&ClassID="+ClassID;
  49. }
  50. </script>
  51. <body>
  52. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table"> 
  53.   <tr> 
  54.     <td align="left" class="xingmu">留言管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td> 
  55.   </tr>
  56. </table>
  57. <%
  58. Dim ID,NoteID,NoteRs,ClassName,ClassID,BbsRs,Topic,UserName,Face,Content,i
  59. Set NoteRs=Server.CreateObject(G_FS_RS)
  60. Set BbsRs=Server.CreateObject(G_FS_RS)
  61. if Request.QueryString("NoteID")<>"" then
  62. ID=Trim(Request.QueryString("NoteID"))
  63. ClassName=trim(Request.QueryString("ClassName"))
  64. ClassID=Trim(Request.queryString("ClassID"))
  65. NoteRs.open "Select ID,ClassID,User,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser,Face,IP  From FS_WS_BBS Where ID="&ID&"",Conn,1,1
  66. if not NoteRs.eof then
  67. %>
  68.  <form name="showBbs" id="showBbs" action="?Act=AddRe" method="post">
  69.   <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> 
  70.   <tr> 
  71.     <td align="left" class="xingmu" colspan="2"><img src="images/Forum_nav.gif"><a href="ClassMessageManager.asp" class="sd">留言管理</a>-><a href="ClassMessageManager.asp?Act=all" class="sd"><%=ClassName%></a>-&gt;<%=NoteRs("Topic")%><input type="hidden" name="ClassName" value="<%=ClassName%>"></td> 
  72.   </tr>
  73.   <tr>
  74.    <td class="hback" colspan="2">
  75. <img src="images/postnew.gif" alt="发表贴子" width="85" height="26" style="CURSOR: hand" onMouseUp="AddNote('<%=ClassID%>')">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/mreply.gif" alt="发表贴子" width="85" height="26" style="CURSOR: hand" onMouseUp="showRep(REP)"> </td>
  76.   </tr>
  77.   <tr>
  78.    <td class="hback" width="14%" rowspan="2">
  79. <%=NoteRs("User")%>&nbsp;&nbsp;&nbsp;&nbsp;<br>
  80. <img src="images/noHeadPic.jpg" alt=" " width="91" height="84"><br>
  81. <img src="images/ip.gif"><%=NoteRs("IP")%><br>
  82. <%=NoteRs("AddDate")%> </td>
  83. <td class="hback" width="86%" height="2%"><img src="Images/face<% = NoteRs("Face")%>.gif" width="22" height="22"><%=NoteRs("Topic")%></td>
  84.   </tr>
  85.   <tr>
  86.    <td class="hback">&nbsp;&nbsp;<%=NoteRs("Body")%><br>
  87. <div align="right"><a href="NoteEdit.asp?Act=NoteEdit&ID=<%=NoteRs("ID")%>">[编辑此贴子]</a>&nbsp;&nbsp;<a href="NoteDel.asp?ID=<%=NoteRs("ID")%>&Act=single" onClick="{if(confirm('如果删除该话题,那么相关的评论都将被删除,确定要删除吗?')){return true;}return false;}">[删除此帖子]</a>&nbsp;&nbsp;</div></td>
  88.   </tr>
  89.     <%
  90.    BbsRs.open "Select ID,ClassID,User,ParentID,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser,Face,IP  From FS_WS_BBS Where ParentID='"&ID&"' order by AddDate",Conn,1,1
  91. if not BbsRs.eof then
  92. BbsRs.PageSize=int_RPP
  93. cPageNo=NoSqlHack(Request.QueryString("Page"))
  94. If cPageNo="" Then 
  95. cPageNo = 1
  96. End if
  97. If not isnumeric(cPageNo) Then 
  98. cPageNo = 1
  99. cPageNo = Clng(cPageNo)
  100. End If
  101. If cPageNo<=0 Then 
  102. cPageNo=1
  103. End If
  104. If cPageNo>BbsRs.PageCount Then 
  105. cPageNo=BbsRs.PageCount 
  106. BbsRs.AbsolutePage=cPageNo
  107. End IF
  108. i=1
  109. FOR int_Start=1 TO int_RPP
  110. i=i+1 
  111. %>
  112.   <tr>
  113.    <td class="hback" width="15%" rowspan="2">
  114. <%=BbsRs("User")%>&nbsp;&nbsp;&nbsp;&nbsp;<br>
  115. <img src="images/noHeadPic.jpg" alt=" " width="91" height="84"><br>
  116. <img src="images/ip.gif"><%=BbsRs("IP")%><br>
  117. <%=BbsRs("AddDate")%> </td>
  118. <td class="hback" width="90%" height="5">&nbsp;<div align="right">第<%=int_Start%>楼</iv></td>
  119.   </tr>
  120.   <tr>
  121.    <td class="hback"><img src="Images/face<%=BbsRs("Face")%>.gif" width="22" height="22"><%=BbsRs("Body")%><br>
  122. <div align="right"><a href="EditBBS.asp?Act=Edit&BBSID=<%=BbsRs("ID")%>&ClassName=<%=ClassName%>">[编辑此贴子]</a>&nbsp;&nbsp;<a href="BBsDel.asp?Act=SinglDel&BBSID=<%=BbsRs("ID")%>&ClassID=<%=ClassID%>&ClassName=<%=ClassName%>&NoteID=<%=BbsRs("ParentID")%>" onClick="{if(confirm('确定要删除吗?')){return true;}return false;}">[删除此帖子]</a>&nbsp;&nbsp;</div></td>
  123.   </tr>
  124. <%
  125. BbsRs.MoveNext
  126. if BbsRs.eof or BbsRs.bof then exit for
  127.     NEXT
  128. Response.Write("<tr><td class=""hback"" colspan=""2"" align=""right"">"&fPageCount(BbsRs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf&"</td></tr>")
  129. end if
  130.     BbsRs.close
  131.    %>
  132.    <td class="hback" colspan="2"><img src="images/postnew.gif" alt="发表贴子" width="85" height="26" style="CURSOR: hand" onMouseUp="AddNote('<%=ClassID%>')">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/mreply.gif" alt="发表贴子" width="85" height="26" style="CURSOR: hand" onMouseUp="showRep(REP)"> </td>
  133.   </tr>
  134.   <tr ID="REP"  style="display:none">
  135.    <td class="hback" colspan="2" width="100%"> 
  136.  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">  <tr>
  137.    <td class="hback" colspan="2" width="100%">快速回复帖子</td>
  138. </tr>
  139. <tr>
  140. <td class="hback" align="right" width="15%">用户名</td>
  141. <td class="hback"><input type="text" id="UserName" name="UserName" size="23" maxlength="50" value="<%=Session("Admin_Name")%>" readonly></td>
  142. </tr>
  143. <tr>
  144. <td class="hback" align="right" height="25">表情</td>
  145. <td class="hback" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
  146.                   <tr> 
  147.                     <td> <input name="FaceNum" type="radio" value="1" checked> 
  148.                       <img src="Images/face1.gif" width="22" height="22"> </td>
  149.                     <td> <input type="radio" name="FaceNum" value="2"> <img src="Images/face2.gif" width="22" height="22">                    </td>
  150.                     <td> <input type="radio" name="FaceNum" value="3"> <img src="Images/face3.gif" width="22" height="22">                    </td>
  151.                     <td> <input type="radio" name="FaceNum" value="4"> <img src="Images/face4.gif" width="22" height="22">                    </td>
  152.                     <td> <input type="radio" name="FaceNum" value="5"> <img src="Images/face5.gif" width="22" height="22">                    </td>
  153.                     <td> <input type="radio" name="FaceNum" value="6"> <img src="Images/face6.gif" width="22" height="22"></td>
  154.                     <td> <input type="radio" name="FaceNum" value="7"> <img src="Images/face7.gif" width="22" height="22">                    </td>
  155.                     <td> <input type="radio" name="FaceNum" value="8"> <img src="Images/face8.gif" width="22" height="22">                    </td>
  156.                     <td> <input type="radio" name="FaceNum" value="9"> <img src="Images/face9.gif" width="22" height="22"></td>
  157.                   </tr>
  158.                   <tr> 
  159.                     <td> <input type="radio" name="FaceNum" value="10"> <img src="Images/face10.gif" width="22" height="22"></td>
  160.                     <td> <input type="radio" name="FaceNum" value="11"> <img src="Images/face11.gif" width="22" height="22">                    </td>
  161.                     <td> <input type="radio" name="FaceNum" value="12"> <img src="Images/face12.gif" width="22" height="22"></td>
  162.                     <td> <input type="radio" name="FaceNum" value="13"> <img src="Images/face13.gif" width="22" height="22">                    </td>
  163.                     <td> <input type="radio" name="FaceNum" value="14"> <img src="Images/face14.gif" width="22" height="22"></td>
  164.                     <td> <input type="radio" name="FaceNum" value="15"> <img src="Images/face15.gif" width="22" height="22"></td>
  165.                     <td> <input type="radio" name="FaceNum" value="16"> <img src="Images/face16.gif" width="22" height="22"></td>
  166.                     <td> <input type="radio" name="FaceNum" value="17"> <img src="Images/face17.gif" width="22" height="22">                    </td>
  167.                     <td> <input type="radio" name="FaceNum" value="18"> <img src="Images/face18.gif" width="22" height="22">                    </td>
  168.                   </tr>
  169.                 </table>
  170. </td>
  171. </tr>
  172. <tr>
  173. <td class="hback" align="right">内容</td>
  174. <td class="hback" valign="top" ><textarea name="Content" id="Content" rows="8" cols="25"></textarea></td>
  175. </tr>
  176. <tr>
  177. <td class="hback" >&nbsp;<input type="hidden" name="ClassID" value="<%=ClassID%>"><input type="hidden" name="NoteID" value="<%=NoteRs("ID")%>"><input type="hidden" name="Topic" value="<%=NoteRs("Topic")%>"><input type="hidden" name="ID" value="<%=ID%>"></td>
  178.  <td class="hback"><input type="submit" name="submit" value="回复帖子">&nbsp;&nbsp;
  179.     <input type="reset" name="reset" value=" 清  空 "></td>
  180. </tr>
  181.  </table>
  182. </td>
  183.   </tr>
  184.   </table>
  185. </form>
  186. <%
  187. end if
  188. end if
  189. Set NoteRs=nothing
  190. if Request.QueryString("Act")="AddRe" then
  191. ID=Request.form("ID")
  192. NoteID=Request.form("NoteID")
  193. ClassID=Request.form("ClassID")
  194. Topic=Request.form("Topic")
  195. UserName=Request.form("UserName")
  196. Face=Request.form("FaceNum")
  197. Content=trim(Request.form("Content"))
  198. ClassName=Request.form("ClassName")
  199. if NoteID="" or ClassID="" or ID="" or Topic="" or UserName="" or Face="" or ClassName="" then
  200. Response.write ("<script>alert('参数出错啦!');history.back();</script>")
  201. response.end
  202. end if
  203. if Content="" then 
  204. Response.write ("<script>alert('留言内容不能为空!');history.back();</script>")
  205. response.end
  206. end if
  207. BbsRs.open "Select ID,ClassID,User,ParentID,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser,Face,IP  From FS_WS_BBS Where 1=2",Conn,3,3
  208. BbsRs.Addnew
  209. BbsRs("ClassID")=ClassID
  210. BbsRs("User")=UserName
  211. BbsRs("ParentID")=ID
  212. BbsRs("topic")=Topic
  213. BbsRs("Body")=Content
  214. BbsRs("AddDate")=now()
  215. BbsRs("LastUpdateDate")=now()
  216. BbsRs("LastUpdateUser")=UserName
  217. BbsRs("Face")=Face
  218. BbsRs("IP")=Request.ServerVariables("REMOTE_ADDR")
  219. BbsRs.update
  220. Set BbsRs=nothing
  221. Response.Redirect("ShowNote.asp?NoteID="&NoteID&"&ClassName="&ClassName&"&ClassID="&ClassID&"")
  222. end if
  223. Set Conn=nothing
  224. %>
  225. </body>
  226. </html>