Admin_Create_Soft.asp
Upload User: skcctv
Upload Date: 2014-12-17
Package Size: 3960k
Code Size: 29k
Category:

Other systems

Development Platform:

ASP/ASPX

  1. <!--#include file="../Conn.asp"-->
  2. <!--#include file="../Inc/Cl_Const.asp"-->
  3. <!--#include file="../Inc/Cl_Function_Public.asp"-->
  4. <!--#include file="../Inc/Cl_Function_Article.asp"-->
  5. <!--#include file="../Inc/Cl_Function_Soft.asp"-->
  6. <!--#include file="../Inc/Cl_Function_Photo.asp"-->
  7. <!--#include file="../Inc/Cl_Function_Movie.asp"-->
  8. <!--#include file="../Inc/Cl_Function_Product.asp"-->
  9. <!--#include file="../Inc/Cl_ClsUbb.asp"-->
  10. <!--#include file="Inc/Function.asp"-->
  11. <%
  12. Dim ChannelID
  13. ChannelID = Cl.GetClng(Request("ChannelID"))
  14. Cl.Get_ChannelSetting(ChannelID)
  15. Dim Action,CreateType,apn
  16. Dim m,Fso,Make,MakeData,strFileUrl,AllMakeNum
  17. Dim RsMake,TempClassID,SQLCreate,TotalPageNum
  18. Dim sInfoFileName
  19. if Cl.ChkIsOuter then
  20. Call Cl.OutErr(0,"<p align=center><font color='red'>对不起,为了系统安全,不允许直接或从外部链接地址访问本系统的后台管理页面。</font></p>")
  21. end if
  22. if ChannelID=0 then Cl.ShowErr("参数错误!")
  23. if Not Cl.ChkAdminLogin then Cl.ShowErr("<li>您未登录或者您无此操作权限!</li>")
  24. if Not Cl.TrueChannelPurview(3,ChannelID) then Cl.ShowErr("<br /><li>您无此操作权限!</li>")
  25. Cl.Web_Setting(0)= "No"
  26. CreateHtmlIng = True
  27. action = ","&Lcase(Trim(Request("action")))&","
  28. CreateType = Trim(Request("CreateType"))
  29. Header
  30. if Instr(action,",createindex,")=0 and Instr(action,",createwebindex,")=0 and Instr(action,",createclass,")=0 and Instr(action,",createspecial,")=0 and Instr(action,",createupdate,")=0 and Instr(action,",createelite,")=0 and Instr(action,",createhot,")=0 and Instr(action,",createinfo,")=0 and Instr(action,",createinfoall,")=0 and Instr(action,",delinfohtml,")=0 and Instr(action,",delinfohtmlall,")=0 then
  31. call ShowCreateMain()
  32. Else
  33. Server.ScriptTimeOut=999999
  34. apn=0
  35. ShowCreateWindow "请稍候......",Cl.ScriptName & "?ChannelID=" & ChannelID
  36. On Error Resume Next
  37. Set Fso = CreateObject(Trim(Cl.Web_Info(13)))
  38. If 0 <> Err Then
  39. RefreshHtml2 "txt1","<font color=#ff0033>生成"&Cl.ChannelItemName&"栏目失败,请检查你的服务器是否有FSO(FileSystemObject)!</font>"
  40. Response.end
  41. End if
  42. On Error GoTo 0
  43. OpenConn
  44. if Instr(action,",delinfohtml,")>0 then Del_Soft_Soft(1)
  45. if Instr(action,",delinfohtmlall,")>0 then Del_Soft_Soft(0)
  46. '如未启用HTML功能,则……
  47. if Clng(Cl.IsCreateHtml)=0 then
  48. RefreshHtml2 "txt1","<font color=#ff0033>此频道未开启HTML生成!请先在频道管理中开启后操作!</font>"
  49. Response.end
  50. end if
  51. '先生成内容页
  52. if Instr(action,",createinfo,")>0 then Create_Soft_Soft(1)
  53. if Instr(action,",createinfoall,")>0 then Create_Soft_Soft(0)
  54. '再至栏目
  55. if Instr(action,",createclass,")>0 then Create_Soft_Class
  56. if Instr(action,",createspecial,")>0 then Create_Soft_Special
  57. if Instr(action,",createupdate,")>0 then Create_Soft_Update
  58. if Instr(action,",createelite,")>0 then Create_Soft_Elite
  59. if Instr(action,",createhot,")>0 then Create_Soft_Hot
  60. '最后才到首页
  61. if Instr(action,",createindex,")>0 then Create_Soft_Index
  62. RefreshHtml "所有页面生成完毕,本次共生成了 <font color=red>"&apn&"</font> 个页面!",1,1
  63. Set Fso=Nothing
  64. Cl.SaveAdminLog
  65. if Instr(action,",createwebindex,")>0 then Response.write "<iframe width='100%' height='100' frameborder='0' src='Admin_Create_Index.asp' name='Make2'></iframe>"
  66. end if
  67. Response.Write "</body>" & Vbcrlf & "</html>"
  68. CloseAllObj
  69. Sub ShowCreateMain()
  70. %>
  71. <script language="JavaScript" src="../inc/Js/selectdate.js"></script>
  72. <table border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  73. <tr><td class="title" align="center"><%=Cl.ChannelItemName%>生成管理</td></tr>
  74. <tr><td class="tdbg" align="center"><font color=red><b>生成HTML的先后顺序应为:先生成内容页-->再生成栏目列表-->再到频道首页-->网站首页</b></font></td></tr>
  75. <tr><td align="center" class="tdbg">
  76. <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> 
  77. <tr><td height="40" align="center">
  78. <form name="form" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>"><br />
  79. <input name="Action" type="hidden" id="Action" value="CreateIndex">
  80. <input name="submit" type="submit" id="submit" value=" 生成<%=Cl.ChannelItemName%>首页 ">
  81. </form></td>
  82. <td align="center">
  83. <form name="form" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>"><br />
  84. <input name="Action" type="hidden" id="Action" value="CreateClass">
  85. <input name="submit" type="submit" id="submit" value=" 生成<%=Cl.ChannelItemName%>栏目 ">
  86. </form></td>
  87. <td align="center">
  88. <form name="form" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>"><br />
  89. <input name="Action" type="hidden" id="Action" value="CreateSpecial">
  90. <input name="submit" type="submit" id="submit" value=" 生成专题列表 ">
  91. </form></td></tr>
  92. </table>
  93. <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> 
  94. <tr><td height="40" align="center">
  95. <form name="form" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>"><br />
  96. <input name="Action" type="hidden" id="Action" value="CreateUpdate">
  97. <input name="submit" type="submit" id="submit" value=" 生成更新列表 ">
  98. </form></td>
  99. <td align="center">
  100. <form name="form" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>"><br />
  101. <input name="Action" type="hidden" id="Action" value="CreateElite">
  102. <input name="submit" type="submit" id="submit" value=" 生成推荐列表 ">
  103. </form></td>
  104. <td align="center">
  105. <form name="form" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>"><br />
  106. <input name="Action" type="hidden" id="Action" value="CreateHot">
  107. <input name="submit" type="submit" id="submit" value=" 生成热门列表 ">
  108. </form></td></tr>
  109. </table></td>
  110. </tr>
  111. </table>
  112. <br />
  113. <table border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  114. <tr>    <td class="title" align="center" ColSpan=2><%=Cl.ChannelItemName%>内容页生成操作</td>  </tr>
  115. <tr>
  116. <td class="tdbg" width="210" align="center"><b>按栏目生成:</b>
  117. <form name="formclass" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  118. <select name="ClassID" size="2" multiple style="height:300px;width:200px;">
  119.           <%=ShowClass_Option(ChannelID,0,0,3)%> 
  120.         </select><br /><font color='red'>提示:</font>可以按住“Shift”<br />或“Ctrl”键进行多个栏目的选择<br /><input name="Action" type="hidden" id="Action" value="CreateInfo">
  121. <input name="submit" type="submit" id="submit" value="生成列表&gt;&gt;" onClick="document.formclass.Action.value='CreateClass';">
  122. <input name="submit" type="submit" id="submit" value="生成内容&gt;&gt;">
  123. </form></td>
  124. <td class="tdbg">
  125. <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> 
  126. <tr><td>
  127. <form name="form4" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  128. 生成最新 <input name="TopNew" id="TopNew" value="50" size=8 maxlength="10"> <%=Cl.ChannelItemUnit&Cl.ChannelItemName%>&nbsp;
  129. <input name="Action" type="hidden" id="Action" value="CreateInfoAll">
  130. <input name="CreateType" type="hidden" id="CreateType" value="2">
  131. <input name="submit" type="submit" id="submit" value="开始生成&gt;&gt;">            </form></td>
  132. </tr>
  133. <tr><td>
  134. <form name="form5" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  135. 生成更新时间为 <input name="BeginDate" type="text" id="BeginDate" size=10 maxlength="20" onfocus="show_cele_date(BeginDate,'','',BeginDate)"> 到 <input name="EndDate" type="text" id="EndDate" size=10 maxlength="20" onfocus="show_cele_date(EndDate,'','',EndDate)"> 的<%=Cl.ChannelItemName%>
  136. <input name="Action" type="hidden" id="Action" value="CreateInfoAll">
  137. <input name="CreateType" type="hidden" id="CreateType" value="3">
  138. <input name="submit" type="submit" id="submit" value="开始生成&gt;&gt;">
  139. </form></td>
  140. </tr>
  141. <tr><td>
  142. <form name="form6" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  143. 生成ID号为 <input name="BeginID" type="text" id="BeginID" value="1" size=8 maxlength="10"> 到 <input name="EndID" type="text" id="EndID" value="100" size=8 maxlength="10"> 的<%=Cl.ChannelItemName%>
  144. <input name="Action" type="hidden" id="Action" value="CreateInfoAll">
  145. <input name="CreateType" type="hidden" id="CreateType" value="4">
  146. <input name="submit" type="submit" id="submit" value="开始生成&gt;&gt;">
  147. </form></td>
  148. </tr>
  149. <tr><td>
  150. <form name="form1" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  151. 生成指定ID的<%=Cl.ChannelItemName%>(多个ID可用逗号隔开):<br />&nbsp;&nbsp;<input name="InfoID" type="text" id="InfoID" value="1,3,5,7,9" size="50">
  152. <input name="Action" type="hidden" id="Action" value="CreateInfo">
  153. <input name="submit" type="submit" id="submit" value="开始生成&gt;&gt;">
  154. </form></td>
  155. </tr>
  156. <tr><td>
  157. <form name="form1" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  158. 生成所有已审核的<%=Cl.ChannelItemName%>:<input name="Action" type="hidden" id="Action" value="CreateInfoAll">
  159. <input name="submit" type="submit" id="submit" value="开始生成&gt;&gt;">
  160. </form></td>
  161. </tr>
  162. <tr><td>&nbsp;</td></tr>
  163. <tr><td>
  164. <form name="form1" method="post" action="Admin_Create_Soft.asp?ChannelID=<%=ChannelID%>">
  165. 删除所有已生成的<%=Cl.ChannelItemName%>HTML:<input name="Action" type="hidden" id="Action" value="DelInfoHTMLAll">
  166. <input name="submit" type="submit" id="submit" value="开始删除&gt;&gt;">
  167. </form></td>
  168. </tr>
  169. </table></td></tr>
  170. </table>
  171. <%
  172. End Sub
  173. Sub Create_Soft_Index()
  174. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&"首页,请稍候......</font>"
  175. InfoID=0 : ClassID=0
  176. Soft_Setting
  177. Cl.Path = CurrentPath & " &gt;&gt; 首页"
  178. If CLng(Cl.Channel.selectSingleNode("@index_projectid").text)>0 Then
  179. Template.ProjectID = CLng(Cl.Channel.selectSingleNode("@index_projectid").text)
  180. Template.TemplateID = CLng(Cl.Channel.selectSingleNode("@index_templateid").text)
  181. Template.CssID = CLng(Cl.Channel.selectSingleNode("@index_cssid").text)
  182. End if
  183. Call Template.Load(2,1)
  184. TempStr = Template.Html
  185. Dim strMakeData
  186. strMakeData=Template.ReplaceAllFlag(TempStr)
  187. Cl.Load_ChannelSetting(ChannelID)
  188. Cl.MakeHtml strMakeData,Cl.WebDir & Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Index." & Cl.CreateFileExt
  189. RefreshHtml ""&Cl.ChannelItemName&"首页("&Cl.WebDir & Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Index." & Cl.CreateFileExt&")生成完毕!",1,1
  190. RefreshHtml2 "txt1","<font color=blue>恭喜您,"&Cl.ChannelItemName&"首页生成完毕!</font>"
  191. apn=apn+1
  192. End Sub
  193. Sub Create_Soft_Class()
  194. TempClassID=Trim(Request("ClassID"))
  195. SQLCreate="Select ClassID from Cl_Class where ChannelID="&ChannelID&" and IsOuter=0"
  196. if TempClassID<>"" and IsNumeric(Replace(Replace(TempClassID,",","")," ","")) then
  197. TempClassID=Replace(TempClassID," ","")
  198. SQLCreate=SQLCreate & " and ClassID In ("&TempClassID&")"
  199. end if
  200. SQLCreate=SQLCreate & " order by ClassID desc"
  201. Set RsMake = Server.CreateObject("ADODB.Recordset")
  202. RsMake.open SQLCreate,Conn,1,1
  203. Err=0
  204. if RsMake.Eof then
  205. RefreshHtml "当前无任何栏目!",0,100
  206. RefreshHtml2 "txt1","<font color=red>当前无任何栏目!</font>"
  207. RsMake.Close : Set RsMake=Nothing : exit sub
  208. end if
  209. SQLCreate = RsMake.GetRows(-1)
  210. RsMake.Close:Set RsMake=Nothing
  211. AllMakeNum=Ubound(SQLCreate,2)+1
  212. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&"栏目,请稍候......</font>"
  213. RefreshHtml2 "txt4","共有 "&AllMakeNum&" 个栏目要生成!"
  214. For M=0 to Ubound(SQLCreate,2)
  215. ClassID = SQLCreate(0,M)
  216. CreateFilePre = ClassID & "_"
  217. CurrentPage = 1
  218. TotalPut = 0
  219. Soft_Setting
  220. PageData.Soft_Class
  221. If (TotalPut Mod PageSize) = 0 Then
  222. TotalPageNum = TotalPut  PageSize
  223. Else
  224. TotalPageNum = TotalPut  PageSize + 1
  225. End If
  226. strFileUrl=Cl.GetItemPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir, ParentPath, ClassID, ParentDir, ClassDir) & ClassID & "_Index."&Cl.CreateFileExt
  227. MakeData=Template.ReplaceAllFlag(TempStr)
  228. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  229. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  230. "CreateDate:"&Now&"--> "
  231. Set Make = Nothing
  232. if TotalPageNum>=2 and 0 = Err then  '多页面
  233. RefreshHtml "生成第 <font color=red><b>"&m+1&"</b></font> 个栏目的第 <font color=red><b>1</b></font> 个页面("&strFileUrl&")完成!",m+1,AllMakeNum
  234. for CurrentPage=2 to TotalPageNum
  235. PageData.Soft_Class
  236. strFileUrl=Cl.GetItemPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir, ParentPath, ClassID, ParentDir, ClassDir) & ClassID & "_List_"&CurrentPage&"."&Cl.CreateFileExt
  237. MakeData=Template.ReplaceAllFlag(TempStr)
  238. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  239. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  240. "CreateDate:"&Now&"--> "
  241. Set Make = Nothing
  242. RefreshHtml "生成第 <font color=red><b>"&m+1&"</b></font> 个栏目的第 <font color=red><b>"&CurrentPage&"</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,TotalPageNum
  243. apn=apn+1
  244. next
  245. else
  246. RefreshHtml "生成第 <font color=red><b>"&m+1&"</b></font> 个栏目("&strFileUrl&")完成!",m+1,AllMakeNum
  247. end if
  248. apn=apn+1
  249. if Not Response.IsClientConnected then Exit For
  250. Next
  251. Err=0
  252. SQLCreate=Empty
  253. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有"&Cl.ChannelItemName&"栏目生成完毕!</font>"
  254. End Sub
  255. Sub Create_Soft_Special()
  256. TempClassID=Trim(Request("SpecialID"))
  257. SQLCreate="Select SpecialID from Cl_Special"
  258. if TempClassID<>"" and IsNumeric(Replace(TempClassID,",","")) then
  259. SQLCreate=SQLCreate & " where SpecialID In ("&TempClassID&")"
  260. end if
  261. SQLCreate=SQLCreate & " order by SpecialID desc"
  262. Set RsMake = Server.CreateObject("ADODB.Recordset")
  263. RsMake.open SQLCreate,Conn,1,1
  264. m=0:Err=0
  265. AllMakeNum=RsMake.recordcount
  266. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&"专题专题,请稍候......</font>"
  267. RefreshHtml2 "txt4","共有 <b>"&AllMakeNum&"</b> 个专题专题要生成!"
  268. if AllMakeNum=0 then
  269. RefreshHtml "当前无任何专题栏目!",0,100
  270. RefreshHtml2 "txt1","<font color=red>当前无任何专题栏目!</font>"
  271. exit sub
  272. end if
  273. Do While Not RsMake.Eof
  274. m=m+1
  275. Soft_Setting
  276. SpecialID=RsMake(0)
  277. CurrentPage=1
  278. TotalPut=0
  279. CreateFilePre="Special" & SpecialID & "_"
  280. DefaultPage="Index"
  281. PageData.Soft_Special
  282. If (TotalPut Mod PageSize) = 0 Then
  283. TotalPageNum = TotalPut  PageSize
  284. Else
  285. TotalPageNum = TotalPut  PageSize + 1
  286. End If
  287. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Special/" & CreateFilePre & "Index." & Cl.CreateFileExt
  288. MakeData=Template.ReplaceAllFlag(TempStr)
  289. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  290. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  291. "CreateDate:"&Now&"--> "
  292. Set Make = Nothing
  293. apn=apn+1
  294. if TotalPageNum>=2 then  '多页面
  295. RefreshHtml "生成第 <font color=red><b>"&m&"</b></font> 个专题栏目的第 <font color=red><b>1</b></font> 个页面("&strFileUrl&")完成!",m,AllMakeNum
  296. for CurrentPage=2 to TotalPageNum
  297. PageData.Soft_Special
  298. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Special/" & CreateFilePre & "List_"&CurrentPage&"."&Cl.CreateFileExt
  299. MakeData = Template.ReplaceAllFlag(TempStr)
  300. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  301. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  302. "CreateDate:"&Now&"--> "
  303. Set Make = Nothing
  304. RefreshHtml "生成第 <font color=red><b>"&m&"</b></font> 个专题栏目的第 <font color=red><b>"&CurrentPage&"</b></font> 个页面("&strFileUrl&")完成!",m,AllMakeNum
  305. apn=apn+1
  306. next
  307. else
  308. RefreshHtml "生成第 <font color=red><b>"&m&"</b></font> 个专题栏目("&strFileUrl&")完成!",m,AllMakeNum
  309. end if
  310. if Not Response.IsClientConnected then Exit Do
  311. RsMake.MoveNext
  312. Loop
  313. RsMake.Close:Set RsMake=Nothing
  314. Err=0
  315. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有"&Cl.ChannelItemName&"专题栏目生成完毕!</font>"
  316. End Sub
  317. Sub Create_Soft_Update()
  318. m=1:Err=0
  319. AllMakeNum=1
  320. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&"最近更新页面,请稍候......</font>"
  321. Soft_Setting
  322. CurrentPage=1
  323. TotalPut=0
  324. DefaultPage="Index"
  325. PageData.Soft_Update
  326. If (TotalPut Mod PageSize) = 0 Then
  327. TotalPageNum = TotalPut  PageSize
  328. Else
  329. TotalPageNum = TotalPut  PageSize + 1
  330. End If
  331. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Update/Index."&Cl.CreateFileExt
  332. MakeData=Template.ReplaceAllFlag(TempStr)
  333. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  334. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  335. "CreateDate:"&Now&"--> "
  336. Set Make = Nothing
  337. apn=apn+1
  338. if TotalPageNum>=2 then  '多页面
  339. AllMakeNum=TotalPageNum
  340. RefreshHtml "生成最近更新的第 <font color=red><b>1</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,AllMakeNum
  341. for CurrentPage=2 to TotalPageNum
  342. PageData.Soft_Update
  343. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Update/List_"&CurrentPage&"."&Cl.CreateFileExt
  344. MakeData=Template.ReplaceAllFlag(TempStr)
  345. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  346. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  347. "CreateDate:"&Now&"--> "
  348. Set Make = Nothing
  349. RefreshHtml "生成最近更新的第 <font color=red><b>"&CurrentPage&"</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,AllMakeNum
  350. apn=apn+1
  351. if Not Response.IsClientConnected then Exit For
  352. next
  353. else
  354. RefreshHtml "生成最近更新("&strFileUrl&")完成!",m,AllMakeNum
  355. end if
  356. Err=0
  357. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有"&Cl.ChannelItemName&"最近更新生成完毕!</font>"
  358. End Sub
  359. Sub Create_Soft_Elite()
  360. m=1:Err=0
  361. AllMakeNum=1
  362. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&"推荐列表页面,请稍候......</font>"
  363. Soft_Setting
  364. CurrentPage=1
  365. TotalPut=0
  366. DefaultPage="Index"
  367. PageData.Soft_Elite
  368. If (TotalPut Mod PageSize) = 0 Then
  369. TotalPageNum = TotalPut  PageSize
  370. Else
  371. TotalPageNum = TotalPut  PageSize + 1
  372. End If
  373. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Elite/Index."&Cl.CreateFileExt
  374. MakeData=Template.ReplaceAllFlag(TempStr)
  375. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  376. Make.Write "<!--Powered by:"& ClCMS_Version & " " &_
  377. "CreateDate:"&Now&"--> " & vbNewLine & MakeData & vbNewLine & "<!--Copyright 2005 Aspoo.CN " &_
  378. ".All Rights Reserved-->"
  379. Set Make = Nothing
  380. apn=apn+1
  381. if TotalPageNum>=2 then  '多页面
  382. AllMakeNum=TotalPageNum
  383. RefreshHtml "生成推荐列表的第 <font color=red><b>1</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,AllMakeNum
  384. for CurrentPage=2 to TotalPageNum
  385. PageData.Soft_Elite
  386. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Elite/List_"&CurrentPage&"."&Cl.CreateFileExt
  387. MakeData=Template.ReplaceAllFlag(TempStr)
  388. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  389. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  390. "CreateDate:"&Now&"--> "
  391. Set Make = Nothing
  392. RefreshHtml "生成推荐列表的第 <font color=red><b>"&CurrentPage&"</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,AllMakeNum
  393. apn=apn+1
  394. if Not Response.IsClientConnected then Exit For
  395. next
  396. else
  397. RefreshHtml "生成推荐列表("&strFileUrl&")完成!",m,AllMakeNum
  398. end if
  399. Err=0
  400. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有"&Cl.ChannelItemName&"推荐列表生成完毕!</font>"
  401. End Sub
  402. Sub Create_Soft_Hot()
  403. m=1:Err=0
  404. AllMakeNum=1
  405. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&"热门列表页面,请稍候......</font>"
  406. Soft_Setting
  407. CurrentPage=1
  408. TotalPut=0
  409. DefaultPage="Index"
  410. PageData.Soft_Hot
  411. If (TotalPut Mod PageSize) = 0 Then
  412. TotalPageNum = TotalPut  PageSize
  413. Else
  414. TotalPageNum = TotalPut  PageSize + 1
  415. End If
  416. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Hot/Index."&Cl.CreateFileExt
  417. MakeData=Template.ReplaceAllFlag(TempStr)
  418. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  419. Make.Write MakeData & vbNewLine & _
  420. "<!--Powered by:"& ClCMS_Version & "(As"&"poo.n"&"et) " &_
  421. "CreateDate:"&Now&"--> "
  422. Set Make = Nothing
  423. apn=apn+1
  424. TotalPageNum=Clng(TotalPageNum)
  425. if TotalPageNum>=2 then  '多页面
  426. AllMakeNum=TotalPageNum
  427. RefreshHtml "生成热门列表的第 <font color=red><b>1</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,AllMakeNum
  428. for CurrentPage=2 to TotalPageNum
  429. PageData.Soft_Hot
  430. strFileUrl=Cl.GetItemIndexPath(Cl.CreatePathType, Cl.HtmlDir, Cl.ChannelDir) & "Hot/List_"&CurrentPage&"."&Cl.CreateFileExt
  431. MakeData=Template.ReplaceAllFlag(TempStr)
  432. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  433. Make.Write MakeData & vbNewLine & _
  434. "<!--Powered by:"& ClCMS_Version & "(As"&"poo.n"&"et) " &_
  435. "CreateDate:"&Now&"--> "
  436. Set Make = Nothing
  437. RefreshHtml "生成热门列表的第 <font color=red><b>"&CurrentPage&"</b></font> 个页面("&strFileUrl&")完成!",CurrentPage,AllMakeNum
  438. apn=apn+1
  439. if Not Response.IsClientConnected then Exit For
  440. next
  441. else
  442. RefreshHtml "生成推荐列表("&strFileUrl&")完成!",m,AllMakeNum
  443. end if
  444. Err=0
  445. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有"&Cl.ChannelItemName&"热门列表生成完毕!</font>"
  446. End Sub
  447. Sub Create_Soft_Soft(strType)
  448. Dim TempID
  449. Dim SqlMake,sTopNew,sBeginDate,sEndDate,sBeginID,sEndID
  450. m=0:Err=0:AllMakeNum=0
  451. RefreshHtml2 "txt1","<font color=#ff0033>正在生成"&Cl.ChannelItemName&",请稍候.....</font>"
  452. Set RsMake = Server.CreateObject("ADODB.Recordset")
  453. if strType=1 then
  454. TempClassID=Trim(Request("ClassID"))
  455. TempID=Trim(Request("InfoID"))
  456. if TempID<>"" then
  457. if TempID="" or Not IsNumeric(Replace(Replace(TempID,",","")," ","")) then
  458. RefreshHtml2 "txt1","<font color=red>生成HTML文件失败,参数中含有非法ID!</font>"
  459. Exit Sub
  460. end if
  461. TempID=Replace(TempID," ","")
  462. SqlMake="Select InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" And InfoID In ("&TempID&") and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  463. elseif TempClassID<>"" then
  464. if TempClassID="" or Not IsNumeric(Replace(Replace(TempClassID,",","")," ","")) then
  465. RefreshHtml2 "txt1","<font color=red>生成HTML文件失败,参数中含有非法ID!</font>"
  466. Exit Sub
  467. end if
  468. TempClassID=Replace(TempClassID," ","")
  469. SqlMake="Select InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" And ClassID In ("&TempClassID&") and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  470. else
  471. RefreshHtml2 "txt1","<font color=red>生成HTML文件失败,请指定参数!</font>"
  472. Response.end
  473. end if
  474. else
  475. Select Case CreateType
  476. Case "2"
  477. sTopNew=Trim(Request("TopNew"))
  478. if Not isNumeric(sTopNew) then Call Cl.OutMsg(0,"参数错误,请重新输入!","javascript:history.go(-1)")
  479. SqlMake="Select Top "&Clng(sTopNew)&" InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  480. Case "3"
  481. sBeginDate=Trim(Request("BeginDate"))
  482. sEndDate=Trim(Request("EndDate"))
  483. if Not IsDate(sBeginDate) or Not IsDate(sEndDate) then Call Cl.OutMsg(0,"参数错误,请重新输入!","javascript:history.go(-1)")
  484. If IsSqlDataBase=1 Then
  485. SqlMake="Select InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" and datediff(d,UpDateTime,"&SqlNowString&")<=datediff(d,'"&sBeginDate&"',"&SqlNowString&") and datediff(d,UpDateTime,"&SqlNowString&")>=datediff(d,'"&sEndDate&"',"&SqlNowString&") and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  486. else
  487. SqlMake="Select InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" and datediff('d',UpDateTime,"&SqlNowString&")<=datediff('d','"&sBeginDate&"',"&SqlNowString&") and datediff('d',UpDateTime,"&SqlNowString&")>=datediff('d','"&sEndDate&"',"&SqlNowString&") and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  488. end if
  489. Case "4"
  490. sBeginID=Trim(Request("BeginID"))
  491. sEndID=Trim(Request("EndID"))
  492. if Not Isnumeric(sBeginID) or Not Isnumeric(sEndID) then Call Cl.OutMsg(0,"参数错误,请重新输入!","javascript:history.go(-1)")
  493. SqlMake="Select InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" and InfoID>"&Clng(sBeginID)&" and InfoID<"&Clng(sEndID)&" and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  494. Case else
  495. SqlMake="Select InfoID,ClassID,IsHtml,HtmlFileUrl,UpdateTime from Cl_Soft where Status=1 and Deleted="&FalseType&" and ChannelID="&ChannelID&" order by UpDateTime desc,InfoID desc"
  496. end Select
  497. end if
  498. RsMake.open SqlMake,Conn,1,3
  499. if RsMake.Bof and RsMake.Eof then
  500. RefreshHtml "当前无任何"&Cl.ChannelItemName&"!",0,100
  501. RefreshHtml2 "txt1","<font color=red>当前无任何"&Cl.ChannelItemName&"!</font>"
  502. exit sub
  503. End if
  504. SqlMake=RsMake.GetRows(-1)
  505. RsMake.Close:Set RsMake=Nothing
  506. AllMakeNum=Ubound(SqlMake,2)+1
  507. RefreshHtml2 "txt4","共有 <b>"&AllMakeNum&"</b> "&Cl.ChannelItemUnit&Cl.ChannelItemName&"要生成!"
  508. Dim Mi
  509. On Error Resume Next
  510. For Mi=0 to AllMakeNum-1
  511. if SqlMake(2,Mi) then Fso.DeleteFile(server.MapPath(Cl.WebDir & SqlMake(3,Mi)))
  512. m=m+1:InfoID=SqlMake(0,Mi)
  513. Soft_Setting
  514. sInfoFileName = Cl.GetItemFileName(Cl.CreateFileType,SqlMake(1,Mi),SqlMake(0,Mi),SqlMake(4,Mi))
  515. strFileUrl=Cl.GetItemPath(Cl.CreatePathType,Cl.HtmlDir,Cl.ChannelDir,ParentPath,ClassID,ParentDir,ClassDir) & sInfoFileName &"."&Cl.CreateFileExt
  516. PageData.Soft_Show
  517. MakeData=Template.ReplaceAllFlag(TempStr)
  518. Set Make = Fso.CreateTextFile(Server.MapPath(Cl.WebDir&strFileUrl), True)
  519. Make.Write MakeData & vbNewLine & "<!--Powered by:"& ClCMS_Version & "(As"&"poo.C"&"n) " &_
  520. "CreateDate:"&Now&"--> "
  521. Set Make = Nothing
  522. 'RsMake("IsHtml")=TrueType
  523. 'RsMake("HtmlFileUrl")=strFileUrl
  524. 'RsMake.Update
  525. Cl.Execute("UpDate Cl_Soft Set IsHtml="&TrueType&",HtmlFileUrl='"&strFileUrl&"' where InfoID="&InfoID&"")
  526. RefreshHtml "生成第 <font color=red><b>"&m&"</b></font> "&Cl.ChannelItemUnit&Cl.ChannelItemName&"("&strFileUrl&")完成!",m,AllMakeNum
  527. apn=apn+1
  528. if Not Response.IsClientConnected then Exit For
  529. Next
  530. SqlMake=Empty
  531. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有文件生成完毕!</font>"
  532. Err=0
  533. End Sub
  534. Sub Del_Soft_Soft(strType)
  535. Dim TempID,RsDelHtml,SQLDelHtml
  536. m=0:Err=0:AllMakeNum=0
  537. RefreshHtml2 "txt1","<font color=#ff0033>正在清除HTML,请稍候.....</font>"
  538. if strType=1 then
  539. TempID=Request("InfoID")
  540. if TempID="" or Not IsNumeric(Replace(Replace(TempID,",","")," ","")) then
  541. RefreshHtml2 "txt1","<font color=#ff0033>清除HTML文件失败,参数中含有非法ID!</font>"
  542. Exit Sub
  543. end if
  544. SQLDelHtml="Select InfoID,IsHtml,HtmlFileUrl From Cl_Soft Where InfoID In ("&TempID&") and IsHtml="&TrueType&" and ChannelID="&ChannelID&" Order By InfoID Desc"
  545. else
  546. SQLDelHtml="Select InfoID,IsHtml,HtmlFileUrl From Cl_Soft Where IsHtml="&TrueType&" and ChannelID="&ChannelID&" Order By InfoID Desc"
  547. end if
  548. Set RsDelHtml=Server.CreateObject("Adodb.RecordSet")
  549. RsDelHtml.Open SQLDelHtml,Conn,1,3
  550. AllMakeNum=RsDelHtml.recordcount
  551. RefreshHtml2 "txt4","共有 "&AllMakeNum&" "&Cl.ChannelItemUnit&Cl.ChannelItemName&"要清除HTML!"
  552. if AllMakeNum=0 then
  553. RefreshHtml "当前无要清除HTML的"&Cl.ChannelItemName&"!",1,1
  554. RefreshHtml2 "txt1","<font color=red>当前无要清除HTML的"&Cl.ChannelItemName&"!</font>"
  555. exit sub
  556. end if
  557. Do While Not RsDelHtml.Eof
  558. strFileUrl=Replace(Cl.WebDir & RsDelHtml(2),"//","/")
  559. RsDelHtml("IsHtml")=False
  560. RsDelHtml("HtmlFileUrl")=""
  561. RsDelHtml.Update
  562. m=m+1
  563. if fso.FileExists(server.MapPath(strFileUrl)) then
  564. fso.DeleteFile(server.MapPath(strFileUrl))
  565. RefreshHtml "清除第 <font color=red><b>"&m&"</b></font> 个HTML文件("&strFileUrl&")完成!",m,AllMakeNum
  566. else
  567. RefreshHtml "<font color=red>清除第 <b>"&m&"</b> 个HTML文件("&strFileUrl&")失败!</font>",m,AllMakeNum
  568. end if
  569. RsDelHtml.MoveNext
  570. Loop
  571. RsDelHtml.Close:Set RsDelHtml=Nothing
  572. RefreshHtml "所有文件清除HTML完毕!",1,1
  573. RefreshHtml2 "txt1","<font color=blue>恭喜您,所有文件清除HTML完毕!</font>"
  574. Err=0
  575. End Sub
  576. '<!--
  577. '┌───────────────────────────────────────────────────────┐
  578. '│  │
  579. '│ CreateLive CMS Version 4.0  │
  580. '│         Powered by Aspoo.CN    │
  581. '│              │
  582. '│  邮箱: support@aspoo.cn Info@aspoo.cn    │
  583. '│ QQ: 3315263 596197794  │
  584. '│ 网站: www.aspoo.cn www.aspoo.com  │
  585. '│ 论坛: bbs.aspoo.cn bbs.aspoo.com  │
  586. '│  │
  587. '│ Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved.  │
  588. '└───────────────────────────────────────────────────────┘
  589. '-->
  590. %>