⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_cache.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
%>
<!--#Include File="../Conn.asp"-->
<!--#Include File="Admin_CheckPurview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href='Admin_Style.css' type='text/css' rel='stylesheet'>
<title>系统缓存管理</title>
<script language="javascript" src="../js/Common.js"></script>
<script language="javascript" src="../js/InstallDir.js"></script>
<script language="javascript" src="../Js/Ajax.js"></script>
</head>
<body>
<%
If EL_Admin.Purview <> 1 Then
   If EL_Admin.CheckAdminPurview(27, 3) = False Then
      EL_Admin_ShowPurviewError("您没有足够的权限访问该页面")
   End If
End If
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td align="center" class="top_25"><strong>系统缓存管理</strong></td>
  </tr>
  <tr>
    <td class="td_50">管理导航:<a href="Admin_Cache.asp">系统缓存管理</a> | <a href="Admin_Cache.asp?Action=Config">缓存配置</a> | <a href="Admin_Cache.asp?Action=All">服务器所有缓存</a></td>
  </tr>
</table>
<br>
<%
Select Case Action
   Case "": Call ManageCache()
   Case "Config": Call ConfigCache()
   Case "All": Call AllCache()
   Case "Show": Call ShowCache()
   Case "Clear": Call ClearCache(0)
   Case "ClearAll": Call ClearCache(1)
   Case "Delete": Call DeleteCache()
   Case "SaveConfig": Call SaveConfig()
End Select
Call EL_Common.Bottom()
Call ApplicationTerminate()

