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

数据库编程

开发平台:

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="lib/cls_main.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. '权限判断
  15. if not MF_Check_Pop_TF("WS002") then Err_Show
  16. dim Fs_news
  17. set Fs_news = new Cls_News
  18. %>
  19. <html>
  20. <HEAD>
  21. <TITLE>FoosunCMS留言系统</TITLE>
  22. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  23. </HEAD>
  24. <script language="javascript">
  25. function ShowNote(NoteID,ClassName,ClassID)
  26. {
  27. location="ShowNote.asp?NoteID="+NoteID+"&ClassName="+ClassName+"&ClassID="+ClassID;
  28. }
  29. </script>
  30. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  31. <script language="javascript">
  32. function goback(){
  33. history.go(-1);
  34. }
  35. </script>
  36. <body>
  37. <%
  38. Dim ID,ShowRs,SaveRs,NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin,ClassName,NoteID,ClassID,strShowErr
  39. Set ShowRs=Server.CreateObject(G_FS_RS)
  40. Set SaveRs=Server.CreateObject(G_FS_RS)
  41. if NoSqlHack(Request.QueryString("Act"))="Edit" then
  42. ID=Request.QueryString("BBSID")
  43. if ID="" then
  44. strShowErr = "<li>参数出错!</li>"
  45. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  46. Response.end
  47. end if
  48. ShowRs.open "Select ID,ClassID,User,Topic,Body,AddDate,IsTop,State,IsAdmin,LastUpdateDate,LastUpdateUser,Face From FS_WS_BBS Where ID="&ID&"",Conn,1,1
  49. if ShowRs.eof and ShowRs.bof then
  50. strShowErr = "<li>你要修改的帖子已不存在了!</li>"
  51. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  52. Response.end
  53. else
  54. %>
  55. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  56.   <tr class="hback">
  57.     <td align="left" colspan="2" class="xingmu">留言板&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  58.   </tr>
  59.   <tr>
  60.     <td colspan="2" class="hback"><a href="#" onClick="goback()">返回</a><a href="ClassMessageManager.asp"></a></td>
  61.   </tr>
  62. </table>
  63. <form id="WriteNote" name="WriteNote" action="?Act=Save" method="post">
  64. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  65. <tr class="hback">
  66. <td class="hback" align="right" width="20%">贴子标题</td>
  67.   <td class="hback" ><input type="test" name="Topic" size="23" maxlength="50" value="<%=ShowRs("Topic")%>">&nbsp;&nbsp;</td>
  68. </tr>
  69. <tr class="hback">
  70. <td class="hback" align="right" width="20%">当前表情</td>
  71. <td class="hback" align="left">
  72.   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  73.             <tr>
  74.               <td>
  75.                 <input name="FaceNum" type="radio" value="1" <%If ShowRs("Face")=1 then response.Write("Checked")%>>
  76.                 <img src="Images/face1.gif" width="22" height="22"> </td>
  77.               <td>
  78.                 <input type="radio" name="FaceNum" value="2" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
  79.                 <img src="Images/face2.gif" width="22" height="22"> </td>
  80.               <td>
  81.                 <input type="radio" name="FaceNum" value="3" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
  82.                 <img src="Images/face3.gif" width="22" height="22"> </td>
  83.               <td>
  84.                 <input type="radio" name="FaceNum" value="4" <%If ShowRs("Face")=4 then response.Write("Checked")%>>
  85.                 <img src="Images/face4.gif" width="22" height="22"> </td>
  86.               <td>
  87.                 <input type="radio" name="FaceNum" value="5" <%If ShowRs("Face")=5 then response.Write("Checked")%>>
  88.                 <img src="Images/face5.gif" width="22" height="22"> </td>
  89.               <td>
  90.                 <input type="radio" name="FaceNum" value="6" <%If ShowRs("Face")=6 then response.Write("Checked")%>>
  91.                 <img src="Images/face6.gif" width="22" height="22"></td>
  92.               <td>
  93.                 <input type="radio" name="FaceNum" value="7" <%If ShowRs("Face")=7 then response.Write("Checked")%>>
  94.                 <img src="Images/face7.gif" width="22" height="22"> </td>
  95.               <td>
  96.                 <input type="radio" name="FaceNum" value="8" <%If ShowRs("Face")=8 then response.Write("Checked")%>>
  97.                 <img src="Images/face8.gif" width="22" height="22"> </td>
  98.               <td>
  99.                 <input type="radio" name="FaceNum" value="9" <%If ShowRs("Face")=9 then response.Write("Checked")%>>
  100.                 <img src="Images/face9.gif" width="22" height="22"></td>
  101.             </tr>
  102.             <tr>
  103.               <td>
  104.                 <input type="radio" name="FaceNum" value="10" <%If ShowRs("Face")=10 then response.Write("Checked")%>>
  105.                 <img src="Images/face10.gif" width="22" height="22"></td>
  106.               <td>
  107.                 <input type="radio" name="FaceNum" value="11" <%If ShowRs("Face")=11 then response.Write("Checked")%>>
  108.                 <img src="Images/face11.gif" width="22" height="22"> </td>
  109.               <td>
  110.                 <input type="radio" name="FaceNum" value="12" <%If ShowRs("Face")=12 then response.Write("Checked")%>>
  111.                 <img src="Images/face12.gif" width="22" height="22"></td>
  112.               <td>
  113.                 <input type="radio" name="FaceNum" value="13" <%If ShowRs("Face")=13 then response.Write("Checked")%>>
  114.                 <img src="Images/face13.gif" width="22" height="22"> </td>
  115.               <td>
  116.                 <input type="radio" name="FaceNum" value="14" <%If ShowRs("Face")=14 then response.Write("Checked")%>>
  117.                 <img src="Images/face14.gif" width="22" height="22"></td>
  118.               <td>
  119.                 <input type="radio" name="FaceNum" value="15" <%If ShowRs("Face")=15 then response.Write("Checked")%>>
  120.                 <img src="Images/face15.gif" width="22" height="22"></td>
  121.               <td>
  122.                 <input type="radio" name="FaceNum" value="16" <%If ShowRs("Face")=16 then response.Write("Checked")%>>
  123.                 <img src="Images/face16.gif" width="22" height="22"></td>
  124.               <td>
  125.                 <input type="radio" name="FaceNum" value="17" <%If ShowRs("Face")=17 then response.Write("Checked")%>>
  126.                 <img src="Images/face17.gif" width="22" height="22"> </td>
  127.               <td>
  128.                 <input type="radio" name="FaceNum" value="18" <%If ShowRs("Face")=18 then response.Write("Checked")%>>
  129.                 <img src="Images/face18.gif" width="22" height="22"> </td>
  130.             </tr>
  131.           </table>
  132. </td>
  133. </tr>
  134. <tr class="hback">
  135. <td class="hback" align="right">帖子内容</td>
  136.         <td class="hback" valign="top" >
  137. <textarea name="Content" id="Content" rows="8" cols="25"><%=ShowRs("Body")%></textarea>
  138. </tr>
  139. <tr class="hback">
  140. <td class="hback"><input type="hidden" name="ClassName" value="<%=Request.QueryString("ClassName")%>">&nbsp;<input type="hidden" name="NoteID" ID="NoteID" value="<%=ShowRs("ID")%>"></td>
  141.   <td class="hback"><input type="submit" name="submit" value="OK保存贴子">&nbsp;&nbsp;
  142.     <input type="reset" name="reset" value=" 清  空 ">
  143. </table>
  144. </form>
  145. <%
  146. end if
  147. end if
  148. set ShowRs=nothing
  149. if NoSqlHack(Request.QueryString("Act"))="Save" then
  150. ID=Request.Form("NoteID")
  151. Topic=NoHtmlHackInput(trim(Replace(Request.form("Topic"),"'","")))
  152. Content=NoHtmlHackInput(Trim(Request.form("Content")))
  153. IsAdmin=NoHtmlHackInput(Trim(Request.form("IsAdmin")))
  154. ClassName=NoHtmlHackInput(trim(Request.Form("ClassName")))
  155. if IsAdmin="" then
  156. IsAdmin="0"
  157. end if
  158. if ID="" then
  159. strShowErr = "<li>参数出错!</li>"
  160. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  161. Response.end
  162. end if
  163. if Topic="" then
  164. strShowErr = "<li>标题不能为空!</li>"
  165. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  166. Response.end
  167. end if
  168. if Content="" then
  169. strShowErr = "<li>内容不能为空!</li>"
  170. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  171. Response.end
  172. end if
  173. SaveRs.open "Select ID,ClassID,User,Topic,Body,AddDate,IsTop,State,ParentID,IsAdmin,LastUpdateDate,LastUpdateUser,Face From FS_WS_BBS Where ID="&ID&"",Conn,3,3
  174. if not SaveRs.eof then
  175. Face=Trim(Request.Form("FaceNum"))
  176. ClassID=SaveRs("ClassID")
  177. NoteID=SaveRs("ParentID")
  178. SaveRs("Topic")=Topic
  179. SaveRs("Body")=Content
  180. SaveRs("IsTop")=IsTop
  181. SaveRs("IsAdmin")=IsAdmin
  182. SaveRs("LastUpdateUser")=session("Admin_Name")
  183. SaveRs("LastUpdateDate")=now()
  184. SaveRs("Face")=Face
  185. SaveRs.update
  186. Response.write("'<script>ShowNote("&NoteID&",'"&ClassName&"','"&ClassID&"');</script>'")
  187. else
  188. strShowErr = "<li>参数出错!</li>"
  189. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  190. Response.end
  191. end if
  192. Set SaveRs=nothing
  193. end if
  194. Set Conn=nothing
  195. %>
  196. </body>
  197. </html>