📄 admin_channel.asp
字号:
<!--#include file="Inc/Const.asp"-->
<!--#include file="../Inc/Cl_Function_Article.asp"-->
<!--#include file="../Inc/Cl_Function_Soft.asp"-->
<!--#include file="../Inc/Cl_Function_Photo.asp"-->
<!--#include file="../Inc/Cl_Function_Movie.asp"-->
<!--#include file="../Inc/Cl_Function_Product.asp"-->
<%
if Not Cl.TrueOtherPurview("Channel") then
Cl.ShowErr("<br /><li>您无此操作权限!</li>")
end if
dim Action',ChannelID
dim iCount,j
'ChannelType 0为系统,1为内部,2为外部
Action=Trim(request("Action"))
Header
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="title">
<td height="22" colspan="2" align="center"><strong>网 站 频 道 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td><a href="Admin_Channel.asp">频道管理首页</a> | <a href="Admin_Channel.asp?Action=Add">添加新频道</a> | <a href="Admin_Channel.asp?Action=OrderID">修改频道排序</a> | <a href="Admin_Channel.asp?Action=SelectStyle">批量选择模板/Css</a></td>
</tr>
</table>
<%
Select Case Action
Case "Add"
call ChannelInfo()
Case "SaveAdd"
call SaveChannelInfo()
Case "Modify"
call ChannelInfo()
Case "SaveModify"
call SaveChannelInfo()
Case "Del"
call DelChannel()
Case "OrderID"
call OrderID()
Case "UpOrder"
call UpOrder()
Case "DownOrder"
call DownOrder()
Case "SelectStyle"
call SelectStyle()
Case "UpdateStyle"
call UpdateStyle()
Case "UpdateStyleAll"
call UpdateStyleAll()
Case "RefreshChannelJs"
call RefreshChannelJs()
Call Cl.OutMsg(0,"恭喜您,所有频道Js刷新成功!","Admin_Channel.asp")
Case "IsShow"
Call IsShow()
Case "CIsShow"
Call CIsShow()
Case "IsDisabled"
Call IsDisabled()
Case "CIsDisabled"
Call CIsDisabled()
Case "OWindow"
Call OWindow()
Case "NWindow"
Call NWindow()
Case "Update"
Call UpdateChannel()
Case "ShowDIY"
Call ShowDIYChannel()
Case "SaveDIY"
Call SaveDIYChannel()
Case else
call main()
end Select
Footer
Sub Main()
Dim SQL
SQL = "select ChannelID,ChannelName,ChannelItemName,ChannelItemUnit,ChannelDir,LinkUrl,OrderID,ChannelType,OpenType,IsShow,IsDisabled,IsCreateHtml,ModuleID from Cl_Channel order by OrderID"
Set rs=Cl.Execute(SQL)
%>
<br />
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="title">
<td width="50" align="center"><strong>频道ID</strong></td>
<td height="22" align="center" width="80"><strong>频道名称</strong></td>
<td align="center"><strong>目录或链接地址</strong></td>
<td width="60" align="center"><strong>模块</strong></td>
<td width="60" align="center"><strong>显示</strong></td>
<td width="60" align="center"><strong>禁用</strong></td>
<td width="60" height="22" align="center"><strong>打开方式</strong></td>
<td width="50" align="center"><strong>排序ID</strong></td>
<td width="60" align="center"><strong>属性</strong></td>
<td width="130" height="22" align="center"><strong>常规操作</strong></td>
</tr>
<%
if Not (rs.Bof and rs.Eof) then
SQL=rs.GetRows(-1)
For i=0 to Ubound(SQL,2)
%>
<tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
<td width="50" align="center"> <b><%=SQL(0,i)%></b> </td>
<td align="center" width="80"><%=SQL(1,i)%></td>
<td><%
if SQL(7,i)>1 Or SQL(0,i)=10 then
response.write Cl.ReplaceDir(SQL(5,i))
else
response.write SQL(4,i)
end if
%></td>
<td width="60" align="center"><%
Select Case SQL(12,i)
Case 1 : response.write "文章"
Case 2 : response.write "下载"
Case 3 : response.write "图片"
Case 4 : response.write "影视"
Case 5 : response.write "商城"
Case 6 : response.write "留言"
Case Else : response.write "未定义"
End Select
%></td>
<td width="60" align="center"><%
if SQL(9,i)=0 then
response.write "<a href='Admin_Channel.asp?Action=IsShow&ChannelID=" & SQL(0,i) & "'><font color=#ff0033>不显示</font></a>"
else
response.write "<a href='Admin_Channel.asp?Action=CIsShow&ChannelID=" & SQL(0,i) & "'><font color=#0000ff>显示</font></a>"
end if
%></td>
<td width="60" align="center"><%
if SQL(10,i)=0 then
response.write "<a href='Admin_Channel.asp?Action=IsDisabled&ChannelID=" & SQL(0,i) & "'><font color=#0000ff>使用</font></a>"
else
response.write "<a href='Admin_Channel.asp?Action=CIsDisabled&ChannelID=" & SQL(0,i) & "'><font color=#ff0033>禁用</font></a>"
end if
%></td>
<td width="60" align="center"><%
if SQL(8,i)=1 then
response.write "<a href='Admin_Channel.asp?Action=OWindow&ChannelID=" & SQL(0,i) & "'><font color=#ff0033>新窗口</font></a>"
else
response.write "<a href='Admin_Channel.asp?Action=NWindow&ChannelID=" & SQL(0,i) & "'><font color=#0000ff>原窗口</font></a>"
end if
%></td>
<td width="50" align="center"> <%=SQL(6,i)%> </td>
<td width="60" align="center">
<%
Select Case SQL(7,i)
Case 0
response.write "<font color=#ff0033>系统</font>"
if SQL(11,i)=1 then response.write "/<font color=blue>Html</font>"
Case 1
response.write "<font color=#006600>内部</font>"
if SQL(11,i)=1 then response.write "/<font color=blue>Html</font>"
Case else
response.write "外部"
end Select
%>
</td>
<td width="130" align="center"><%
response.write "<a href='Admin_Channel.asp?Action=Modify&ChannelID=" & SQL(0,i) & "'>修改</a> "
If SQL(7,i)<2 then
response.write "<a href='Admin_Channel.asp?Action=ShowDIY&ChannelID=" & SQL(0,i) & "'>自定义</a> "
Else
response.write "<font color=#888888>自定义</font> "
End if
if SQL(0,i)=0 then
response.write "<font color=#888888>删除</font> "
response.write "<font color=#888888>更新</font>"
else
Select Case SQL(7,i)
Case 2
response.write "<a href='Admin_Channel.asp?Action=Del&ChannelID=" & SQL(0,i) & "' onClick=""return confirm('确定要删除此频道吗?\n\n注意:如果是内部频道,此操作将会删除频道相关的所有数据(包括此频道模板及频道目录文件夹),此操作不可恢复!');"">删除</a> "
response.write "<font color=#888888>更新</font>"
Case 1
response.write "<a href='Admin_Channel.asp?Action=Del&ChannelID=" & SQL(0,i) & "' onClick=""return confirm('确定要删除此频道吗?\n\n注意:如果是内部频道,此操作将会删除频道相关的所有数据(包括此频道模板及频道目录文件夹),此操作不可恢复!');"">删除</a> "
response.write "<a href='Admin_Channel.asp?Action=Update&ChannelID=" & SQL(0,i) & "' onClick=""return confirm('确定要更新此频道吗?\n\n注意:更新此频道将更新相应的JS,统计信息,及频道文件!');"">更新</a>"
Case else
response.write "<font color=#888888>删除</font> "
response.write "<a href='Admin_Channel.asp?Action=Update&ChannelID=" & SQL(0,i) & "' onClick=""return confirm('确定要更新此频道吗?\n\n注意:更新此频道将更新相应的JS,统计信息,及频道文件!');"">更新</a>"
end Select
end if
%></td>
</tr>
<%
Next
SQL=Empty
End if
if Cl.Web_Info(15) = "1" then
%>
<form name="formRefresh" method="Post" action="Admin_Channel.asp">
<tr class="tdbg">
<td height="40" colspan="10" align="center">
<input name="Action" type="hidden" id="Action" value="RefreshChannelJs">
<input name="Submit" type="submit" value=" 刷新所有频道JS文件 "></td>
</tr>
</form>
<%end if%>
</table>
<%
rs.Close:set rs=Nothing
end sub
sub ChannelInfo()
Dim ChannelID,sTemp,ChkDisabled
Dim ChannelName,ReadMe,OpenType,IsShow,IsDisabled,ChannelType,LinkUrl,IsRss,IsWap
Dim ModuleID,ChannelDir,ChannelItemName,ChannelItemUnit
Dim IsCreateHtml,CreatePathType,CreateFileType,CreateFileExt,IsCreateList,AutoCreateList
Dim UploadSetting,OtherSetting,ServerProjectID
Dim CLogo,CBanner
Dim DefaultProject,DefaultTemplate,DefaultCss
Dim sAction,SubmitValue
if Action = "Modify" then
sAction="SaveModify":SubmitValue="修 改"
ChannelID = Trim(Request("ChannelID"))
if Not IsNumeric(ChannelID) then
Cl.ShowErr("<br /><li>请指定要修改频道ID</li>")
end if
set rs=Cl.Execute("select * from Cl_Channel where ChannelID=" & Clng(ChannelID))
if rs.bof and rs.eof then
rs.close : set rs = Nothing
Cl.ShowErr("<br /><li>找不到指定的频道!</li>")
end if
ChannelName = rs("ChannelName") : ReadMe = rs("ReadMe")
OpenType = rs("OpenType") : ChannelType = rs("ChannelType")
IsShow = rs("IsShow") : LinkUrl = rs("LinkUrl")
ModuleID = rs("ModuleID") : ChannelDir = rs("ChannelDir")
ChannelItemName = rs("ChannelItemName") : ChannelItemUnit = rs("ChannelItemUnit")
IsCreateHtml = rs("IsCreateHtml") : CreatePathType = rs("CreatePathType")
CreateFileType = rs("CreateFileType") : CreateFileExt = rs("CreateFileExt")
IsCreateList = rs("IsCreateList") : AutoCreateList = rs("AutoCreateList")
CLogo = rs("Logo") : CBanner = rs("Banner")
IsDisabled = rs("IsDisabled"):IsRss = rs("IsRss"):IsWap = rs("IsWap")
ServerProjectID = rs("ServerProjectID")
OtherSetting = Split(Rs("OtherSetting"),",")
DefaultProject = Split(Rs("DefaultProject"),",")
DefaultTemplate = Split(Rs("DefaultTemplate"),",")
DefaultCss = Split(Rs("DefaultCss"),",")
if Ubound(OtherSetting)<9 then Redim OtherSetting(9)
if IsNull(rs("UploadSetting")) or rs("UploadSetting")="" then
UploadSetting=Split("1,2,3,4@Other@2@0@jpg|gif|bmp|png@100@1@swf@500@1@rm|mp3|wav|mid|avi|mpg|mpeg|asf|wma@2048@1@rar|zip|exe|doc|xls|chm@2048@1","@")
else
UploadSetting=Split(rs("UploadSetting"),"@")
'if Ubound(UploadSetting)<15 then
'UploadSetting=Split("4@Other@2@0@jpg|gif|bmp|png@100@1@swf@500@1@rm|mp3|wav|mid|avi|mpg|mpeg|asf|wma@2048@1@rar|zip|exe|doc|xls|chm@2048@1","@")
'end if
end if
ChkDisabled="Disabled"
rs.close : set rs = Nothing
else
sAction = "SaveAdd" : SubmitValue = "添 加"
OpenType = 1 : ChannelType = 1 : IsShow = 1 : ModuleID = 1
IsCreateHtml = 0 : CreatePathType = 0 : CreateFileType = 0 : CreateFileExt = "html"
IsCreateList = 1 : AutoCreateList = 1
CLogo = "" : CBanner = "" : IsDisabled = 0 : ServerProjectID=0
UploadSetting=Split("1,2,3,4@Other@2@0@jpg|gif|bmp|png@100@1@swf@500@1@rm|mp3|wav|mid|avi|mpg|mpeg|asf|wma@2048@1@rar|zip|exe|doc|xls|chm@2048@1","@")
OtherSetting=Array(0,12,1,20,20,20,20,20,10,20)
DefaultProject = Array(0,0,0,0,0,0,0,0)
DefaultTemplate = Array(0,0,0,0,0,0,0,0)
DefaultCss = Array(0,0,0,0,0,0,0,0)
ChkDisabled=""
end If
Dim ShowCreateSelect
if IsCreateHtml<>1 Then ShowCreateSelect = " style='display:none;'"
%>
<br />
<script language="JavaScript" type="text/javascript">
function CheckForm()
{
if (document.form1.ChannelName.value == "") {
alert("请输入频道名称!");
document.form1.ChannelName.focus();
return false;
}
if (document.getElementById('OuterChannel').style.display == 'none'){
var str="<%=Action%>";
if (document.form1.ChannelDir.value == "" && str=="Add"){
alert("请输入频道目录!");
document.form1.ChannelDir.focus();
return false;
}
if (document.form1.ChannelItemName.value == "") {
alert("请输入频道项目名称!");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -