ThemeList.asp
上传用户:saigedz
上传日期:2019-10-14
资源大小:997k
文件大小:12k
源码类别:

中间件编程

开发平台:

HTML/CSS

  1. <%@ CODEPAGE=65001 %>
  2. <%
  3. '///////////////////////////////////////////////////////////////////////////////
  4. '// 插件应用:    1.8 Pre Terminator 及以上版本, 其它版本的Z-blog未知
  5. '// 插件制作:    haphic(http://haphic.com/)
  6. '// 备    注:    主题管理插件
  7. '// 最后修改:   2008-6-28
  8. '// 最后版本:    1.2
  9. '///////////////////////////////////////////////////////////////////////////////
  10. %>
  11. <% Option Explicit %>
  12. <% On Error Resume Next %>
  13. <% Response.Charset="UTF-8" %>
  14. <% Response.Buffer=True %>
  15. <!-- #include file="../../c_option.asp" -->
  16. <!-- #include file="../../function/c_function.asp" -->
  17. <!-- #include file="../../function/c_system_lib.asp" -->
  18. <!-- #include file="../../function/c_system_base.asp" -->
  19. <!-- #include file="../../function/c_system_plugin.asp" -->
  20. <!-- #include file="c_sapper.asp" -->
  21. <%
  22. Call System_Initialize()
  23. '检查非法链接
  24. Call CheckReference("")
  25. '检查权限
  26. If BlogUser.Level>1 Then Call ShowError(6)
  27. If CheckPluginState("ThemeSapper")=False Then Call ShowError(48)
  28. BlogTitle="Theme Sapper"
  29. %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  30. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=ZC_BLOG_LANGUAGE%>" lang="<%=ZC_BLOG_LANGUAGE%>">
  31. <head>
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  33. <meta http-equiv="Content-Language" content="<%=ZC_BLOG_LANGUAGE%>" />
  34. <meta name="robots" content="noindex,nofollow"/>
  35. <link rel="stylesheet" rev="stylesheet" href="../../CSS/admin.css" type="text/css" media="screen" />
  36. <link rel="stylesheet" rev="stylesheet" href="images/style.css" type="text/css" media="screen" />
  37. <title><%=BlogTitle%></title>
  38. </head>
  39. <body>
  40. <div id="divMain">
  41. <div class="Header">Theme Sapper - 管理您已安装的主题. <a href="help.asp#themelist" title="主题管理面板帮助">[页面帮助]</a></div>
  42. <%Call SapperMenu("2")%>
  43. <div id="divMain2">
  44. <%Call GetBlogHint()%>
  45. <div>
  46. <%
  47. Action=Request.QueryString("act")
  48. NewVersionExists=False
  49. If Action = "themedel" Then
  50. SelectedTheme=Request.QueryString("theme")
  51. SelectedThemeName=Request.QueryString("themename")
  52. If UCase(SelectedTheme)=Ucase(ZC_BLOG_THEME) Then
  53. Response.Write "<p class=""status-box notice"">您请求的主题正在使用, 无法删除...</p>"
  54. Response.Write "<script>setTimeout(""self.history.back(1)"",2000);</script>"
  55. Response.End
  56. End If
  57. Dim DelError
  58. DelError = 0
  59. If SelectedTheme<>"" Then
  60. Response.Write "<p class=""status-box"">正在处理您的请求...</p>"
  61. Response.Flush
  62. Response.Write "<p>"
  63. DelError = DelError + DeleteFolder(BlogPath & "/THEMES/" & SelectedTheme)
  64. Response.Write "</p>"
  65. Else
  66. Response.Write "<p class=""status-box notice"">请求的参数错误, 正在退出...</p>"
  67. Response.Flush
  68. DelError = 13
  69. End If
  70. If DelError = 0 Then
  71. Response.Write "<p><font color=""green""> √ 主题 - " & SelectedThemeName & "  删除成功!</font><p>"
  72. Else
  73. Response.Write "<p><font color=""red""> × 主题 - " & SelectedThemeName & "  删除失败! 请手动删除之.</font><p>"
  74. End If
  75. Response.Write "<p><font color=""navy"">如果您的浏览器没能自动跳转 请 <a href=""ThemeList.asp"">[点击这里]</a>.</font><p>"
  76. Response.Write "<script>setTimeout(""self.location.href='ThemeList.asp'"",1500);</script>"
  77. Else
  78. Response.Write "<p id=""loading"">正在载入主题列表, 请稍候... 如果长时间停止响应, 请 <a href=""javascript:window.location.reload();"" title=""点此重试"">[点此重试]</a></p>"
  79. Response.Flush
  80. Response.Write "<form id=""edit"" method=""post"" style=""display:none;""><p><a href=""Xml_Restor.asp"" title=""查看主机上保存的 ZTI 文件"">[查看主机上保存的 ZTI 文件]</a> TS 插件的 Export 目录下保存有您已备份或导出的 ZTI 主题文件, 点击可进入查看并对其进行管理操作.</p></form>"
  81. Response.Write "<p id=""newVersion"" class=""download-box notice"" style=""display:none;""><a href=""Xml_ChkVer.asp"" title=""查看主题的可用更新"">[Plugin Sapper 发现了您安装的某个主题有了新版本, 点此查看现有主题的可用更新]</a>.</p>"
  82. Dim objXmlFile,strXmlFile
  83. Dim fso, f, f1, fc, s, t
  84. Set fso = CreateObject("Scripting.FileSystemObject")
  85. Set f = fso.GetFolder(BlogPath & "/THEMES/")
  86. Set fc = f.SubFolders
  87. For Each f1 in fc
  88. ThemeSource_Name=Empty
  89. ThemeSource_Url=Empty
  90. ThemeID=Empty
  91. ThemeName=Empty
  92. ThemeURL=Empty
  93. ThemeNote=Empty
  94. ThemeModified=Empty
  95. If fso.FileExists(BlogPath & "/THEMES/" & f1.name & "/" & "theme.xml") Then
  96. strXmlFile =BlogPath & "/THEMES/" & f1.name & "/" & "theme.xml"
  97. Set objXmlFile=Server.CreateObject("Microsoft.XMLDOM")
  98. objXmlFile.async = False
  99. objXmlFile.ValidateOnParse=False
  100. objXmlFile.load(strXmlFile)
  101. If objXmlFile.readyState=4 Then
  102. If objXmlFile.parseError.errorCode <> 0 Then
  103. Else
  104. ThemeAuthor_Name=objXmlFile.documentElement.selectSingleNode("author/name").text
  105. ThemeAuthor_Url=objXmlFile.documentElement.selectSingleNode("author/url").text
  106. ThemeSource_Name=objXmlFile.documentElement.selectSingleNode("source/name").text
  107. ThemeSource_Url=objXmlFile.documentElement.selectSingleNode("source/url").text
  108. If ThemeAuthor_Name=Empty Then
  109. ThemeAuthor_Name=ThemeSource_Name
  110. ThemeAuthor_Url=ThemeSource_Url
  111. End If
  112. 'ThemeID=f1.name
  113. ThemeID=objXmlFile.documentElement.selectSingleNode("id").text
  114. ThemeName=objXmlFile.documentElement.selectSingleNode("name").text
  115. ThemeURL=objXmlFile.documentElement.selectSingleNode("url").text
  116. ThemePubDate=objXmlFile.documentElement.selectSingleNode("pubdate").text
  117. ThemeModified=objXmlFile.documentElement.selectSingleNode("modified").text
  118. ThemeNote=objXmlFile.documentElement.selectSingleNode("note").text
  119. If ThemeModified=Empty Then
  120. ThemeModified=ThemePubDate
  121. End If
  122. ThemeNote=TransferHTML(ThemeNote,"[nohtml]")
  123. If Len(ThemeNote)>25 then ThemeNote=Left(ThemeNote,25-7) & "...<a href=""ThemeDetail.asp?theme=" & Server.URLEncode(ThemeID) & """>more</a>"
  124. End If
  125. End If
  126. Set objXmlFile=Nothing
  127. Else
  128. ThemeSource_Name="unknown"
  129. ThemeSource_Url=Empty
  130. ThemeID=f1.name
  131. ThemeName=f1.name
  132. ThemeURL=Empty
  133. ThemeNote="unknown"
  134. ThemeModified="unknown"
  135. End If
  136. If fso.FileExists(BlogPath & "/THEMES/" & f1.name & "/" & "verchk.xml") Then
  137. t="<a href=""Xml_Install.asp?act=update&amp;url=" & Server.URLEncode(Update_URL & f1.name) & """ title=""升级主题""><b class=""notice"">发现新版本!</b></a>"
  138. NewVersionExists=True
  139. ElseIf fso.FileExists(BlogPath & "/THEMES/" & f1.name & "/" & "error.log") Then
  140. t="<b class=""somehow"">不支持在线更新.</b>"
  141. Else
  142. t=""
  143. End If
  144. If fso.FileExists(BlogPath & "/THEMES/" & f1.name & "/" & "screenshot.png") Then
  145. ThemeScreenShot="../../THEMES/" & f1.name & "/" & "screenshot.png"
  146. Else
  147. ThemeScreenShot="Images/noscreenshot.png"
  148. End If
  149. If UCase(ThemeID)=UCase(ZC_BLOG_THEME) Then
  150. Response.Write "<div class=""themePanel"">"
  151. Else
  152. Response.Write "<div class=""themePanel"" style=""background-color:#FFFFFF;"">"
  153. End If
  154. If UCase(ThemeID)<>UCase(f1.name) Then
  155. Response.Write "<div>该主题ID错误, 请 <a href=""Xml_Edit.asp?theme=" & Server.URLEncode(f1.name) & """ title=""编辑主题信息""><font color=""red""><b>[重新编辑主题信息]</b></font></a>.</div>"
  156. Else
  157. Response.Write "<div class=""delicon""><a href=""ThemeList.asp?act=themedel&amp;theme=" & Server.URLEncode(f1.name) & "&amp;themename=" & Server.URLEncode(ThemeName) & """ title=""删除此主题"" onclick=""return window.confirm('您将删除此主题的所有文件, 确定吗?');""><font color=""red""><b>×</b></font></a></div>"
  158. Response.Write "<div class=""epticon""><a href=""Xml_Pack.asp?theme=" & Server.URLEncode(f1.name) & """ title=""导出此主题""><font color=""green""><b>↑</b></font></a></div>"
  159. Response.Write "<div class=""edticon""><a href=""Xml_Edit.asp?theme=" & Server.URLEncode(f1.name) & """ title=""编辑主题信息""><font color=""teal""><b>√</b></font></a></div>"
  160. Response.Write "<div class=""inficon""><a href=""ThemeDetail.asp?theme=" & Server.URLEncode(f1.name) & "&amp;themename=" & Server.URLEncode(ThemeName) & """ title=""查看主题信息""><font color=""blue""><b>i</b></font></a></div>"
  161. Response.Write "<div class=""updicon""><a href=""Xml_Install.asp?act=update&amp;url=" & Server.URLEncode(Update_URL & ThemeID) & """ title=""升级修复主题""><font color=""Gray""><b>↓</b></font></a></div>"
  162. Response.Write "<div class=""updinfo""><span class=""notice"">"& t &"</span></div>"
  163. End If
  164. Response.Write "<p><a href=""ThemeDetail.asp?theme=" & Server.URLEncode(f1.name) & "&amp;themename=" & Server.URLEncode(ThemeName) & """><img src=""" & ThemeScreenShot & """ title=""点击查看 " & ThemeName & " 的详细信息!"" alt=""ScreenShot"" width=""200"" height=""160"" /></a></p>"
  165. Response.Write "<p><table>"
  166. If ThemeURL=Empty Then
  167. Response.Write "<tr><td width=""36"" align=""right"">名称:</td><td>" & ThemeName & "</td></tr>"
  168. Else
  169. Response.Write "<tr><td width=""36"" align=""right"">名称:</td><td><a href=""" & ThemeURL & """ target=""_blank"" title=""主题发布地址"">" & ThemeName & "</a></td></tr>"
  170. End If
  171. If ThemeAuthor_Url=Empty Then
  172. Response.Write "<tr><td align=""right"">作者:</td><td>" & ThemeAuthor_Name & "</td></tr>"
  173. Else
  174. Response.Write "<tr><td align=""right"">作者:</td><td><a href=""" & ThemeAuthor_Url & """ target=""_blank"" title=""作者主页"">" & ThemeAuthor_Name & "</a></td></tr>"
  175. End If
  176. Response.Write "<tr><td align=""right"">发布:</td><td>" & ThemeModified & "</td></tr>"
  177. Response.Write "<tr><td align=""right"">简介:</td><td>" & ThemeNote & "</td></tr>"
  178. Response.Write "</table></p>"
  179. Response.Write "</div>"
  180. Next
  181. Set fso = nothing
  182. Err.Clear
  183. %>
  184. <!--  <div class="themePanel" style="background-color:#FFFFFF;">
  185. <p><a href="Xml_Upload.asp" title="导入本地的 ZTI 文件"><img src="Images/import.png" alt="ScreenShot" width="200" height="160" /></a></p>
  186. <p><b>从本地导入 ZTI 文件:</b><br /> <form border="1" name="edit" method="post" enctype="multipart/form-data" action="XML_Upload.asp?act=FileUpload"><p>选择主题安装包文件,TS 将从该文件导入主题并安装到 THEMES 目录下: </p><p><input type="file" id="edtFileLoad" name="edtFileLoad" size="15"></p><p><input type="submit" class="button" value="提交" name="B1" onclick="return window.confirm('确定导入该主题数据包??');" /> <input class="button" type="reset" value="重置" name="B2" /></p></form></p>
  187. </div> -->
  188. <hr style="clear:both;"/><p><form name="edit" method="get" action="#" class="status-box">
  189. <p><input onclick="window.scrollTo(0,0);" type="button" class="button" value="TOP" title="返回页面顶部" /> <input onclick="self.location.href='Xml_ChkVer.asp?act=check&n=0';" type="button" class="button" value="查找更新" title="开始查找主题的可用更新" /></p>
  190. </form></p>
  191. <%
  192. If NewVersionExists Then
  193. Response.Write "<script language=""JavaScript"" type=""text/javascript"">document.getElementById('newVersion').style.display = 'block';</script>"
  194. End If
  195. Response.Flush
  196. Dim FileList,l,c
  197. FileList=LoadIncludeFiles("PLUGIN/ThemeSapper/Export/")
  198. For Each l In FileList
  199. c=c & l
  200. Next
  201. If (InStr(LCase(c),".xml")>0) Or (InStr(LCase(c),".zti")>0) Then
  202. Response.Write "<script language=""JavaScript"" type=""text/javascript"">document.getElementById('edit').style.display = 'block';</script>"
  203. End If
  204. Response.Write "<script language=""JavaScript"" type=""text/javascript"">try{document.getElementById('loading').style.display = 'none';}catch(e){};</script>"
  205. End If
  206. %>
  207. </div>
  208. </div>
  209. </div>
  210. </body>
  211. </html>
  212. <%
  213. Call System_Terminate()
  214. If Err.Number<>0 then
  215. Call ShowError(0)
  216. End If
  217. %>