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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="lib/Cls_RefreshJs.asp"-->
  7. <% 'Copyright (c) 2006 Foosun Inc. Code by awen
  8. Dim Conn,FS_NS_JS_Obj,FS_NS_JS_Sql,sErrStr
  9. MF_Default_Conn
  10. 'session判断
  11. MF_Session_TF 
  12. if not MF_Check_Pop_TF("NS040") then Err_Show
  13. Dim FileID,RsSysModObj,FunClassID,Types,ScrLink,ScrNewsType ,sRootDir,str_CurrPath,db_NewsDir
  14. Dim Str_ErrorUrl,Str_ErrCodes
  15. Str_ErrorUrl=server.URLEncode("../Js_Sys_Add.asp")
  16. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  17. Set RsSysModObj = Conn.Execute("select top 1 NewsDir from FS_NS_SysParam")
  18. if not RsSysModObj.eof then 
  19. db_NewsDir = RsSysModObj(0)
  20. end if
  21. RsSysModObj.close
  22. if isnull(db_NewsDir) or db_NewsDir="" then 
  23. Str_ErrCodes=Server.URLEncode("<li>抱歉新闻系统参数的 文章系统前台目录 配置为空。无法继续。</li>")
  24. response.Redirect("lib/error.asp?ErrCodes="&Str_ErrCodes&"&ErrorUrl="&Str_ErrorUrl)
  25. response.End()
  26. end if
  27. str_CurrPath = replace(sRootDir,"//","/") &"/"& db_NewsDir
  28. str_CurrPath = Replace(str_CurrPath,"'","'")
  29. Types = "System" ''系统JS
  30. Function ClassList()
  31. Dim Rs,SelectStr
  32. Set Rs = Conn.Execute("select ClassID,ClassCName from FS_NS_NewsClass where ParentID = '0' and DelFlag=0 order by AddTime desc")
  33. do while Not Rs.Eof
  34. If Cstr(FunClassID) = Cstr(Rs("ClassID")) then
  35. SelectStr = " selected"
  36. Else
  37. SelectStr = ""
  38. End If
  39. ClassList = ClassList & "<option value="""&Rs("ClassID")&""""& SelectStr & ">" & Rs("ClassCName") & chr(10) & chr(13)
  40. ClassList = ClassList & ChildClassList(Rs("ClassID"),"")
  41. Rs.MoveNext
  42. loop
  43. Rs.Close
  44. Set Rs = Nothing
  45. End Function
  46. Function ChildClassList(ClassID,Temp)
  47. Dim TempRs,TempStr,SelectStrs
  48. Set TempRs = Conn.Execute("Select ClassID,ClassCName,ChildNum from FS_NS_NewsClass where ParentID = '" & ClassID & "' and DelFlag=0 order by AddTime desc ")
  49. TempStr = Temp & " - "
  50. do while Not TempRs.Eof
  51. If Cstr(FunClassID) = Cstr(TempRs("ClassID")) then
  52. SelectStrs = " selected"
  53. Else
  54. SelectStrs = ""
  55. End If
  56. if TempRs("ChildNum") = 0 then
  57. ChildClassList = ChildClassList & "<option value="""&TempRs("ClassID")&"""" & SelectStrs & ">" & TempStr & TempRs("ClassCName") & "</option>"& chr(10) & chr(13)
  58. else
  59. ChildClassList = ChildClassList & "<option value="""&TempRs("ClassID")&"""" & SelectStrs & ">" & TempStr & TempRs("ClassCName") & "</option>"& chr(10) & chr(13)
  60. end if
  61. ChildClassList = ChildClassList & ChildClassList(TempRs("ClassID"),TempStr)
  62. TempRs.MoveNext
  63. loop
  64. TempRs.Close
  65. Set TempRs = Nothing
  66. End Function
  67. %>
  68. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  69. <html>
  70. <head>
  71. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  72. <title>系统JS管理___Powered by foosun Inc.</title>
  73. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  74. <script language="JavaScript" src="js/Public.js"></script>
  75. </HEAD>
  76. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes  oncontextmenu="return true;">
  77. <form action="?action=add&FileID=<%=FileID%>" method="post" name="ClassJSForm">
  78. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  79.   <tr  class="hback"> 
  80.     <td class="xingmu" >系统JS管理</td>
  81.   </tr>
  82.   <tr  class="hback">
  83.     <td class="hback" ><a href="Js_Sys_manage.asp?Act=View" >管理首页</a>&nbsp;|&nbsp;
  84.       <a href="Js_Sys_Add.asp">新增</a> &nbsp;|&nbsp;
  85.       <a href="Js_Sys_manage.asp?Act=Search">查询</a>
  86. </td>
  87.   </tr>
  88. </table>
  89.   <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  90.     <tr class="hback">
  91.       <td width="15%" height="26">&nbsp;&nbsp;&nbsp;&nbsp;中文名称</td>
  92.       <td width="35%"> 
  93.         <input name="FileCName" type="text" id="FileCName" style="width:90%" value=""></td>
  94.       <td width="15%">&nbsp;&nbsp;&nbsp;&nbsp;文件名称</td>
  95.       <td width="35%"> 
  96.         <input name="FileName" type="text" id="FileName" style="width:90%" value=""></td>
  97.     </tr>
  98.     <tr class="hback">  
  99.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;栏目名称</td>
  100.       <td> 
  101. <input type="text" style="width:90%" name="ClassID" value="0" disabled>  </td>
  102.       <td>&nbsp;&nbsp;&nbsp;&nbsp;新闻类型</td>
  103.       <td> 
  104.         <select name="NewsType" style="width:90%" onChange="ChooseNewsType(this.options[this.selectedIndex].value);">
  105.           <option value="RecNews">推荐新闻</option>
  106.           <option value="MarqueeNews">滚动新闻</option>
  107.           <option value="PicNews">图片新闻</option>
  108.           <option value="NewNews">最新新闻</option>
  109.           <option value="HotNews">热点新闻</option>
  110.           <option value="ProclaimNews">公告新闻</option>
  111.         </select></td>
  112.     </tr>
  113. <tr class="hback">  
  114.       <td height="26">&nbsp;&nbsp;点击数大于</td>
  115.       <td> 
  116.         <input type="text" style="width:90% " name="setHitsValue" maxlength="4"  onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='';}">
  117.       </td>
  118.       <td colspan="2">用于热点新闻,当点击数大于多少才算热门。</td>
  119.     </tr>
  120.     <tr class="hback">  
  121.       <td height="26">&nbsp;&nbsp;&nbsp;更多链接</td>
  122.       <td> 
  123.         <select name="MoreContent" id="MoreContent" style="width:90% " onChange="ChooseLink(this.options[this.selectedIndex].value);" <%If Types = "System" then Response.Write("disabled")%>>
  124.           <option value="1">是</option>
  125.           <option value="0">否</option>
  126.         </select></td>
  127.       <td>&nbsp;&nbsp;&nbsp;&nbsp;链接字样</td>
  128.       <td> 
  129.         <input name="LinkWord" type="text" id="LinkWord" style="width:90%" value="" <%If Types = "System" then Response.Write("disabled")%>></td>
  130.     </tr>
  131.     <tr class="hback">  
  132.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;新闻数量</td>
  133.       <td> 
  134.         <input name="NewsNum" type="text" id="NewsNum" style="width:90%" value="5" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='5';}"> </td>
  135.       <td>&nbsp;&nbsp;&nbsp;&nbsp;每行数量</td>
  136.       <td> 
  137.         <input name="RowNum" type="text" id="RowNum" style="width:90%" value="80" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='80';}"> </td>
  138.     </tr>
  139.     <tr class="hback">  
  140.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;链接样式</td>
  141.       <td> 
  142.         <input name="LinkCSS" type="text" id="LinkCSS" style="width:90%" value="" <%If Types = "System" then Response.Write("disabled")%>></td>
  143.       <td>&nbsp;&nbsp;&nbsp;&nbsp;标题字数</td>
  144.       <td> 
  145.         <input name="TitleNum" type="text" id="TitleNum" style="width:90%" value="" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='';}"></td>
  146.     </tr>
  147.     <tr class="hback">  
  148.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;图片宽度</td>
  149.       <td> 
  150.         <input name="PicWidth" type="text" id="PicWidth" style="width:90%" value="100" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='100';}"></td>
  151.       <td>&nbsp;&nbsp;&nbsp;&nbsp;标题样式</td>
  152.       <td> 
  153.         <input name="TitleCSS" type="text" id="TitleCSS" style="width:90%" value=""></td>
  154.     </tr>
  155.     <tr class="hback">  
  156.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;图片高度</td>
  157.       <td> 
  158.      <input name="PicHeight" type="text" id="PicHeight" style="width:90%" value="100" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='100';}"> </td>
  159.       <td>&nbsp;&nbsp;&nbsp;&nbsp;新闻行距</td>
  160.       <td> 
  161.         <input name="RowSpace" type="text" id="RowSpace" style="width:90%" value="2" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='2';}"></td>
  162.     </tr>
  163.     <tr class="hback">  
  164.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;滚动速度</td>
  165.       <td> 
  166.         <input name="MarSpeed" type="text" id="MarSpeed" style="width:90%" value="2" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='2';}"></td>
  167.       <td>&nbsp;&nbsp;&nbsp;&nbsp;滚动方向</td>
  168.       <td> 
  169.         <select name="MarDirection" id="MarDirection" style="width:90% ">
  170.           <option value="up">向上</option>
  171.           <option value="down">向下</option>
  172.           <option value="left">向左</option>
  173.           <option value="right">向右</option>
  174.         </select></td>
  175.     </tr>
  176.     <tr class="hback">  
  177.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;公告宽度</td>
  178.       <td> 
  179.         <input name="MarWidth" type="text" id="MarWidth" style="width:90%" value="200" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='200';}"></td>
  180.       <td>&nbsp;&nbsp;&nbsp;&nbsp;公告高度</td>
  181.       <td> 
  182.         <input name="MarHeight" type="text" id="MarHeight" style="width:90%" value="25" onChange="if(/D/.test(this.value)){alert('只能输入数字');this.value='25';}"></td>
  183.     </tr>
  184.     <tr class="hback">  
  185.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;显示标题</td>
  186.       <td> 
  187.         <select name="ShowTitle" id="ShowTitle" style="width:90%">
  188.           <option value="1">是</option>
  189.           <option value="0">否</option>
  190.         </select></td>
  191.       <td>&nbsp;&nbsp;&nbsp;&nbsp;新开窗口</td>
  192.       <td> 
  193.         <select name="OpenMode" id="OpenMode" style="width:90%">
  194.           <option value="1">是</option>
  195.           <option value="0">否</option>
  196.         </select></td>
  197.     </tr>
  198.     <tr class="hback">  
  199.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;导航图片</td>
  200.       <td> 
  201.         <input name="NaviPic" type="text" id="NaviPic" style="width:60%" value="">
  202.         <input type="button" name="bnt_ChoosePic_naviPic"  value="选择图片" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<%=str_CurrPath %>',500,300,window,document.ClassJSForm.NaviPic);"></td>
  203.       <td>&nbsp;&nbsp;&nbsp;&nbsp;行间图片</td>
  204.       <td> 
  205.         <input name="RowBetween" type="text" id="RowBetween" style="width:52%" value="">
  206.         <input type="button" name="bnt_ChoosePic_rowBettween"  value="选择图片" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<%=str_CurrPath %>',500,300,window,document.ClassJSForm.RowBetween);"></td>
  207.     </tr>
  208.     <tr class="hback">  
  209.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;调用日期</td>
  210.       <td> 
  211.         <select name="DateType" id="DateType" style="width:90%">
  212.           <option value="0">调用日期类型</option>
  213.           <option value="1"><%=Year(Now)&"-"&Month(Now)&"-"&Day(Now)%></option>
  214.           <option value="2"><%=Year(Now)&"."&Month(Now)&"."&Day(Now)%></option>
  215.           <option value="3"><%=Year(Now)&"/"&Month(Now)&"/"&Day(Now)%></option>
  216.           <option value="4"><%=Month(Now)&"/"&Day(Now)&"/"&Year(Now)%></option>
  217.           <option value="5"><%=Day(Now)&"/"&Month(Now)&"/"&Year(Now)%></option>
  218.           <option value="6"><%=Month(Now)&"-"&Day(Now)&"-"&Year(Now)%></option>
  219.           <option value="7"><%=Month(Now)&"."&Day(Now)&"."&Year(Now)%></option>
  220.           <option value="8"><%=Month(Now)&"-"&Day(Now)%></option>
  221.           <option value="9"><%=Month(Now)&"/"&Day(Now)%></option>
  222.           <option value="10"><%=Month(Now)&"."&Day(Now)%></option>
  223.           <option value="11"><%=Month(Now)&"月"&Day(Now)&"日"%></option>
  224.           <option value="12"><%=day(Now)&"日"&Hour(Now)&"时"%></option>
  225.           <option value="13"><%=day(Now)&"日"&Hour(Now)&"点"%></option>
  226.           <option value="14"><%=Hour(Now)&"时"&Minute(Now)&"分"%></option>
  227.           <option value="15"><%=Hour(Now)&":"&Minute(Now)%></option>
  228.           <option value="16"><%=Year(Now)&"年"&Month(Now)&"月"&Day(Now)&"日"%></option>
  229.         </select></td>
  230.       <td>&nbsp;&nbsp;&nbsp;&nbsp;保存路径</td>
  231.       <td> 
  232.         <input name="SaveFilePath" type="text" id="SaveFilePath" style="width:52%" value="">
  233.         <INPUT type="button"  name="Submit4" value="选择路径" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPathFrame.asp?CurrPath=<%= str_CurrPath %>',300,250,window,document.ClassJSForm.SaveFilePath);document.ClassJSForm.SaveFilePath.focus();"></td>
  234.     </tr>
  235.     <tr class="hback">  
  236.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;日期样式</td>
  237.       <td> 
  238.         <input name="DateCSS" type="text" id="DateCSS" style="width:90%" value=""></td>
  239.       <td>&nbsp;&nbsp;&nbsp;&nbsp;显示栏目</td>
  240.       <td> 
  241.         <select name="ClassName" id="ClassName" style="width:90%">
  242.           <option value="1">显示</option>
  243.           <option value="0">不显示</option>
  244.         </select></td>
  245.     </tr>
  246.     <tr class="hback">  
  247.       <td height="26">&nbsp;&nbsp;&nbsp;&nbsp;调用子类</td>
  248.       <td> 
  249.         <select name="SonClass" id="SonClass" style="width:90%" <%If Types = "System" then Response.Write("disabled")%>>
  250.           <option value="1">是</option>
  251.           <option value="0">否</option>
  252.         </select></td>
  253.       <td>&nbsp;&nbsp;&nbsp;&nbsp;日期右对齐</td>
  254.       <td> 
  255.         <select name="RightDate" id="RightDate" style="width:90%">
  256.           <option value="1">是</option>
  257.           <option value="0">否</option>
  258.         </select></td>
  259.     </tr>
  260.     <tr class="hback">  
  261. <td colspan="10" align="center">
  262. <input type="submit" name="submit" value=" 保存 " onClick="Check_space()">&nbsp;&nbsp;
  263. <input type="reset" name="reset" value=" 重置 "> </td>
  264. </tr>
  265. </table>
  266. </form><p>
  267. </body>
  268. </html>
  269. <%
  270. If Request.QueryString("action") = "add" then
  271. Dim ResultStr,TempFsoObj,FileNameStr
  272. FileNameStr = NoSqlHack(Trim(request.Form("FileName")))
  273. If Request.Form("FileCName")="" then
  274. sErrStr = sErrStr & "<li>文件中文名称不能为空</li>" '文件名称不能为空或是有非法字符
  275. End If
  276. If FileNameStr="" then
  277. sErrStr = sErrStr & "<li>文件名称不能为空</li>" '文件名称不能为空或是有非法字符
  278. End If
  279. If Request.Form("SaveFilePath")="" then
  280. sErrStr = sErrStr & "<li>未指定文件保存路径</li>" '文件名称不能为空或是有非法字符
  281. End If
  282. If isnumeric(Request.Form("NewsNum"))=false then
  283. sErrStr = sErrStr & "<li>调用新闻数量必须为数字型</li>" '调用新闻数量必须为数字型
  284. End If
  285. If isnumeric(Request.Form("TitleNum"))=false then
  286. sErrStr = sErrStr & "<li>标题字数必须为数字型</li>"
  287. End If
  288. If isnumeric(Request.Form("RowNum"))=false then
  289. sErrStr = sErrStr & "<li>新闻每行排列数量必须为数字型</li>"
  290. End If
  291. If (isnumeric(Request.Form("RowSpace")))=false or (not(Request.Form("RowSpace")>=0)) then
  292. sErrStr = sErrStr & "<li>新闻行距必须为数字型</li>"
  293. End IF
  294. If Types="Class" and Request.Form("ClassID")="" then
  295. sErrStr = sErrStr & "<li>栏目ID参数传递错误</li>"  '栏目ID参数传递错误
  296. End If
  297. If Request.Form("NewsType")="PicNews" or Request.Form("NewsType")="FilterNews" then
  298. If isnumeric(Request.Form("PicWidth"))=false or isnumeric(Request.Form("PicHeight"))=false then
  299. sErrStr = sErrStr & "<li>图片规格必须为数字型</li>"
  300. End If
  301. End If
  302. If Request.Form("MoreContent")=1 then
  303. If Request.Form("LinkWord")="" then
  304. sErrStr = sErrStr & "<li>请输入链接字样</li>"
  305. End If
  306. End If
  307. If Request.Form("NewsType")="MarqueeNews" or Request.Form("NewsType")="ProclaimNews" then
  308. If isnumeric(Request.Form("MarSpeed"))=false then
  309. sErrStr = sErrStr & "<li>新闻滚动速度必须为数字型</li>"
  310. End If
  311. End If
  312. if sErrStr<>"" then 
  313. response.Redirect("lib/error.asp?ErrCodes="&server.URLEncode(sErrStr))
  314. response.End()
  315. end if
  316. Dim ClassJsAddObj,RsClassSql
  317. Set ClassJsAddObj = Server.CreateObject(G_FS_RS)
  318. RsClassSql = "Select * from FS_NS_Sysjs where FileName='"&FileNameStr&"' OR FileCName='"&NoSqlHack(Request.Form("FileCName"))&"'"
  319. response.write RsClassSql
  320. ClassJsAddObj.Open RsClassSql,Conn,3,3
  321. If ClassJsAddObj.Eof Then
  322. ClassJsAddObj.AddNew
  323. ClassJsAddObj("FileCName") = NoSqlHack(Request.Form("FileCName"))
  324. ClassJsAddObj("FileName") = FileNameStr
  325. ClassJsAddObj("ClassID") = "0"
  326. ClassJsAddObj("NewsType") = NoSqlHack(Request.Form("NewsType"))
  327. ClassJsAddObj("NewsNum") = Cint(NoSqlHack(Request.Form("NewsNum")))
  328. ClassJsAddObj("TitleNum") = Cint(NoSqlHack(Request.Form("TitleNum")))
  329. ClassJsAddObj("TitleCSS") = Cstr(NoSqlHack(Request.Form("TitleCSS")))
  330. ClassJsAddObj("RowNum") = Cint(NoSqlHack(Request.Form("RowNum")))
  331. ClassJsAddObj("NaviPic") = NoSqlHack(Request.Form("NaviPic"))
  332. ClassJsAddObj("RowBetween") = NoSqlHack(Request.Form("RowBetween"))
  333. ClassJsAddObj("FileSavePath") = Cstr(NoSqlHack(Request.Form("SaveFilePath")))
  334. ClassJsAddObj("RowSpace") = Cint(NoSqlHack(Request.Form("RowSpace")))
  335. ClassJsAddObj("DateType") = Cint(NoSqlHack(Request.Form("DateType")))
  336. ClassJsAddObj("DateCSS") = Cstr(NoSqlHack(Request.Form("DateCSS")))
  337. If Request.Form("ClassName")<>0 then
  338. ClassJsAddObj("ClassName") = 1
  339. Else
  340. ClassJsAddObj("ClassName") = 0
  341. End If
  342. If Request.Form("SonClass")<>0 then
  343. ClassJsAddObj("SonClass") = 1
  344. Else
  345. ClassJsAddObj("SonClass") = 0
  346. End If
  347. If Request.Form("RightDate")<>0 then
  348. ClassJsAddObj("RightDate") = 1
  349. Else
  350. ClassJsAddObj("RightDate") = 0
  351. End If
  352. If Request.Form("MoreContent")<>"" and isnull(Request.Form("MoreContent"))=false then
  353. ClassJsAddObj("MoreContent") = NoSqlHack(Request.Form("MoreContent"))
  354. End if
  355. If Request.Form("MoreContent")<>0 then
  356. ClassJsAddObj("LinkWord") = NoSqlHack(Request.Form("LinkWord"))
  357. ClassJsAddObj("LinkCSS") = NoSqlHack(Request.Form("LinkCSS"))
  358. End If
  359. If Request.Form("PicWidth")<>"" and isnull(Request.Form("PicWidth"))=false then
  360. ClassJsAddObj("PicWidth") = Cint(NoSqlHack(Request.Form("PicWidth")))
  361. End If
  362. If Request.Form("PicHeight")<>"" and isnull(Request.Form("PicHeight"))=false then
  363. ClassJsAddObj("PicHeight") = Cint(NoSqlHack(Request.Form("PicHeight")))
  364. End If
  365. If Request.Form("MarSpeed")<>"" and isnull(Request.Form("MarSpeed"))=false then
  366. ClassJsAddObj("MarSpeed") = Cint(NoSqlHack(Request.Form("MarSpeed")))
  367. End If
  368. If Request.Form("MarDirection")<>"" and isnull(Request.Form("MarDirection"))=false then
  369. ClassJsAddObj("MarDirection") = Cstr(NoSqlHack(Request.Form("MarDirection")))
  370. End If
  371. If Request.Form("ShowTitle")<>"" and isnull(Request.Form("ShowTitle"))=false then
  372. ClassJsAddObj("ShowTitle") = NoSqlHack(Request.Form("ShowTitle"))
  373. End If
  374. If Request.Form("OpenMode")<>1 then
  375. ClassJsAddObj("OpenMode") = 0
  376. Else
  377. ClassJsAddObj("OpenMode") = 1
  378. End If
  379. If Request.Form("MarWidth")<>"" and isnull(Request.Form("MarWidth"))=false then
  380. ClassJsAddObj("MarWidth") = NoSqlHack(Request.Form("MarWidth"))
  381. End If
  382. If Request.Form("MarHeight")<>"" and isnull(Request.Form("MarHeight"))=false then
  383. ClassJsAddObj("MarHeight") = NoSqlHack(Request.Form("MarHeight"))
  384. End If
  385. if request.Form("NewsType")="HotNews" then 
  386. if isnumeric(request.Form("setHitsValue")) then 
  387. ClassJsAddObj("MarSpeed") = NoSqlHack(request.Form("setHitsValue"))
  388. else
  389. ClassJsAddObj("MarSpeed") = 1
  390. end if
  391. end if
  392. ClassJsAddObj("AddTime") = now
  393. ClassJsAddObj("FileType") = 2
  394. ClassJsAddObj.Update
  395. Else
  396. Str_ErrCodes=Server.URLEncode("<li>你输入的中文名称或文件名称已经存在.</li>")
  397. Response.Redirect("lib/error.asp?ErrCodes="&Str_ErrCodes&"&ErrorUrl="&Str_ErrorUrl)
  398. Response.End
  399. End If
  400. ClassJsAddObj.Close
  401. Set ClassJsAddObj = Nothing
  402. ResultStr = CreateSysJS(FileNameStr)
  403. if ResultStr = true Then
  404. Str_ErrCodes=Server.URLEncode("<li>恭喜,新增成功。</li>")
  405. Response.Redirect("lib/Success.asp?ErrCodes="&Str_ErrCodes&"&ErrorUrl="&Str_ErrorUrl)
  406. else
  407. Str_ErrCodes=Server.URLEncode(ResultStr)
  408. Response.Redirect("lib/error.asp?ErrCodes="&Str_ErrCodes&"&ErrorUrl="&Str_ErrorUrl)
  409. end if
  410. Response.End
  411. End If
  412. Conn.Close  
  413. Set Conn = Nothing
  414. %>
  415. <script>
  416. function ChooseLink(Link)
  417. {
  418. if (Link!=1)
  419. {
  420.  document.ClassJSForm.LinkWord.disabled=true;
  421.  document.ClassJSForm.LinkCSS.disabled=true;
  422.  }
  423. else
  424. {
  425.  document.ClassJSForm.LinkWord.disabled=false;
  426.  document.ClassJSForm.LinkCSS.disabled=false;
  427.  }
  428.  }
  429. function ChooseNewsType(NewsType)
  430. {
  431.  if ((NewsType!='MarqueeNews')&&(NewsType!='ProclaimNews'))
  432.   {
  433.  document.ClassJSForm.MarSpeed.disabled=true;
  434.  document.ClassJSForm.MarDirection.disabled=true;
  435.  document.ClassJSForm.MarWidth.disabled=true;
  436.  document.ClassJSForm.MarHeight.disabled=true;
  437.    }
  438.   else
  439.   {
  440.  document.ClassJSForm.MarSpeed.disabled=false;
  441.  document.ClassJSForm.MarDirection.disabled=false;
  442.  document.ClassJSForm.MarWidth.disabled=false;
  443.  document.ClassJSForm.MarHeight.disabled=false;
  444.    }
  445.   if ((NewsType!='PicNews')&&(NewsType!='FilterNews'))
  446.   {
  447.  document.ClassJSForm.PicWidth.disabled=true;
  448.  document.ClassJSForm.PicHeight.disabled=true;
  449.  document.ClassJSForm.ShowTitle.disabled=true;
  450.    }
  451.   else
  452.   {
  453.  document.ClassJSForm.PicWidth.disabled=false;
  454.  document.ClassJSForm.PicHeight.disabled=false;
  455.  document.ClassJSForm.ShowTitle.disabled=false;
  456.    }
  457.  }
  458. </script>
  459. <script language="javascript">
  460. function Check_space()
  461. {
  462. if (document.ClassJSForm.NewsNum.value=="")
  463. {
  464. alert("新闻数量必须填写!")
  465. }
  466. if (document.ClassJSForm.RowNum.value=="")
  467. {
  468. alert("不要留空!")
  469. }
  470. }
  471. </script>
  472. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->