Sub SaveConfig()
   On Error Resume Next
   Dim ChannelCmd, rsChannel, i, RowCount
   Dim ConfigString
   Dim SysConfig, Template_Index, ChannelConfig, Others

   SysConfig = EL_Common.ELRequest("SysConfig", 2)
   Template_Index = EL_Common.ELRequest("Template_Index", 2)
   ChannelConfig = Replace(EL_Common.ELRequest("ChannelConfig", 1), " ", "")
   Others = Replace(EL_Common.ELRequest("Others", 1), " ", "")
      
   ConfigString = "<"&"%" & VBCRLF
   ConfigString = ConfigString &"Const Cache_SysConfig = "& SysConfig & VBCRLF
   ConfigString = ConfigString &"Const Cache_Template_Index = "& Template_Index & VBCRLF
   ConfigString = ConfigString &"Const Cache_Others = """& Others &""""& VBCRLF
   ConfigString = ConfigString &"Const Cache_Channel = """& ChannelConfig &""""& VBCRLF
   
   Call EL_Common.InitCommonCmd(ChannelCmd, rsChannel, "EL_Channel", "ChannelID", "ChannelType=0 And Disabled="& EL_False &" Order By OrderID")
   rsChannel.Close()
   RowCount = ChannelCmd(0)
   rsChannel.Open()
   For i = 1 To RowCount
      ConfigString = ConfigString &"Const Cache_Template_"& rsChannel("ChannelID") &" = """& Replace(EL_Common.ELRequest("Template_"& rsChannel("ChannelID"), 1), " ", "") &""""& VBCRLF
	  If i<Rowcount Then rsChannel.MoveNext
   Next
   rsChannel.Close()
   Set rsChannel = Nothing
   Set ChannelCmd = Nothing
   
   ConfigString = ConfigString &"%"&">"
   Call EL_Common.CreateFile(ConfigString, InstallDir &"Inc/CacheConfig.asp", True)
   EL_Common.ShowSuccessMsg("修改缓存配置成功")
   EL_Common.ShowScriptError()
End Sub

Sub DeleteCache()
   On Error Resume Next
   Dim CacheName
   CacheName = EL_Common.ELRequest("CacheName", 1)
   Application.Lock
   Application.Contents.Remove (CacheName)
   Application.UnLock
   EL_Common.ShowSuccessMsg("删除缓存成功")
   EL_Common.ShowScriptError()
End Sub

Sub ClearCache(ClearType)
   On Error Resume Next
   Select Case ClearType
      Case 0:
	     Call EL_Cache.ClearCache()
	  Case 1:
	     Call EL_Cache.ClearAllCache()
   End Select   
   ComeURL = "Admin_Cache.asp"
   EL_Common.ShowSuccessMsg("清除缓存成功")
   EL_Common.ShowScriptError()
End Sub

Sub ConfigCache()
On Error Resume Next

%>
<form name="myform" action="Admin_Cache.asp" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td colspan="2" class="top_25"><strong>系统缓存配置</strong></td>
  </tr>
  <tr>
    <td class="td_ItemName"><strong>缓存网站基本配置</strong></td>
    <td class="td_25" onMouseOut="this.className='td_25'" onMouseOver="this.className='MouseOver_25'"><input name="SysConfig" type="radio" class="nomargin" value="1" <%=EL_Common.SetObjectChecked("1", CStr(Cache_SysConfig))%>>
        <input name="SysConfig" type="radio" class="nomargin" value="0" <%=EL_Common.SetObjectChecked("0", CStr(Cache_SysConfig))%>>
      否</td>
  </tr>
  <tr>
    <td width="17%" class="td_ItemName"><strong>缓存网站首页模板</strong></td>
    <td width="83%" class="td_25" onMouseOut="this.className='td_25'" onMouseOver="this.className='MouseOver_25'"><input name="Template_Index" type="radio" class="nomargin" value="1" <%=EL_Common.SetObjectChecked("1", CStr(Cache_Template_Index))%>>
  <input name="Template_Index" type="radio" class="nomargin" value="0" <%=EL_Common.SetObjectChecked("0", CStr(Cache_Template_Index))%>>
否</td>
  </tr>
  <%
    Dim ChannelCmd, rsChannel, i, RowCount
	Call EL_Common.InitCommonCmd(ChannelCmd, rsChannel, "EL_Channel", "ChannelID,ChannelName,ChannelModule", "ChannelType=0 And Disabled="& EL_False &" Order By OrderID")
	rsChannel.Close()
	RowCount = ChannelCmd(0)
	rsChannel.Open()
	For i = 1 To RowCount
  %>  
  <tr>
    <td class="td_ItemName"><strong><span class="BlueText"><%=EL_Common.ServerHTMLEncode(rsChannel("ChannelName"))%></span> 缓存设置</strong></td>
    <td class="td_25" onMouseOut="this.className='td_25'" onMouseOver="this.className='MouseOver_25'">
	<table width="100%" border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td width="25%" height="25"><input name="ChannelConfig" type="checkbox" class="nomargin" id="ChannelConfig" value="<%=rsChannel("ChannelID")%>" <%=EL_Common.SetObjectChecked("True", EL_Common.FoundInArray(Split(Cache_Channel, ","), CStr(rsChannel("ChannelID"))))%>> 频道基本配置</td>
        <td width="25%"></td>
        <td width="25%"></td>
        <td width="25%"></td>
      </tr>    
	  <%
	  Dim arr, ChannelTemplate, j, k, l
	  ChannelTemplate = Templates(rsChannel("ChannelModule"))
	  arr = Split(ChannelTemplate, "|")
	  Response.Write "<tr>"
	  k = 0
	  l = Ubound(arr)
	  For j = 0 To l
	     If arr(j) <> "@" Then
	        Dim Temp
		    Temp = Split(arr(j), "$")
			Response.Write "<td  height='25'>"
			Response.Write "<input name='Template_"& rsChannel("ChannelID") &"' type='checkbox' class='nomargin' value='"& Temp(0) &"' "& EL_Common.SetObjectChecked("True", EL_Common.FoundInArray(Split(Eval("Cache_Template_"& rsChannel("ChannelID")), ","), Temp(0))) &"> "& Temp(1) &"模板"
			Response.Write "</td>"
			k = k + 1
			If (k Mod 4) = 0 And k<=l Then Response.Write "</tr><tr>"
	     End If		 		 
	  Next
	  Response.Write "</tr>"
	  %>
	</table>	</td>
  </tr>
  <%
       If i<Rowcount Then rsChannel.MoveNext
    Next
	rsChannel.Close()
	Set rsChannel = Nothing
	Set ChannelCmd = Nothing
  %>
  <tr>
    <td class="td_ItemName"><strong>其他缓存设置</strong></td>
    <td class="td_25" onMouseOut="this.className='td_25'" onMouseOver="this.className='MouseOver_25'"><table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td width="25%"><input name="Others" type="checkbox" class="nomargin" id="Others" value="1" <%=EL_Common.SetObjectChecked("True", EL_Common.FoundInArray(Split(Cache_Others, ","), 1))%>> 网站频道</td>
          <td width="25%"><input name="Others" type="checkbox" class="nomargin" id="Others" value="2" <%=EL_Common.SetObjectChecked("True", EL_Common.FoundInArray(Split(Cache_Others, ","), 2))%>> 网站调查 </td>
          <td width="25%"></td>
          <td width="25%"></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td class="td_ItemName">&nbsp;</td>
    <td class="td_50"><input type="submit" name="Submit3" value="保存配置">
      <input name="Action" type="hidden" id="Action" value="SaveConfig"></td>
  </tr>
</table>
</form>
<%
EL_Common.ShowScriptError()
End Sub

Sub ManageCache()
On Error Resume Next
Dim CacheItem, CacheList, i
Dim CacheName, CacheValue, CacheDateTime
CacheList = ""
For Each CacheItem In Application.Contents
   If CStr(Left(CacheItem, Len(EL_Cache.CacheSn))) = CStr(EL_Cache.CacheSn) Then
      CacheList = CacheList &","& CacheItem 
   End If
Next
CacheList = Split(CacheList, ",")
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td width="19%" align="center" class="top_item"><strong>缓存名</strong></td>
    <td width="52%" align="center" class="top_item"><strong>缓存值</strong></td>
    <td width="19%" align="center" class="top_item"><strong>缓存时间</strong></td>
    <td width="10%" align="center" class="top_item"><strong>操作</strong></td>
  </tr>
  <%
    For i = 1 To UBound(CacheList)
	   CacheName = CacheList(i)
	   CacheValue = EL_Cache.GetCache(Replace(CacheName, EL_Cache.CacheSn, ""), 0)
	   CacheDateTime = EL_Cache.GetCache(Replace(CacheName, EL_Cache.CacheSn, ""), 1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -