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

📄 admin_channel.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 4 页
字号:
<%
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'>
function SelectColor(sEL,objvalue){
    var url = 'Admin_Selcolor.asp?color='+encodeURIComponent(objvalue.value);
    var arr = showModalDialog(url,window,'dialogWidth:280px;dialogHeight:250px;help:no;scroll:no;status:no');
    if (arr) {
        objvalue.value=arr;
        sEL.style.backgroundColor=arr;
    }
}
</script>
</head>
<body>
<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_Channel.asp">频道管理首页</a> | <a href="Admin_Channel.asp?Action=Add">添加频道</a></td>
  </tr>
</table>
<br>
<%
'检查权限
If EL_PurviewPassed = False Then
   If EL_Admin.CheckAdminPurview(1, 3) = False Then
      EL_Admin.ShowPurviewError("您没有足够的管理权限")
	  Call ApplicationTerminate()
   End If
End If

Dim CMC_1, CMC_2, CMC_3, CMC_4, CMC_5, CMC_6, CMC_7, CMC_8, CMC_9, CMC_10, CMC_11, CMC_12, CMC_13, CMC_14, CMC_15
Dim CMC_16 , CMC_17, CMC_18, CMC_19, CMC_20, CMC_21, CMC_22, CMC_23
Dim CMC_Item_1, CMC_Item_2, CMC_Item_3, CMC_Item_4, CMC_Item_5, CMC_Item_6, CMC_Item_7, CMC_Item_8, CMC_Item_9, CMC_Item_10
Dim CMC_Item_11, CMC_Item_12, CMC_Item_13, CMC_Item_14, CMC_Item_15, CMC_Item_16, CMC_Item_17, CMC_Item_18, CMC_Item_19
Dim CMC_Item_20, CMC_Item_21, CMC_Item_22, CMC_Item_23, CMC_Item_24, CMC_Item_25, CMC_Item_26, CMC_Item_27, CMC_Item_28
Dim CMC_Item_29, CMC_Item_30, CMC_Item_31, CMC_Item_32, CMC_Item_33, CMC_Item_34, CMC_Item_35, CMC_Item_36, CMC_Item_37
Dim CMC_Item_38, CMC_Item_39
Dim pNum, pNum2

Dim CN_ChannelModuleName(9)
CN_ChannelModuleName(1) = "文章模块"
CN_ChannelModuleName(2) = "酒店模块"
CN_ChannelModuleName(3) = "度假模块"
CN_ChannelModuleName(4) = "机票模块"
CN_ChannelModuleName(5) = "景点模块"
CN_ChannelModuleName(6) = "图片模块"
CN_ChannelModuleName(7) = "商城模块"
CN_ChannelModuleName(8) = "租车模块"
CN_ChannelModuleName(9) = "论坛模块"

Select Case Action
   Case "": Call ManageChannel()
   Case "Config": Call ConfigChannel()   
   Case "Add": Call AddChannel()
   Case "SaveNew": Call SaveConfigChannel(0)
   Case "SaveConfig": Call SaveConfigChannel(1)
   Case "MoveUp": Call SaveConfigChannel(2)
   Case "MoveDown": Call SaveConfigChannel(3)   
   Case "Disabled": Call SaveConfigChannel(4)
   Case "Delete": Call SaveConfigChannel(5)
   Case "Clear": Call SaveConfigChannel(6)
End Select
Call EL_Common.Bottom()
Call ApplicationTerminate()

Sub SaveConfigChannel(UpdateType)
   On Error Resume Next
   Dim SaveConfigCmd
   Dim ChannelID, ChannelName, ChannelName_Color, ChannelDir, ChannelPictrue, OpenType, Disabled
   Dim ShowName, ChannelType, LinkURL, ChannelModule, MetaKeywords, MetaDescription, ItemName, ItemUnit
   Dim ClassitemName, ShowPageSize, SkinID, EnableUpload, UploadDir, UploadMaxSize, UploadFileType, ClassNumLine, SendComment
   Dim UploadFileType_Image, UploadFileType_Flash, UploadFileType_WindowMedia, UploadFileType_RealMedia, UploadFileType_Others
   Dim FSO, TruePath
   
   ChannelName = EL_Common.ELRequest("ChannelName", 1)
   ChannelName_Color = EL_Common.ELRequest("ChannelName_Color", 1)
   ChannelDir = EL_Common.ELRequest("ChannelDir", 1)
   ChannelPictrue = EL_Common.ELRequest("ChannelPictrue", 1)
   OpenType = EL_Common.ELRequest("OpenType", 2)
   Disabled = EL_Common.ELRequest("Disabled", 2)
   ShowName = EL_Common.ELRequest("ShowName", 2)
   ChannelType = EL_Common.ELRequest("ChannelType", 2)
   LinkURL = EL_Common.ELRequest("LinkURL", 1)
   ChannelModule = EL_Common.ELRequest("ChannelModule", 2)
   MetaKeywords = EL_Common.ELRequest("MetaKeywords", 1)
   MetaDescription = EL_Common.ELRequest("MetaDescription", 1)
   ItemName = EL_Common.ReplaceBadChar(EL_Common.ELRequest("ItemName", 1))
   ItemUnit = EL_Common.ReplaceBadChar(EL_Common.ELRequest("ItemUnit", 1))
   ClassitemName = EL_Common.ELRequest("ClassitemName", 1)
   ShowPageSize = EL_Common.ELRequest("ShowPageSize", 2)
   SkinID = EL_Common.ELRequest("SkinID", 2)
   EnableUpload = EL_Common.ELRequest("EnableUpload", 2)
   UploadDir = EL_Common.ELRequest("UploadDir", 1)
   UploadMaxSize = EL_Common.ELRequest("UploadMaxSize", 2)
   UploadFileType = EL_Common.ELRequest("UploadFileType", 1)
   ClassNumLine = EL_Common.ELRequest("ClassNumLine", 2)
   SendComment = EL_Common.ELRequest("SendComment", 2)
   
   IF UpdateType = 0 And ChannelType = 0 Then
      TruePath = Server.MapPath(InstallDir & ChannelDir)
      Set FSO = Server.CreateObject(Object_FSO)
	  IF FSO.FolderExists(TruePath) Then
	     EL_Common.ShowErrorMsg("<b>"& ChannelDir &"</b> 目录已存在")
		 Set FSO = Nothing
		 Exit Sub
	  ElseIf FSO.FolderExists(Server.MapPath(InstallDir &"Article")) = False  And ChannelModule = 1 Then
	     EL_Common.ShowErrorMsg("系统"& CN_ChannelModuleName(ChannelModule) &"数据不存在,不能新建频道")
		 Set FSO = Nothing
		 Exit Sub
	  ElseIf FSO.FolderExists(Server.MapPath(InstallDir &"Photos")) = False  And ChannelModule = 6 Then
	     EL_Common.ShowErrorMsg("系统"& CN_ChannelModuleName(ChannelModule) &"数据不存在,不能新建频道")
		 Set FSO = Nothing
		 Exit Sub
	  Else
	     Call FSO.CreateFolder(TruePath)
		 Call FSO.CreateFolder(TruePath &"\Images")
		 Call FSO.CreateFolder(TruePath &"\Js")
		 Call FSO.CreateFolder(TruePath &"\"& UploadDir)
	  End If
   End If
   If ChannelType = 1 Then ChannelModule = 0
   
   Call EL_Common.InitCommand(SaveConfigCmd, "EL_SP_ChannelConfig")
   With SaveConfigCmd
      .Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
      .Parameters.Append .CreateParameter("@UpdateType", 3, 1, 4, UpdateType)
	  IF UpdateType = 0 Then
	     .Parameters.Append .CreateParameter("@ChannelID", 3, 2, 4)
	  Else
	     .Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, EL_Channel.ChannelID)
	  End If
	  .Parameters.Append .CreateParameter("@ChannelName", 200, 1, 20, ChannelName)
	  .Parameters.Append .CreateParameter("@ChannelName_Color", 200, 1, 10, ChannelName_Color)
	  .Parameters.Append .CreateParameter("@ChannelDir", 200, 1, 20, ChannelDir)
	  .Parameters.Append .CreateParameter("@ChannelPictrue", 200, 1, 255, ChannelPictrue)
	  .Parameters.Append .CreateParameter("@OpenType", 3, 1, 4, OpenType)
	  .Parameters.Append .CreateParameter("@Disabled", 11, 1, 1, Disabled)
	  .Parameters.Append .CreateParameter("@ShowName", 11, 1, 1, ShowName)
	  .Parameters.Append .CreateParameter("@ChannelType", 3, 1, 4, ChannelType)
	  .Parameters.Append .CreateParameter("@LinkURL", 200, 1, 255, LinkURL)
	  .Parameters.Append .CreateParameter("@ChannelModule", 3, 1, 4, ChannelModule)
	  .Parameters.Append .CreateParameter("@MetaKeywords", 200, 1, 255, MetaKeywords)
	  .Parameters.Append .CreateParameter("@MetaDescription", 200, 1, 255, MetaDescription)
	  .Parameters.Append .CreateParameter("@ItemName", 200, 1, 10, ItemName)
	  .Parameters.Append .CreateParameter("@ItemUnit", 200, 1, 10, ItemUnit)
	  .Parameters.Append .CreateParameter("@ClassItemName", 200, 1, 10, ClassItemName)
	  .Parameters.Append .CreateParameter("@ShowPageSize", 3, 1, 4, ShowPageSize)
	  .Parameters.Append .CreateParameter("@SkinID", 3, 1, 4, SkinID)
	  .Parameters.Append .CreateParameter("@EnableUpload", 11, 1, 1, EnableUpload)
	  .Parameters.Append .CreateParameter("@UploadDir", 200, 1, 20, UploadDir)
	  .Parameters.Append .CreateParameter("@UploadMaxSize", 3, 1, 4, UploadMaxSize)
	  .Parameters.Append .CreateParameter("@UploadFileType", 200, 1, 255, UploadFileType)
	  .Parameters.Append .CreateParameter("@ClassNumLine", 3, 1, 4, ClassNumLine)
	  .Parameters.Append .CreateParameter("@SendComment", 3, 1, 4, SendComment)
	  .Execute()
   End With
   Select Case SaveConfigCmd(0)
     Case 0:  
	          If UpdateType = 0 Then
	             EL_Common.ShowErrorMsg("添加频道失败<br>产生错误的可能原因:输入数据的长度太长或数据类型不正确")
			  ElseIf UpdateType = 1 Then
			     EL_Common.ShowErrorMsg("配置频道信息失败<br>产生错误的可能原因:输入数据的长度太长或数据类型不正确")
			  End If
	 Case 40: EL_Common.ShowErrorMsg("页面参数错误") : Set SaveConfigCmd = Nothing : Exit Sub
	 Case 41: EL_Common.ShowErrorMsg("频道ID错误") : Set SaveConfigCmd = Nothing : Exit Sub
	 Case 42: EL_Common.ShowErrorMsg("指定频道不存在") : Set SaveConfigCmd = Nothing : Exit Sub
   End Select  
   
   If ChannelType = 0 Then Response.Write "<scr"&"ipt>parent.frames[0].location.reload();</scr"&"ipt>"
   
   If UpdateType = 0 Then
      ChannelID = SaveConfigCmd(2)	  
	  Dim JsFile, SourcePath
      Select Case ChannelModule
	     Case 1:			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Config.asp", True) 
             JsFile.Write "<" & "%"& VBCRLF & VBCRLF &"Const ChannelID = "& ChannelID & VBCRLF & VBCRLF &"%" & ">"
             JsFile.Close()
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\ClassMenuConfig.asp", True) 
             JsFile.Write "4@@0@@0@@2@@3@@6@@7@@100@@filter:Glow(Color=#000000, Strength=3)@@4@@@@23@@50@@2@@4@@#999999@@#FFFFFF@@@@3@@1@@1@@#ACA899@@#ffffff@@0@@@@@@@@-1@@-1@@0@@@@@@@@@@@@@@0@@0@@0@@@@@@0@@0@@0@@0@@1@@#F1F2EE@@1@@#CCCCCC@@1@@@@@@3@@3@@0@@0@@#FFFFF7@@#FFCC00@@#000000@@#FF0000@@9pt 宋体@@9pt 宋体"
             JsFile.Close()
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Js\ShowSearchForm.js", True)
             JsFile.Write SearchFormJs_Article(ChannelID, ChannelDir, EL_Common.ServerHTMLEncode(ItemName), EL_Common.ServerHTMLEncode(ClassItemName))
             JsFile.Close()
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Js\ShowClassMenu.js", True)
             JsFile.Write ClassMenuJs(ChannelID, EL_Common.ServerHTMLEncode(ChannelName), ChannelDir)
             JsFile.Close()
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Js\ClassOption.js", True)
             JsFile.Write ClassOptionJs(EL_Common.ServerHTMLEncode(ClassItemName))
             JsFile.Close()			 
             Set JsFile = Nothing 
			 
			 SourcePath = Server.MapPath(InstallDir &"Article")
			 Call FSO.CopyFile(SourcePath &"\ClassArticle.asp", TruePath &"\ClassArticle.asp")
			 Call FSO.CopyFile(SourcePath &"\ClassChannel.asp", TruePath &"\ClassChannel.asp")
			 Call FSO.CopyFile(SourcePath &"\Comment.asp", TruePath &"\Comment.asp")
			 Call FSO.CopyFile(SourcePath &"\Index.asp", TruePath &"\Index.asp")
			 Call FSO.CopyFile(SourcePath &"\Print.asp", TruePath &"\Print.asp")
			 Call FSO.CopyFile(SourcePath &"\Search.asp", TruePath &"\Search.asp")
			 Call FSO.CopyFile(SourcePath &"\SendToFriend.asp", TruePath &"\SendToFriend.asp")
			 Call FSO.CopyFile(SourcePath &"\ShowArticle.asp", TruePath &"\ShowArticle.asp")
			 Call FSO.CopyFile(SourcePath &"\ShowClass.asp", TruePath &"\ShowClass.asp")
			 Call FSO.CopyFile(SourcePath &"\ShowCommend.asp", TruePath &"\ShowCommend.asp")
			 Call FSO.CopyFolder(SourcePath &"\Images", TruePath &"\Images")
			 
			 Set FSO = Nothing   
		 Case 6:
		     Set JsFile = FSO.CreateTextFile(TruePath &"\Config.asp", True)
             JsFile.Write "<" & "%"& VBCRLF & VBCRLF &"Const ChannelID = "& ChannelID & VBCRLF & VBCRLF &"%" & ">"
             JsFile.Close()	
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\ClassMenuConfig.asp", True) 
             JsFile.Write "4@@0@@0@@2@@3@@6@@7@@100@@filter:Glow(Color=#000000, Strength=3)@@4@@@@23@@50@@2@@4@@#999999@@#FFFFFF@@@@3@@1@@1@@#ACA899@@#ffffff@@0@@@@@@@@-1@@-1@@0@@@@@@@@@@@@@@0@@0@@0@@@@@@0@@0@@0@@0@@1@@#F1F2EE@@1@@#CCCCCC@@1@@@@@@3@@3@@0@@0@@#FFFFF7@@#FFCC00@@#000000@@#FF0000@@9pt 宋体@@9pt 宋体"
             JsFile.Close()		 
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Js\ShowSearchForm.js", True)
             JsFile.Write SearchFormJs_Photo(ChannelID, ChannelDir, EL_Common.ServerHTMLEncode(ItemName), EL_Common.ServerHTMLEncode(ClassItemName))
             JsFile.Close()
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Js\ShowClassMenu.js", True)
             JsFile.Write ClassMenuJs(ChannelID, EL_Common.ServerHTMLEncode(ChannelName), ChannelDir)
             JsFile.Close()
			 
			 Set JsFile = FSO.CreateTextFile(TruePath &"\Js\ClassOption.js", True)
             JsFile.Write ClassOptionJs(EL_Common.ServerHTMLEncode(ClassItemName))
             JsFile.Close()			 
             Set JsFile = Nothing
			 
			 SourcePath = Server.MapPath(InstallDir &"Photos")
			 Call FSO.CopyFile(SourcePath &"\ClassPhoto.asp", TruePath &"\ClassPhoto.asp")
			 Call FSO.CopyFile(SourcePath &"\ClassChannel.asp", TruePath &"\ClassChannel.asp")
			 Call FSO.CopyFile(SourcePath &"\Comment.asp", TruePath &"\Comment.asp")
			 Call FSO.CopyFile(SourcePath &"\Index.asp", TruePath &"\Index.asp")
			 Call FSO.CopyFile(SourcePath &"\Search.asp", TruePath &"\Search.asp")
			 Call FSO.CopyFile(SourcePath &"\SendToFriend.asp", TruePath &"\SendToFriend.asp")
			 Call FSO.CopyFile(SourcePath &"\ShowPhoto.asp", TruePath &"\ShowPhoto.asp")
			 Call FSO.CopyFile(SourcePath &"\ShowClass.asp", TruePath &"\ShowClass.asp")
			 Call FSO.CopyFile(SourcePath &"\ShowCommend.asp", TruePath &"\ShowCommend.asp")
			 Call FSO.CopyFolder(SourcePath &"\Images", TruePath &"\Images")
			 
			 Set FSO = Nothing 
	  End Select
	  EL_Common.ShowSuccessMsg("成功添加新频道:<span class=bluetext>"& ChannelName &"</span>")	  
   ElseIf UpdateType = 1 Then
      If EL_Common.FoundInArray(Split(Cache_Channel, ","), CStr(EL_Channel.ChannelID)) Then	
			Call EL_Cache.RemoveCache("Channel."& EL_Channel.ChannelID)
	  End If	  	  
	  EL_Common.ShowSuccessMsg("更新频道配置成功")
   Else
      Set SaveConfigCmd = Nothing
	  If EL_Common.FoundInArray(Split(Cache_Channel, ","), CStr(EL_Channel.ChannelID)) Then	
			Call EL_Cache.RemoveCache("Channel."& EL_Channel.ChannelID)
	  End If
	  EL_Common.ShowScriptError()
	  If ComeURL = "" Then ComeURL = "Admin_Channel.asp"
      Response.Write "<script>location.href='"& Replace(ComeURL, "'", "\'") &"';</script>"
   End If   
   Set SaveConfigCmd = Nothing   
   EL_Common.ShowScriptError()
End Sub


Function ClassOptionJs(ByVal ClassItemName)
   ClassOptionJs = "document.write(""<option>请先添加"& ClassItemName &"</option>"");"
End Function

Function SearchFormJs_Article(ByVal ChannelID, ByVal ChannelDir, ByVal ItemName, ByVal ClassItemName)
   Dim f0, f1, f2, f3, f4, f5, JString
   f0 = EL_Common.ReplaceText(EL_Common.Lang("Article.SearchField.f0", ""), "\{\$ItemName\}", ItemName)
   f1 = EL_Common.ReplaceText(EL_Common.Lang("Article.SearchField.f1", ""), "\{\$ItemName\}", ItemName)
   f2 = EL_Common.ReplaceText(EL_Common.Lang("Article.SearchField.f2", ""), "\{\$ItemName\}", ItemName)
   f3 = EL_Common.ReplaceText(EL_Common.Lang("Article.SearchField.f3", ""), "\{\$ClassItemName\}", ClassItemName)
   f4 = EL_Common.ReplaceText(EL_Common.Lang("Article.SearchField.f4", ""), "\{\$ItemName\}", ItemName)
		 
   JString = "document.write(""<table border='0' cellpadding='0' cellspacing='0'><form name='Search_"& ChannelID &"' id='Search_"& ChannelID &"' action='"& InstallDir & ChannelDir &"/Search.asp' method='get'>"
   JString = JString &"<tr><td>"
   JString = JString &"<select name='Field' id='Field'>"
   JString = JString &"<option value='Title' selected>"& f0 &"</option>"
   JString = JString &"<option value='Content'>"& f1 &"</option>"
   JString = JString &"<option value='Author'>"& f2 &"</option>"
   JString = JString &"</select> "
   JString = JString &"<select name='ClassID' id='ClassID'><option value='0'>"& f3 &"</option>"
   JString = JString & "<option>请先添加"& ClassItemName &"</option>"
   JString = JString &"</select> "
   JString = JString &"<input type='text' name='Keyword'  size='20' value='' maxlength='50' class='search_keyword'> "
   JString = JString &"<input type='submit' value=' "& f4 &" ' class='search_btn'>"
   JString = JString &"</td></tr></form></table>"");"
   SearchFormJs_Article = JString
End Function

Function SearchFormJs_Photo(ByVal ChannelID, ByVal ChannelDir, ByVal ItemName, ByVal ClassItemName)
   Dim f0, f1, f2, f3, f4, JString
   f0 = EL_Common.ReplaceText(EL_Common.Lang("Photo.SearchField.f0", ""), "\{\$ItemName\}", ItemName)
   f1 = EL_Common.ReplaceText(EL_Common.Lang("Photo.SearchField.f1", ""), "\{\$ItemName\}", ItemName)
   f2 = EL_Common.ReplaceText(EL_Common.Lang("Photo.SearchField.f2", ""), "\{\$ItemName\}", ItemName)
   f3 = EL_Common.ReplaceText(EL_Common.Lang("Photo.SearchField.f3", ""), "\{\$ClassItemName\}", ClassItemName)
   f4 = EL_Common.ReplaceText(EL_Common.Lang("Photo.SearchField.f4", ""), "\{\$ItemName\}", ItemName)
		 
   JString = "document.write(""<table border='0' cellpadding='0' cellspacing='0'><form name='Search_"& ChannelID &"' id='Search_"& ChannelID &"' action='"& InstallDir & ChannelDir &"/Search.asp' method='get'>"
   JString = JString &"<tr><td>"
   JString = JString &"<select name='Field' id='Field'>"

⌨️ 快捷键说明

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