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="../FS_Inc/Func_page.asp" -->
  7. <%
  8. response.buffer=true
  9. Response.CacheControl = "no-cache"
  10. MF_Default_Conn
  11. Dim Conn,User_Conn
  12. Dim Configobj,PageS,sql,MSTitle,ShowIP,Style
  13. Set Configobj=server.CreateObject (G_FS_RS)
  14. sql="select ID,Title,IPShow,IsUser,IsAut,PageSize,Style From FS_WS_Config"
  15. configobj.open sql,Conn,1,1
  16. if not configobj.eof then
  17. PageS=configobj("PageSize")
  18. MSTitle=configobj("Title")
  19. ShowIP=configobj("IPShow")
  20. Style = configobj("Style")
  21. if Style<>"" then
  22. Style = Style
  23. else
  24. Style = "3"
  25. end if
  26. end if
  27. response.Cookies("FoosunUserCookies")("UserLogin_Style_Num") = Style
  28. set configobj=nothing
  29. %>
  30. <html>
  31. <HEAD>
  32. <TITLE>FoosunCMS留言系统</TITLE>
  33. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  34. <link href="../<% = G_USER_DIR %>/images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  35. </HEAD>
  36. <script language="javascript">
  37. function goback(){
  38. history.back();
  39. }
  40. </script>
  41. <body>
  42. <%
  43. Dim BBsID,NoteID,ClassName,ClassID,Pag,NoteTilte,ShowRs,strShowErr
  44. if NoSqlHack(Request.querystring("Act"))="Edit" then
  45. NoteTilte=NoSqlHack(Request.QueryString("NoteTilte"))
  46. BBsID=NoSqlHack(Request.QueryString("BBSID"))
  47. NoteID=NoSqlHack(Request.QueryString("NoteID"))
  48. ClassName=NoSqlHack(Request.QueryString("ClassName"))
  49. ClassID=NoSqlHack(Request.QueryString("ClassID"))
  50. Pag=NoSqlHack(Request.QueryString("Page"))
  51. Set ShowRs=Conn.execute("Select ID,ClassID,User,ParentID,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser,Face,IP From FS_WS_BBS Where ID="&BBSID&"")
  52. %>
  53. <form id="WriteNote" name="WriteNote" action="?Act=save" method="post">
  54. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  55.   <tr class="hback">
  56.     <td align="left" class="xingmu" colspan="4"><img src="images/Forum_nav.gif"><a href="index.asp" class="Top_Navi"><b><%=MSTitle%></b></a> -> <a href="DefNoteList.asp?ClassID=<%=ClassID%>" class="Top_Navi"><b><%=ClassName%></b></a> -> <a href="#" onClick="goback()" class="Top_Navi"><b><%=NoteTilte%></b></a></td>
  57.   </tr>
  58.   <tr>
  59.     <td class="hback" align="right" width="20%">贴子标题:</td>
  60.     <td class="hback" >
  61.       <input type="test" name="Topic" size="20" maxlength="60" value="<%=NoteTilte%>" readonly>
  62.       &nbsp;&nbsp;</td>
  63.   </tr>
  64.   <tr class="hback">
  65.     <td class="hback" align="right" width="20%">当前表情:</td>
  66.     <td class="hback" align="left">
  67.       <table width="100%" border="0" cellspacing="0" cellpadding="0">
  68.         <tr>
  69.           <td>
  70.             <input name="FaceNum" type="radio" value="1" <%If ShowRs("Face")=1 then response.Write("Checked")%>>
  71.             <img src="Images/face1.gif" width="22" height="22"> </td>
  72.           <td>
  73.             <input type="radio" name="FaceNum" value="2" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
  74.             <img src="Images/face2.gif" width="22" height="22"> </td>
  75.           <td>
  76.             <input type="radio" name="FaceNum" value="3" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
  77.             <img src="Images/face3.gif" width="22" height="22"> </td>
  78.           <td>
  79.             <input type="radio" name="FaceNum" value="4" <%If ShowRs("Face")=4 then response.Write("Checked")%>>
  80.             <img src="Images/face4.gif" width="22" height="22"> </td>
  81.           <td>
  82.             <input type="radio" name="FaceNum" value="5" <%If ShowRs("Face")=5 then response.Write("Checked")%>>
  83.             <img src="Images/face5.gif" width="22" height="22"> </td>
  84.           <td>
  85.             <input type="radio" name="FaceNum" value="6" <%If ShowRs("Face")=6 then response.Write("Checked")%>>
  86.             <img src="Images/face6.gif" width="22" height="22"></td>
  87.           <td>
  88.             <input type="radio" name="FaceNum" value="7" <%If ShowRs("Face")=7 then response.Write("Checked")%>>
  89.             <img src="Images/face7.gif" width="22" height="22"> </td>
  90.           <td>
  91.             <input type="radio" name="FaceNum" value="8" <%If ShowRs("Face")=8 then response.Write("Checked")%>>
  92.             <img src="Images/face8.gif" width="22" height="22"> </td>
  93.           <td>
  94.             <input type="radio" name="FaceNum" value="9" <%If ShowRs("Face")=9 then response.Write("Checked")%>>
  95.             <img src="Images/face9.gif" width="22" height="22"></td>
  96.         </tr>
  97.         <tr>
  98.           <td>
  99.             <input type="radio" name="FaceNum" value="10" <%If ShowRs("Face")=10 then response.Write("Checked")%>>
  100.             <img src="Images/face10.gif" width="22" height="22"></td>
  101.           <td>
  102.             <input type="radio" name="FaceNum" value="11" <%If ShowRs("Face")=11 then response.Write("Checked")%>>
  103.             <img src="Images/face11.gif" width="22" height="22"> </td>
  104.           <td>
  105.             <input type="radio" name="FaceNum" value="12" <%If ShowRs("Face")=12 then response.Write("Checked")%>>
  106.             <img src="Images/face12.gif" width="22" height="22"></td>
  107.           <td>
  108.             <input type="radio" name="FaceNum" value="13" <%If ShowRs("Face")=13 then response.Write("Checked")%>>
  109.             <img src="Images/face13.gif" width="22" height="22"> </td>
  110.           <td>
  111.             <input type="radio" name="FaceNum" value="14" <%If ShowRs("Face")=14 then response.Write("Checked")%>>
  112.             <img src="Images/face14.gif" width="22" height="22"></td>
  113.           <td>
  114.             <input type="radio" name="FaceNum" value="15" <%If ShowRs("Face")=15 then response.Write("Checked")%>>
  115.             <img src="Images/face15.gif" width="22" height="22"></td>
  116.           <td>
  117.             <input type="radio" name="FaceNum" value="16" <%If ShowRs("Face")=16 then response.Write("Checked")%>>
  118.             <img src="Images/face16.gif" width="22" height="22"></td>
  119.           <td>
  120.             <input type="radio" name="FaceNum" value="17" <%If ShowRs("Face")=17 then response.Write("Checked")%>>
  121.             <img src="Images/face17.gif" width="22" height="22"> </td>
  122.           <td>
  123.             <input type="radio" name="FaceNum" value="18" <%If ShowRs("Face")=18 then response.Write("Checked")%>>
  124.             <img src="Images/face18.gif" width="22" height="22"> </td>
  125.         </tr>
  126.       </table>
  127.     </td>
  128.   </tr>
  129.   <tr class="hback">
  130.     <td class="hback" align="right">帖子内容:</td>
  131.     <td class="hback" valign="top" >
  132.       <textarea name="Content" cols="25" rows="8" id="Content"  style="width:80%"><%=replace(ShowRs("Body"),"<br>",chr(13)&chr(10))%></textarea>
  133.     </td>
  134.   </tr>
  135.   <tr class="hback">
  136.     <td class="hback">&nbsp;
  137.         <input type="hidden" name="ClassID" id="ClassID" value="<%=ClassID%>">
  138. <input type="hidden" name="BbsId" value="<%=ShowRs("ID")%>">
  139. <input type="hidden" name="ClassName" value="<%=ClassName%>">
  140. <input type="hidden" name="noteId" value="<%=NoteID%>">
  141. <input type="hidden" name="Page"  value="<%=Pag%>">
  142.     </td>
  143.     <td class="hback">
  144.       <input type="submit" name="submit" value="OK保存贴子">
  145.       &nbsp;&nbsp;
  146.       <input type="reset" name="reset" value=" 重  置 ">
  147.     </td>
  148.   </tr>
  149. </table>
  150. </form>
  151. <%
  152. Set ShowRs=nothing
  153. end if
  154. dim NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin,url
  155. if NoSqlHack(Request.QueryString("Act"))="save" then
  156. Set NoteRs=Server.CreateObject(G_FS_RS)
  157. ClassName=Request.form("ClassName")
  158. ClassID=Request.form("ClassID")
  159. BbsId=Request.form("BbsId")
  160. NoteID=request.forM("NoteID")
  161. Topic=NoHtmlHackInput(trim(Replace(Request.form("Topic"),"'","")))
  162. IsTop=NoHtmlHackInput(trim(Request.form("Style")))
  163. Content=replace(NoHtmlHackInput(Trim(Request.form("Content"))),chr(13)&chr(10),"<br>")
  164. IsAdmin=NoHtmlHackInput(Trim(Request.form("IsAdmin")))
  165. Face=NoHtmlHackInput(Trim(Request.Form("FaceNum")))
  166. Pag=request.form("Page")
  167. ' response.Write(ClassName)
  168. 'Response.End()
  169. if IsAdmin="" then
  170. IsAdmin="0"
  171. end if
  172. if ClassID="" then
  173. Response.write("<script>alert('参数出错!');</script>")
  174. response.end
  175. end if
  176. if Topic="" then
  177. Response.write("<script>alert('标题不能为空');</script>")
  178. Response.end
  179. end if
  180. if Content="" then
  181. Response.write("<script>alert('内容不能为空');</script>")
  182. response.end
  183. end if
  184. NoteRs.open "Select ID,ClassID,User,ParentID,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser,Face,IP From FS_WS_BBS Where ID="&BbsId&"",Conn,3,3
  185. if not Noters.eof then
  186. NoteRs("Body")=Content
  187. NoteRs("LastUpdateUser")=session("FS_UserName")
  188. NoteRs("LastUpdateDate")=now()
  189. NoteRs("Face")=Face
  190. NoteRs("IP")=Request.ServerVariables("REMOTE_ADDR")
  191. NoteRs.update
  192. end if
  193. Set NoteRs=nothing
  194. url="ShowNote.asp?ClassName="&ClassName&"&NoteID="&NoteID&"&ClassID="&ClassID&"&Page="&Pag&""
  195. 'response.End()
  196. Response.write("<script>location.href='"&url&"'</script>")
  197. Response.end
  198. end if
  199. Response.end
  200. Set Conn=nothing
  201. %>
  202. </body>
  203. </html>