contrEdit.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_Inc/Function.asp" -->
  5. <!--#include file="../../FS_Inc/Func_page.asp" -->
  6. <!--#include file="../lib/strlib.asp" -->
  7. <!--#include file="../lib/UserCheck.asp" -->
  8. <!--#include file="lib/cls_contr.asp"-->
  9. <%'Copyright (c) 2006 Foosun Inc. Code by Einstein.liu
  10. Dim str_CurrPath,action,id,contrObj
  11. Set contrObj=New cls_Contr
  12. action=trim(request.QueryString("action"))
  13. id=NoSqlHack(trim(request.QueryString("id")))
  14. if id<>"" then contrObj.getContrInfo(id)
  15. if action="" then
  16. action="add"
  17. End if
  18. str_CurrPath = Replace("/"&G_VIRTUAL_ROOT_DIR &"/"&G_USERFILES_DIR&"/"&Session("FS_UserNumber"),"//","/")
  19. %>
  20. <html xmlns="http://www.w3.org/1999/xhtml">
  21. <title>User Manage Center-网站内容管理系统</title>
  22. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  23. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  24. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  25. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  26. <head>
  27. <script language="javascript" src="../../FS_Inc/CheckJs.js"></script>
  28. <script language="javascript" src="../../FS_Inc/prototype.js"></script>
  29. <script language="javascript" src="../../FS_Inc/PublicJS.js"></script>
  30. <script language="JavaScript" type="text/javascript" src="../../Editor/FS_scripts/editor.js"></script>
  31. </head>
  32. <body>
  33. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  34. <tr>
  35. <td>
  36. <!--#include file="../top.asp" -->
  37. </td>
  38. </tr>
  39. </table>
  40. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  41. <tr class="back">
  42. <td   colspan="2" class="xingmu" height="26">
  43. <!--#include file="../Top_navi.asp" -->
  44. </td>
  45. </tr>
  46. <tr class="back">
  47. <td width="18%" valign="top" class="hback">
  48. <div align="left">
  49. <!--#include file="../menu.asp" -->
  50. </div>
  51. </td>
  52. <td width="82%" valign="top" class="hback">
  53. <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  54. <tr>
  55. <td class="hback_1"><a href="contrManage.asp">稿件管理</a> | <font color="#FF0000">编辑稿件</font></td>
  56. </tr>
  57. <tr>
  58. <td>
  59. <form name="contrForm" action="contrAction.asp?action=<%=action%>&id=<%=id%>" method="post">
  60. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  61. <tr>
  62. <td align="right" class="hback" width="15%">标题:</td>
  63. <td class="hback">
  64. <input type="text" name="txt_ContTitle" id="txt_ContTitle" value="<%=contrObj.ContTitle%>" style="width:60%"
  65. onfocus="Do.these('txt_ContTitle',function(){ return isEmpty('txt_ContTitle','span_title')})"
  66. onKeyUp="Do.these('txt_ContTitle',function(){ return isEmpty('txt_ContTitle','span_title')})"
  67. />
  68. <span id="span_title"></span></td>
  69. </tr>
  70. <tr>
  71. <td align="right" class="hback">副标题:</td>
  72. <td align="left" class="hback">
  73. <input type="text" name="txt_subTitle" style="width:60%" value="<%=contrObj.subTitle%>" onFocus="this.className='RightInput'">
  74. </td>
  75. </tr>
  76. <tr class="hback">
  77. <td align="right">正文:</td>
  78. <td aling="left">
  79. <!--编辑器开始-->
  80. <pre id="idTemporary" name="idTemporary" style="display:none"><%=Server.HTMLEncode(contrObj.ContContent)%></pre>
  81. <script language="JavaScript">
  82. <!--
  83. var FS_Edit1 = new InnovaEditor("FS_Edit1");
  84. FS_Edit1.cmdAssetManager="modalDialogShow('../../<% = G_USER_DIR %>/CommPages/SelectPic.asp?CurrPath=<% = str_CurrPath %>&f_UserNumber=<%=FS_User.UserNumber%>',670,450)";
  85. FS_Edit1.width="100%";
  86. FS_Edit1.height="400";
  87. FS_Edit1.btnFlash=true;
  88. FS_Edit1.btnMedia=true;        
  89. FS_Edit1.RENDER($("idTemporary").innerHTML);
  90. //-->
  91. </script>
  92. <textarea name="txt_content" style="display:none" ></textarea>
  93. <!--编辑器结束-->
  94. <span id="span_content"></span></td>
  95. </tr>
  96. <tr>
  97. <td align="right" class="hback">备注:</td>
  98. <td align="left" class="hback">
  99. <textarea name="txt_OtherContent" rows="5" style="width:80%" onFocus="this.className='RightInput'"><%=contrObj.OtherContent%></textarea>
  100. </td>
  101. </tr>
  102. <tr>
  103. <%
  104. Dim classRs,ClassCName,MainClassName
  105. if contrObj.ClassID<>"" then
  106. Set ClassRs=User_Conn.execute("select ClassCName from FS_ME_InfoClass where classid="&contrObj.ClassID)
  107. if not ClassRs.eof then
  108. ClassCName=ClassRs("ClassCName")
  109. Else
  110. ClassCName=""
  111. End if
  112. Else
  113. ClassCName=""
  114. End if
  115. if contrObj.MainID<>"" then
  116. Set ClassRs=Conn.execute("select ClassName from FS_NS_NewsClass where id="&contrObj.MainID)
  117. if not ClassRs.eof then
  118. MainClassName=ClassRs("ClassName")
  119. Else
  120. MainClassName=""
  121. End if
  122. Else
  123. MainClassName=""
  124. End if
  125. if isNull(classRs) then classRs.close:set classRs=nothing
  126. %>
  127. <td align="right" class="hback">信息分类:</td>
  128. <td align="left" class="hback">
  129. <input type="text" name="txt_Class" style="width:60%" readonly  value="<%=ClassCName%>"/>
  130. <input type="hidden" name="txt_ClassID" style="width:60%" value="<%=contrObj.ClassID%>">
  131. <button onClick="SelectClass()">选择分类</button>
  132. <span id="span_class"><font color="#FF0000">*</font></span></td>
  133. </tr>
  134. <tr>
  135. <td align="right" class="hback">主站分类:</td>
  136. <td align="left" class="hback">
  137. <input type="text" name="txt_mainClass" style="width:60%" readonly value="<%=MainClassName%>" />
  138. <%
  139. Dim tmpRs,Str_MainID
  140. if contrObj.MainID<>"" then
  141. Set tmpRs=Conn.execute("select Classid from FS_NS_NewsClass where id="&contrObj.MainID&"") 
  142. if not tmpRs.eof then
  143. Str_MainID=tmpRs(0)
  144. End if
  145. tmpRs.close
  146. else
  147. Str_MainID=""
  148. end if
  149. Set tmpRs=nothing
  150. %>
  151. <input type="hidden" name="txt_mainClassID" style="width:60%" value="<%=Str_MainID%>">
  152. <button onClick="SelectMainClass()">选择分类</button>
  153. <span id="span_Mainclass"><font color="#FF0000">*</font></span></td>
  154. </tr>
  155. <tr>
  156. <td align="right" class="hback">关键字:</td>
  157. <td align="left" class="hback">
  158. <textarea name="txt_KeyWords" id="txt_KeyWords" rows="5" style="width:80%" onFocus="this.className='RightInput'" onKeyUp="ReplaceDot('txt_KeyWords')"><%=contrObj.KeyWords%></textarea>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td align="right" class="hback">发布到总站:</td>
  163. <td align="left" class="hback">
  164. <p>
  165. <label>
  166. <input type="radio" name="rad_IsPublic" value="1" <%if contrObj.IsPublic="1" then Response.Write("checked")%>>
  167. 是</label>
  168. <label>
  169. <input type="radio" name="rad_IsPublic" value="0" <%if contrObj.IsPublic<>"1"  then Response.Write("checked")%>>
  170. 否</label>
  171. </p>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td align="right" class="hback">信息级:</td>
  176. <td align="left" class="hback">
  177. <select name="sel_InfoType">
  178. <option value="0" <%if contrObj.InfoType="0" then Response.Write("selected")%>>普通</option>
  179. <option value="1" <%if contrObj.InfoType="1" then Response.Write("selected")%>>优先</option>
  180. <option value="2" <%if contrObj.InfoType="2" then Response.Write("selected")%>>加急</option>
  181. </select>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td align="right" class="hback">类型:</td>
  186. <td align="left" class="hback">
  187. <select name="sel_ContSytle" id="sel_ContSytle">
  188. <option value="0" <%if contrObj.ContSytle="0" then Response.Write("selected")%>>原创</option>
  189. <option value="1" <%if contrObj.ContSytle="1" then Response.Write("selected")%>>转载</option>
  190. <option value="3" <%if contrObj.ContSytle="3" then Response.Write("selected")%>>代理</option>
  191. </select>
  192. </td>
  193. </tr>
  194. <tr>
  195. <td align="right" class="hback">锁定:</td>
  196. <td align="left" class="hback">
  197. <p>
  198. <label>
  199. <input type="radio" name="rad_IsLock" value="1" <%if contrObj.IsLock="1" then Response.Write("checked")%>>
  200. 是</label>
  201. <label>
  202. <input type="radio" name="rad_IsLock" value="0" <%if contrObj.IsLock<>"1" then Response.Write("checked")%>>
  203. 否</label>
  204. </p>
  205. </td>
  206. </tr>
  207. <tr>
  208. <td align="right" class="hback">推荐:</td>
  209. <td align="left" class="hback">
  210. <label>
  211. <input type="radio" name="rad_isTF" value="1" <%if contrObj.isTF="1" then Response.Write("checked")%>>
  212. 是</label>
  213. <label>
  214. <input type="radio" name="rad_isTF" value="0" <%if contrObj.isTF<>"1" then Response.Write("checked")%>>
  215. 否</label>
  216. </td>
  217. </tr>
  218. <tr>
  219. <td align="right" class="hback">图片:</td>
  220. <td align="left" class="hback">
  221. <input type="text" name="txt_img" id="txt_img" value="<%=contrObj.PicFile%>" style="width:60%">
  222. <button onClick="javascript:OpenWindowAndSetValue('../CommPages/SelectPic.asp?CurrPath=<% = str_CurrPath %>&f_UserNumber=<% = session("FS_UserNumber")%>',500,320,window,$('txt_img'));">选择图片</button>
  223. </td>
  224. </tr>
  225. <tr>
  226. <td align="right" class="hback">&nbsp;</td>
  227. <td align="left" class="hback">
  228. <input type="Button" name="contr_Submit" value="提交" onClick="mySubmit(this.form)">
  229. <input type="Button" name="contr_reset" value="重置" onClick="javascript:if(confirm('是否重设表单?'))$('contrForm').reset()">
  230. </td>
  231. </tr>
  232. </table>
  233. </form>
  234. </td>
  235. </tr>
  236. </table>
  237. </td>
  238. </tr>
  239. <tr class="back">
  240. <td height="20"  colspan="2" class="xingmu">
  241. <div align="left">
  242. <!--#include file="../Copyright.asp" -->
  243. </div>
  244. </td>
  245. </tr>
  246. </table>
  247. </body>
  248. </html>
  249. <%
  250. Set Fs_User = Nothing
  251. Set User_Conn=nothing
  252. Set Conn=nothing
  253. %>
  254. <script language="javascript">
  255. <!--
  256. //获得主站分类
  257. function SelectMainClass()
  258. {
  259. var ReturnValue='',TempArray=new Array();
  260. ReturnValue = OpenWindow('lib/SelectClassFrame.asp?rad'+Math.random(),400,300,window);
  261. if (ReturnValue.indexOf('***')!=-1)
  262. {
  263. TempArray = ReturnValue.split('***');
  264. $('txt_mainClassID').value=TempArray[0]
  265. $('txt_mainClass').value=TempArray[1]
  266. }
  267. }
  268. //获得分类
  269. function SelectClass()
  270. {
  271. var ReturnValue='',TempArray=new Array();
  272. ReturnValue = OpenWindow('lib/SelectMyClassFrame.asp?rad'+Math.random(),400,300,window);
  273. if (ReturnValue.indexOf('***')!=-1)
  274. {
  275. TempArray = ReturnValue.split('***');
  276. $('txt_ClassID').value=TempArray[0]
  277. $('txt_Class').value=TempArray[1]
  278. }
  279. }
  280. //提交表单
  281. function mySubmit(FormObj)
  282. {
  283. FormObj.txt_content.value=FS_Edit1.getXHTMLBody();
  284. var flag1=isEmpty('txt_ContTitle','span_title');
  285. var flag2=isEmpty('txt_Content','span_content');
  286. var flag3=isEmpty('txt_Class','span_class');
  287. var flag4=isEmpty('txt_mainClass','span_Mainclass');
  288. if(flag1&&flag2&&flag3&&flag4)
  289. {
  290. FormObj.submit();
  291. }
  292. }
  293. -->
  294. </script>
  295. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->