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

数据库编程

开发平台:

ASP/ASPX

  1. <!--#include file="cls_js.asp"-->
  2. <%
  3. Dim JSCodeStr,i,TempClassObj,AvailableDoMain
  4. Dim CharIndexStr
  5. GetFunctionstr
  6. Dim ListSpaces,ListSpaceStrs,Temp_ii
  7. ListSpaces =0   '左右两条新闻之间的空格字符个数 
  8. ListSpaceStrs = ""
  9. for Temp_ii = 0 to ListSpaces
  10. ListSpaceStrs = ListSpaceStrs & "&nbsp;"
  11. next 
  12. Function CreateSysJS(FileName)'栏目JS新闻列表
  13. Dim FS_JsObj , RsSysJsObj,ClassIDStr,NewsNum,MarDirection,BrStr,MarSpeed,NaviPic,RsCreateSql,RsCreateObj,DateTF,RowNum,RowSpace,TitleNum,ShowClassTF
  14. Dim RightDate,ClassID,RsClassObj,PicHeight,MarWidth,OpenMode,MarHeight,PicWidth,ShowTitle,TitleCSS,SavePath,FileNameStr,DateCSS,DateType,LinkCSS,MoreContentStr,MoreContentTF,setHitsValue
  15. Set FS_JsObj=New Cls_Js
  16. Set RsSysJsObj = Conn.Execute("Select * from FS_NS_Sysjs where FileName='"&FileName&"'")
  17. If Not RsSysJsObj.eof then
  18. ClassID = RsSysJsObj("ClassID")
  19. If RsSysJsObj("NaviPic")<>"" then
  20. NaviPic = "<img src="""  & RsSysJsObj("NaviPic") & """ border=""0"">"
  21. Else
  22. NaviPic = ""
  23. End If
  24. setHitsValue = RsSysJsObj("MarSpeed")
  25. if isnull(setHitsValue) then setHitsValue= -1
  26. NewsNum = RsSysJsObj("NewsNum")
  27. RowNum = RsSysJsObj("RowNum")
  28. RowSpace = RsSysJsObj("RowSpace")
  29. TitleNum = RsSysJsObj("TitleNum")
  30. TitleCSS = RsSysJsObj("TitleCSS")
  31. SavePath = RsSysJsObj("FileSavePath")
  32. FileNameStr = RsSysJsObj("FileName")
  33. DateCSS = RsSysJsObj("DateCSS")
  34. DateType = RsSysJsObj("DateType")
  35. MarDirection = RsSysJsObj("MarDirection")
  36. MarSpeed = RsSysJsObj("MarSpeed")
  37. PicWidth = RsSysJsObj("PicWidth")
  38. PicHeight = RsSysJsObj("PicHeight")
  39. MarWidth = RsSysJsObj("MarWidth")
  40. MarHeight = RsSysJsObj("MarHeight")
  41. If RsSysJsObj("OpenMode")=1 then
  42. OpenMode = " target=""_blank"""
  43. Else
  44. OpenMode = " target=""_self"""
  45. End If
  46. If RsSysJsObj("ShowTitle")<>0 then
  47. ShowTitle = True
  48. Else
  49. ShowTitle = false
  50. End If
  51. If RsSysJsObj("MarDirection")="left" or RsSysJsObj("MarDirection")="right" then
  52. BrStr = ""
  53. Else
  54. BrStr = "<br>"
  55. End If
  56. If RsSysJsObj("MoreContent")<>0 then
  57. MoreContentTF = True
  58. MoreContentStr = RsSysJsObj("LinkWord")
  59. LinkCSS = RsSysJsObj("LinkCSS")
  60. Else
  61. MoreContentTF = False
  62. End If
  63. If RsSysJsObj("DateType")<>0 then
  64. DateTF = true
  65. Else
  66. DateTF = false
  67. End If
  68. If RsSysJsObj("ClassName")<>0 then
  69. ShowClassTF = true
  70. Else
  71. ShowClassTF = false
  72. End If
  73. If RsSysJsObj("RightDate")<>0 then
  74. RightDate = true
  75. Else
  76. RightDate = false
  77. End If
  78. ClassIDStr = ClassID
  79. If RsSysJsObj("SonClass")=1 then
  80. Set RsClassObj = Conn.Execute("Select ClassID from FS_NS_NewsClass where ParentID='"&ClassID&"' and DelFlag=0 order by ID desc")
  81. If Not RsClassObj.eof then
  82. Do While not RsClassObj.eof
  83. ClassIDStr = ClassIDStr &"','"& RsClassObj("ClassID")
  84. RsClassObj.MoveNext
  85. Loop
  86. RsClassObj.Close
  87. Set RsClassObj = Nothing
  88. End If
  89. End If
  90. Response.write "FileName="&FileName&";type="&RsSysJsObj("NewsType")
  91. Select Case RsSysJsObj("NewsType")
  92. Case "RecNews"
  93. if RsSysJsObj("FileType")=1 then
  94. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and isLock=0 and "& CharIndexStr &"(NewsProperty,1,1)='1' order by AddTime desc" '推荐新闻
  95. else
  96. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and isLock=0 and "& CharIndexStr &"(NewsProperty,1,1)='1' order by AddTime desc" '推荐新闻
  97. end if
  98. Set RsCreateObj = Conn.Execute(RsCreateSql)
  99. If Not RsCreateObj.eof then
  100. JSCodeStr = "document.write('<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing="""&RowSpace&"""><tr>"
  101. for i=1 to NewsNum
  102.   If RsCreateObj.eof then Exit For
  103.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  104.   If DateTF = true then
  105. If ShowClassTF = true then
  106. If RightDate = true then
  107.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  108. Else
  109.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  110. End If
  111. Else
  112. If RightDate = true then
  113.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  114. Else
  115.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  116. End If
  117. End IF
  118.   Else
  119. If ShowClassTF = true then
  120.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  121. Else
  122.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  123. End If
  124.   End If
  125.   RsCreateObj.MoveNext
  126.   if i mod Cint(RowNum) = 0 or RsCreateObj.eof then
  127. if RightDate = true then
  128.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum*2&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  129. else
  130.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  131. end if
  132.   end if
  133. next 
  134. If RsSysJsObj("FileType")=1 then
  135. Dim RsTempClassObjs
  136. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  137. If RsTempClassObjs.eof then
  138. CreateSysJS = "刷新栏目已经不存在."
  139. Exit Function
  140. End If
  141. End If
  142. If RightDate = true then
  143. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  144. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  145. else
  146. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" height="&RowSpace&"></td></tr>"
  147. end if
  148. Else
  149. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  150. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  151. else
  152. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" height="&RowSpace&"></td></tr>"
  153. end if
  154. End If
  155. JSCodeStr = JSCodeStr & "</table>');"
  156. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  157. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  158. CreateSysJS = true
  159. RsCreateObj.Close 
  160. Set RsCreateObj = Nothing 
  161. Else
  162. JSCodeStr = "document.write('未查询到符合条件的新闻')"
  163. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  164. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  165. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  166. End If
  167. Case "MarqueeNews"
  168. if RsSysJsObj("FileType")=1 then
  169. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and "& CharIndexStr &"(NewsProperty,3,1)='1' and isLock=0 order by AddTime desc" '滚动新闻
  170. else
  171. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and "& CharIndexStr &"(NewsProperty,3,1)='1' and isLock=0 order by AddTime desc" '滚动新闻
  172. end If
  173. Response.write RsCreateSql
  174. Set RsCreateObj = Conn.Execute(RsCreateSql)
  175. If Not RsCreateObj.eof then
  176. JSCodeStr = "document.write('<marquee onmouseout=start() onmouseover=stop() Width="&MarWidth&" Height="&MarHeight&" scrolldelay=80 direction="&MarDirection&" scrollamount="& CInt(MarSpeed) &">"
  177. for i=1 to NewsNum
  178.   If RsCreateObj.eof then Exit For
  179.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  180.   If DateTF = true then
  181. If ShowClassTF = true then
  182.   JSCodeStr = JSCodeStr & NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&BrStr
  183. Else
  184.   JSCodeStr = JSCodeStr & NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&BrStr
  185. End IF
  186.   Else
  187. If ShowClassTF = true then
  188.   JSCodeStr = JSCodeStr & NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&BrStr
  189. Else
  190.   JSCodeStr = JSCodeStr & NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&BrStr
  191. End If
  192.   End If
  193.   RsCreateObj.MoveNext
  194. next 
  195. If RsSysJsObj("FileType")=1 then
  196. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  197. If RsTempClassObjs.eof then
  198. CreateSysJS = "刷新栏目已经不存在."
  199. Exit Function
  200. End If
  201. End If
  202. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  203. JSCodeStr = JSCodeStr &"<a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs
  204. end if
  205. JSCodeStr = JSCodeStr & "</marquee>');"
  206. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  207. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  208. CreateSysJS = true
  209. RsCreateObj.Close 
  210. Set RsCreateObj = Nothing 
  211. Else
  212. JSCodeStr = "document.write('未查询到符合条件的新闻')"
  213. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  214. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  215. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  216. End If
  217. Case "PicNews"
  218. if RsSysJsObj("FileType")=1 then
  219. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and isPicNews=1 and isLock=0 order by AddTime desc" '图片新闻
  220. else
  221. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and isPicNews=1 and isLock=0 order by AddTime desc" '图片新闻
  222. end if
  223. Set RsCreateObj = Conn.Execute(RsCreateSql)
  224. If Not RsCreateObj.eof then
  225. JSCodeStr = "document.write('<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing="""&RowSpace&"""><tr>"
  226. Dim DoMainStr
  227. for i=1 to NewsNum
  228.   If RsCreateObj.eof then Exit For
  229.   If LCase(Left(RsCreateObj("NewsSmallPicFile"),4))="http" Then
  230.    DoMainStr = ""
  231.   Else
  232.    DoMainStr = AvailableDoMain
  233.   End If
  234.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  235.   If DateTF = true then
  236. If ShowClassTF = true then
  237. If RightDate = true then
  238. If ShowTitle = True then
  239.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><table border=0 cellspacing=0 cellpadding=0><tr><td colspan=2 align=center valign=middle><a href="&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td></tr>"
  240.   JSCodeStr = JSCodeStr &"<tr><td align=center>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span></div></td></tr></table></td>"
  241. Else
  242.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><a href=" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td>"
  243. End If
  244. Else
  245. If ShowTitle = True then
  246.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><table border=0 cellspacing=0 cellpadding=0><tr><td colspan=2 align=center valign=middle><a href="&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td></tr>"
  247.   JSCodeStr = JSCodeStr &"<tr><td align=center>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span></td></tr></table></td>"
  248. Else
  249.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><a href=" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td>"
  250. End If
  251. End If
  252. Else
  253. If RightDate = true then
  254. If ShowTitle = True then
  255.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><table border=0 cellspacing=0 cellpadding=0><tr><td colspan=2 align=center valign=middle><a href="&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td></tr>"
  256.   JSCodeStr = JSCodeStr &"<tr><td align=center>"& NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span></div></td></tr></table></td>"
  257. Else
  258.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><a href=" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td>"
  259. End If
  260. Else
  261. If ShowTitle = True then
  262.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><table border=0 cellspacing=0 cellpadding=0><tr><td colspan=2 align=center valign=middle><a href="&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td></tr>"
  263.   JSCodeStr = JSCodeStr &"<tr><td align=center>"& NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span></td></tr></table></td>"
  264. Else
  265.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><a href=" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & OpenMode & "><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td>"
  266. End If
  267. End If
  268. End IF
  269.   Else
  270. If ShowClassTF = true then
  271. If ShowTitle = True then
  272.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><table border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle><a href=" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & OpenMode & "><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td></tr>"
  273.   JSCodeStr = JSCodeStr &"<tr><td align=center>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td></tr></table></td>"
  274. Else
  275.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><a href=" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & OpenMode & "><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0></a></td>"
  276. End If
  277. Else
  278. If ShowTitle = True then
  279.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><table border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle><a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0 ></a></td></tr>"
  280.   JSCodeStr = JSCodeStr &"<tr><td align=center>"& NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & """" & OpenMode & ">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td></tr></table></td>"
  281. Else
  282.   JSCodeStr = JSCodeStr &"<td align=center valign=middle><a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&"><img src="&DoMainStr&RsCreateObj("NewsSmallPicFile")&" height="&PicHeight&" width="&PicWidth&" border=0 ></a></td>"
  283. End If
  284. End If
  285.   End If
  286.   RsCreateObj.MoveNext
  287.   if i mod Cint(RowNum) = 0 or RsCreateObj.eof then
  288. if RightDate = true then
  289.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum*2&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  290. else
  291.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  292. end if
  293.   end if
  294. next 
  295. If RsSysJsObj("FileType")=1 then
  296. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  297. If RsTempClassObjs.eof then
  298. CreateSysJS = "刷新栏目已经不存在."
  299. Exit Function
  300. End If
  301. End If
  302. If RightDate = true then
  303. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  304. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  305. else
  306. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" height="&RowSpace&"></td></tr>"
  307. end if
  308. Else
  309. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  310. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  311. else
  312. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" height="&RowSpace&"></td></tr>"
  313. end if
  314. End If
  315. JSCodeStr = JSCodeStr & "</table>');"
  316. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  317. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  318. CreateSysJS = true
  319. RsCreateObj.Close 
  320. Set RsCreateObj = Nothing 
  321. Else
  322. JSCodeStr = "document.write('未查询到符合条件的新闻.')"
  323. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  324. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  325. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  326. End If
  327. Case "NewNews"
  328. if RsSysJsObj("FileType")=1 then
  329. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and isLock=0 order by AddTime desc" '最新新闻
  330. else
  331. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and isLock=0 order by AddTime desc" '最新新闻
  332. end if
  333. Set RsCreateObj = Conn.Execute(RsCreateSql)
  334. If Not RsCreateObj.eof then
  335. JSCodeStr = "document.write('<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing="""&RowSpace&"""><tr>"
  336. for i=1 to NewsNum
  337.   If RsCreateObj.eof then Exit For
  338.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  339.   If DateTF = true then
  340. If ShowClassTF = true then
  341. If RightDate = true then
  342.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  343. Else
  344.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  345. End If
  346. Else
  347. If RightDate = true then
  348.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  349. Else
  350.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  351. End If
  352. End IF
  353.   Else
  354. If ShowClassTF = true then
  355.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  356. Else
  357.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  358. End If
  359.   End If
  360.   RsCreateObj.MoveNext
  361.   if i mod Cint(RowNum) = 0 or RsCreateObj.eof then
  362. if RightDate = true then
  363.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum*2&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  364. else
  365.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  366. end if
  367.   end if
  368. next 
  369. If RsSysJsObj("FileType")=1 then
  370. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  371. If RsTempClassObjs.eof then
  372. CreateSysJS = "刷新栏目已经不存在."
  373. Exit Function
  374. End If
  375. End If
  376. If RightDate = true then
  377. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  378. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" align=Right><a class="""&LinkCSS&""" href="""&GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  379. else
  380. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" height="&RowSpace&"></td></tr>"
  381. end if
  382. Else
  383. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  384. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  385. else
  386. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" height="&RowSpace&"></td></tr>"
  387. end if
  388. End If
  389. JSCodeStr = JSCodeStr & "</table>');"
  390. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  391. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  392. CreateSysJS = true
  393. RsCreateObj.Close 
  394. Set RsCreateObj = Nothing 
  395. Else
  396. JSCodeStr = "document.write('未查询到符合条件的新闻')"
  397. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  398. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  399. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  400. End If
  401. Case "HotNews"
  402. if RsSysJsObj("FileType")=1 then
  403. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and Hits>"&setHitsValue&" and isLock=0 order by Hits desc,ID DESC" '热点新闻
  404. else
  405. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and isLock=0 and Hits>"&setHitsValue&" order by Hits desc,ID DESC" '热点新闻
  406. end If
  407. Set RsCreateObj = Conn.Execute(RsCreateSql)
  408. If Not RsCreateObj.eof then
  409. JSCodeStr = "document.write('<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing="""&RowSpace&"""><tr>"
  410. for i=1 to NewsNum
  411.   If RsCreateObj.eof then Exit For
  412.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  413.   If DateTF = true then
  414. If ShowClassTF = true then
  415. If RightDate = true then
  416.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  417. Else
  418.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  419. End If
  420. Else
  421. If RightDate = true then
  422.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  423. Else
  424.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  425. End If
  426. End IF
  427.   Else
  428. If ShowClassTF = true then
  429.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  430. Else
  431.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  432. End If
  433.   End If
  434.   RsCreateObj.MoveNext
  435.   if i mod Cint(RowNum) = 0 or RsCreateObj.eof then
  436. if RightDate = true then
  437.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum*2&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  438. else
  439.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  440. end if
  441.   end if
  442. next 
  443. If RsSysJsObj("FileType")=1 then
  444. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  445. If RsTempClassObjs.eof then
  446. CreateSysJS = "刷新栏目已经不存在."
  447. Exit Function
  448. End If
  449. End If
  450. If RightDate = true then
  451. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  452. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) &""">"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  453. else
  454. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" height="&RowSpace&"></td></tr>"
  455. end if
  456. Else
  457. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  458. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" align=Right><a class="""&LinkCSS&""" href=""" & GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  459. else
  460. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" height="&RowSpace&"></td></tr>"
  461. end if
  462. End If
  463. JSCodeStr = JSCodeStr & "</table>');"
  464. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  465. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  466. CreateSysJS = true
  467. RsCreateObj.Close 
  468. Set RsCreateObj = Nothing 
  469. Else
  470. JSCodeStr = "document.write('未查询到符合条件的新闻')"
  471. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  472. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  473. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  474. End If
  475. Case "ProclaimNews"
  476. if RsSysJsObj("FileType")=1 then
  477. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and "& CharIndexStr &"(NewsProperty,19,1)='1' and isLock=0 order by AddTime desc" '公告新闻
  478. else
  479. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and "& CharIndexStr &"(NewsProperty,19,1)='1' and isLock=0 order by AddTime desc" '公告新闻
  480. end if
  481. Set RsCreateObj = Conn.Execute(RsCreateSql)
  482. If Not RsCreateObj.eof then
  483. JSCodeStr = "document.write('<marquee onmouseout=start() onmouseover=stop() Width="&MarWidth&" Height="&MarHeight&"  scrolldelay=80 direction="&MarDirection&" scrollamount="& CInt(MarSpeed) &"><font color=red>【公告】</font>"&BrStr
  484. for i=1 to NewsNum
  485.   If RsCreateObj.eof then Exit For
  486.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  487.   If DateTF = true then
  488. If ShowClassTF = true then
  489. If RsCreateObj("IsURL") <> 1 then
  490.   JSCodeStr = JSCodeStr & NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""& FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&BrStr
  491.   JSCodeStr = JSCodeStr & ListSpaceStrs & Left(Replace(Replace(Lose_Html(RsCreateObj("Content")),chr(13) & chr(10),""),"&nbsp;",""),100) & "..." & ListSpaceStrs&BrStr
  492. Else
  493.   JSCodeStr = JSCodeStr & NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&RsCreateObj("HeadNewsPath")&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&BrStr
  494. End If
  495. Else
  496. If RsCreateObj("IsURL") <> 1 then
  497.   JSCodeStr = JSCodeStr & NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&BrStr
  498.   JSCodeStr = JSCodeStr & ListSpaceStrs & Left(Replace(Replace(Lose_Html(RsCreateObj("Content")),chr(13) & chr(10),""),"&nbsp;",""),100) & "..." & ListSpaceStrs&BrStr
  499. Else
  500.   JSCodeStr = JSCodeStr & NaviPic &"<a class="""&TitleCSS&""" href="""&RsCreateObj("HeadNewsPath")&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&BrStr
  501. End If
  502. End IF
  503.   Else
  504. If ShowClassTF = true then
  505. If RsCreateObj("IsURL") <> 1 then
  506.   JSCodeStr = JSCodeStr & NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&BrStr
  507.   JSCodeStr = JSCodeStr & ListSpaceStrs & Left(Replace(Replace(Lose_Html(RsCreateObj("Content")),chr(13) & chr(10),""),"&nbsp;",""),100) & "..." & ListSpaceStrs&BrStr
  508. Else
  509.   JSCodeStr = JSCodeStr & NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&RsCreateObj("HeadNewsPath")&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&BrStr
  510. End If
  511. Else
  512. If RsCreateObj("IsURL") <> 1 then
  513.   JSCodeStr = JSCodeStr & NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&BrStr
  514.   JSCodeStr = JSCodeStr & ListSpaceStrs & Left(Replace(Replace(Lose_Html(RsCreateObj("Content")),chr(13) & chr(10),""),"&nbsp;",""),100) & "..." & ListSpaceStrs&BrStr
  515. Else
  516.   JSCodeStr = JSCodeStr & NaviPic &"<a class="""&TitleCSS&""" href="""&RsCreateObj("HeadNewsPath")&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&BrStr
  517. End If
  518. End If
  519.   End If
  520.   RsCreateObj.MoveNext
  521. next 
  522. If RsSysJsObj("FileType")=1 then
  523. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  524. If RsTempClassObjs.eof then
  525. CreateSysJS = "刷新栏目已经不存在."
  526. Exit Function
  527. End If
  528. End If
  529. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  530. JSCodeStr = JSCodeStr &"<a class="""&LinkCSS&""" href="""&GetOneClassLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName"))&""">"& MoreContentStr&"</a>"&ListSpaceStrs
  531. end if
  532. JSCodeStr = JSCodeStr & "</marquee>');"
  533. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  534. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  535. CreateSysJS = true
  536. RsCreateObj.Close 
  537. Set RsCreateObj = Nothing 
  538. Else
  539. JSCodeStr = "document.write('未查询到符合条件的新闻')"
  540. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  541. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  542. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  543. End If
  544. Case Else 
  545. if RsSysJsObj("FileType")=1 then
  546. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where ClassID in ('"&ClassIDStr&"') and isRecyle=0 and isLock=0 order by AddTime desc" '最新新闻
  547. else
  548. RsCreateSql = "Select top "&NewsNum&" * From FS_NS_News where isRecyle=0 and isLock=0 order by AddTime desc" '最新新闻
  549. end if
  550. Set RsCreateObj = Conn.Execute(RsCreateSql)
  551. If Not RsCreateObj.eof then
  552. JSCodeStr = "document.write('<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing="""&RowSpace&"""><tr>"
  553. for i=1 to NewsNum
  554.   If RsCreateObj.eof then Exit For
  555.   Set TempClassObj = Conn.Execute("Select ClassEName,ClassName,SavePath from FS_NS_NewsClass where ClassID='"&RsCreateObj("ClassID")&"'")
  556.   If DateTF = true then
  557. If ShowClassTF = true then
  558. If RightDate = true then
  559.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) & """" & OpenMode & ">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  560. Else
  561.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  562. End If
  563. Else
  564. If RightDate = true then
  565.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID")) &""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a></td><td><div align=Right><Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</div></td>"
  566. Else
  567.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;<Span class="""&DateCSS&""">"&FS_JsObj.DateFormat(RsCreateObj("AddTime"),""&DateType&"")&"</Span>"&ListSpaceStrs&"</td>"
  568. End If
  569. End IF
  570.   Else
  571. If ShowClassTF = true then
  572.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"["&TempClassObj("ClassName")&"]"&"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  573. Else
  574.   JSCodeStr = JSCodeStr &"<td>"& NaviPic &"<a class="""&TitleCSS&""" href="""&FS_JsObj.GetOneNewsLinkURL(RsCreateObj("NewsID"))&""""&OpenMode&">"&FS_JsObj.GotTopic(Lose_Html(RsCreateObj("NewsTitle")),TitleNum)&"</a>&nbsp;"&ListSpaceStrs&"</td>"
  575. End If
  576.   End If
  577.   RsCreateObj.MoveNext
  578.   if i mod Cint(RowNum) = 0 or RsCreateObj.eof then
  579. if RightDate = true then
  580.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum*2&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  581. else
  582.   JSCodeStr = JSCodeStr &"</tr><tr><td colspan="""&RowNum&""" height=""1"" background="""  & RsSysJsObj("RowBetween")&"""></td></tr><tr>"
  583. end if
  584.   end if
  585. next 
  586. If RsSysJsObj("FileType")=1 then
  587. Set RsTempClassObjs = Conn.Execute("Select SavePath,ClassEName,FileExtName from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  588. If RsTempClassObjs.eof then
  589. CreateSysJS = "刷新栏目已经不存在."
  590. Exit Function
  591. End If
  592. End If
  593. If RightDate = true then
  594. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  595. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" align=Right><a class="""&LinkCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) & """>"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  596. else
  597. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum*2&""" height="&RowSpace&"></td></tr>"
  598. end if
  599. Else
  600. if RsSysJsObj("FileType")=1 and MoreContentTF=True then
  601. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" align=Right><a class="""&LinkCSS&""" href=""" & FS_JsObj.GetOneNewsLinkURL(RsTempClassObjs("ClassEName"),RsTempClassObjs("SavePath"),RsTempClassObjs("FileExtName")) &""">"& MoreContentStr&"</a>"&ListSpaceStrs&"</td></tr>"
  602. else
  603. JSCodeStr = JSCodeStr &"<tr><td colspan="""&RowNum&""" height="&RowSpace&"></td></tr>"
  604. end if
  605. End If
  606. JSCodeStr = JSCodeStr & "</table>');"
  607. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  608. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  609. CreateSysJS = true
  610. RsCreateObj.Close 
  611. Set RsCreateObj = Nothing 
  612. Else
  613. JSCodeStr = "document.write('未查询到符合条件的新闻')"
  614. WriteFile SavePath,FileNameStr,JSCodeStr '写文件
  615. Conn.Execute("Update FS_NS_Sysjs Set AddTime='"&Now()&"' where FileName='"&FileName&"'")
  616. CreateSysJS = "文件添加或修改成功.<br />但未找到符合条件的新闻,建议您稍后再试."
  617. End If
  618. End Select
  619. Else
  620. CreateSysJS = "参数传递错误."
  621. End If
  622. set FS_JsObj=nothing
  623. RsSysJsObj.Close
  624. Set RsSysJsObj = Nothing
  625. End Function
  626. Function WriteFile(SaveFilePath,FileNameStr,JSCodeStr)
  627. 'On Error ReSume Next
  628. Dim MyFile,CrHNJS
  629. Set MyFile=Server.CreateObject(G_FS_FSO)
  630. If MyFile.FolderExists(Server.MapPath(SaveFilePath))=false then
  631. MyFile.CreateFolder(Server.MapPath(SaveFilePath))
  632. End If
  633. If MyFile.FileExists(Server.MapPath(SaveFilePath)&"/"& FileNameStr &".js") then
  634. MyFile.DeleteFile(Server.MapPath(SaveFilePath)&"/"& FileNameStr &".js")
  635. End if
  636. Set CrHNJS=MyFile.CreateTextFile(Server.MapPath( SaveFilePath) &"/"& FileNameStr &".js")
  637. CrHNJS.write JSCodeStr
  638. Set MyFile=nothing
  639. End Function
  640. %>