📄 ad_class_photo.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=4
Const PurviewLevel_Photo=1
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/ad_code_photo.asp"-->
<%
dim Action,ParentID,SkinID,LayoutID,BrowsePurview,AddPurview,i,FoundErr,ErrMsg
dim SkinCount,LayoutCount
Action=trim(Request("Action"))
ParentID=trim(request("ParentID"))
if ParentID="" then
ParentID=0
else
ParentID=CLng(ParentID)
end if
%>
<html>
<head>
<title>图片栏目管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="ad_Style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>图 片 栏 目 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="ad_Class_Photo.asp">图片栏目管理首页</a> | <a href="ad_Class_Photo.asp?Action=Add">添加图片栏目</a> | <a href="ad_Class_Photo.asp?Action=Order">一级栏目排序</a> | <a href="ad_Class_Photo.asp?Action=OrderN">N级栏目排序</a> | <a href="ad_Class_Photo.asp?Action=Reset">复位所有图片栏目</a> | <a href="ad_Class_Photo.asp?Action=Unite">图片栏目合并</a></td>
</tr>
</table>
<%
if Action="Add" then
call AddClass()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="Move" then
call MoveClass()
elseif Action="SaveMove" then
call SaveMove()
elseif Action="Del" then
call DeleteClass()
elseif Action="Clear" then
call ClearClass()
elseif Action="UpOrder" then
call UpOrder()
elseif Action="DownOrder" then
call DownOrder()
elseif Action="Order" then
call Order()
elseif Action="UpOrderN" then
call UpOrderN()
elseif Action="DownOrderN" then
call DownOrderN()
elseif Action="OrderN" then
call OrderN()
elseif Action="Reset" then
call Reset()
elseif Action="SaveReset" then
call SaveReset()
elseif Action="Unite" then
call Unite()
elseif Action="SaveUnite" then
call SaveUnite()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
dim arrShowLine(10)
for i=0 to ubound(arrShowLine)
arrShowLine(i)=False
next
dim sqlClass,rsClass,i,iDepth
sqlClass="select * From PhotoClass order by RootID,OrderID"
set rsClass=server.CreateObject("adodb.recordset")
rsClass.open sqlClass,conn,1,1
%>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class="title">
<td height="22" align="center"><strong>栏目名称</strong></td>
<td width="100" align="center"><strong>管理员</strong></td>
<td width="80" align="center"><strong>栏目属性</strong></td>
<td width="60" align="center"><strong>浏览权限</strong></td>
<td width="60" align="center"><strong>添加权限</strong></td>
<td width="300" height="22" align="center"><strong>操作选项</strong></td>
</tr>
<%
do while not rsClass.eof
%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td> <%
iDepth=rsClass("Depth")
if rsClass("NextID")>0 then
arrShowLine(iDepth)=True
else
arrShowLine(iDepth)=False
end if
if iDepth>0 then
for i=1 to iDepth
if i=iDepth then
if rsClass("NextID")>0 then
response.write "<img src='images/tree_line1.gif' width='17' height='16' valign='abvmiddle'>"
else
response.write "<img src='images/tree_line2.gif' width='17' height='16' valign='abvmiddle'>"
end if
else
if arrShowLine(i)=True then
response.write "<img src='images/tree_line3.gif' width='17' height='16' valign='abvmiddle'>"
else
response.write "<img src='images/tree_line4.gif' width='17' height='16' valign='abvmiddle'>"
end if
end if
next
end if
if rsClass("Child")>0 then
response.write "<img src='Images/tree_folder4.gif' width='15' height='15' valign='abvmiddle'>"
else
response.write "<img src='Images/tree_folder3.gif' width='15' height='15' valign='abvmiddle'>"
end if
if rsClass("Depth")=0 then
response.write "<b>"
end if
response.write "<a href='ad_Class_Photo.asp?Action=Modify&ClassID=" & rsClass("ClassID") & "' title='" & rsClass("ReadMe") & "'>" & rsClass("ClassName") & "</a>"
if rsClass("Child")>0 then
response.write "(" & rsClass("Child") & ")"
end if
'response.write " " & rsClass("ClassID") & "," & rsClass("PrevID") & "," & rsClass("NextID") & "," & rsClass("ParentID") & "," & rsClass("RootID")
%> </td>
<td> <%
if rsClass("ClassMaster")<>"" then
response.write rsClass("ClassMaster")
else
response.write " "
end if
%> </td>
<td width="80" align="center"> <%
if rsClass("LinkUrl")<>"" then
response.write "<font color=red>外部</font>,"
else
response.write "<font color=green>系统</font>,"
end if
if rsClass("IsElite")=True then
response.write "<font color=blue>推荐</font>"
else
response.write "普通"
end if
%> </td>
<td align="center"> <%
select case rsClass("BrowsePurview")
case 9999
response.write "游客"
case 999
response.write "注册用户"
case 99
response.write "收费用户"
case 9
response.write "VIP用户"
case 5
response.write "管理员"
end select%> </td>
<td align="center">
<%
select case rsClass("AddPurview")
case 999
response.write "注册用户"
case 99
response.write "收费用户"
case 9
response.write "VIP用户"
case 5
response.write "管理员"
end select%>
</td>
<td align="center"><a href="ad_Class_Photo.asp?Action=Add&ParentID=<%=rsClass("ClassID")%>">添加子栏目</a>
| <a href="ad_Class_Photo.asp?Action=Modify&ClassID=<%=rsClass("ClassID")%>">修改设置</a>
| <a href="ad_Class_Photo.asp?Action=Move&ClassID=<%=rsClass("ClassID")%>">移动栏目</a>
| <a href="ad_Class_Photo.asp?Action=Clear&ClassID=<%=rsClass("ClassID")%>" onClick="return ConfirmDel3();">清空</a>
| <a href="ad_Class_Photo.asp?Action=Del&ClassID=<%=rsClass("ClassID")%>" onClick="<%if rsClass("Child")>0 then%>return ConfirmDel1();<%else%>return ConfirmDel2();<%end if%>">删除</a></td>
</tr>
<%
rsClass.movenext
loop
%>
</table>
<script language="JavaScript" type="text/JavaScript">
function ConfirmDel1()
{
alert("此栏目下还有子栏目,必须先删除下属子栏目后才能删除此栏目!");
return false;
}
function ConfirmDel2()
{
if(confirm("删除栏目将同时删除此栏目中的所有图片,并且不能恢复!确定要删除此栏目吗?"))
return true;
else
return false;
}
function ConfirmDel3()
{
if(confirm("清空栏目将把栏目(包括子栏目)的所有图片放入回收站中!确定要清空此栏目吗?"))
return true;
else
return false;
}
</script>
<br><br>
<%
end sub
sub AddClass()
%>
<form name="form1" method="post" action="ad_Class_Photo.asp" onsubmit="return check()">
<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="350"><strong>所属栏目:</strong><br>
不能指定为外部栏目 </td>
<td> <select name="ParentID">
<%call Admin_ShowClass_Option(0,ParentID)%>
</select></td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目名称:</strong></td>
<td><input name="ClassName" type="text" size="37" maxlength="20"></td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目说明:<br>
</strong> 鼠标移至栏目名称上时将显示设定的说明文字(不支持HTML)</td>
<td><textarea name="Readme" cols="30" rows="4" id="Readme"></textarea></td>
</tr>
<tr class="tdbg">
<td><strong>是否是推荐栏目:</strong><br>
推荐栏目将在首页及此栏目的父栏目上显示图片列表</td>
<td><input name="IsElite" type="radio" value="Yes" checked>
是 <input type="radio" name="IsElite" value="No">
否 </td>
</tr>
<tr class="tdbg">
<td><strong>是否在顶部导航栏显示:</strong><br>
只选项只对一级栏目有效。</td>
<td><input name="ShowOnTop" type="radio" value="Yes" checked>
是 <input type="radio" name="ShowOnTop" value="No">
否 </td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目配色模板:</strong><br>
相关模板中包含CSS、颜色、图片等信息</td>
<td><%call Admin_ShowSkin_Option(SkinID)%></td>
</tr>
<tr class="tdbg">
<td width="350"><strong>版面设计模板:</strong><br>
相关模板中包含了栏目设计的版式等信息,如果是自行添加的设计模板,可能会导致“栏目配色模板”失效。 </td>
<td><%call Admin_ShowLayout_Option(6,LayoutID)%></td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目图片地址:</strong><br>
图片会显示在栏目前面。注意图片大小。</td>
<td><input name="ClassPicUrl" type="text" id="ClassPicUrl" size="37" maxlength="255">
(预留功能)</td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目编辑:</strong><br>
多个编辑请用“|”分隔,如:ark|dilys|sws2000<br>
无需添加“图片总编”以上级别的管理员<br>
管理员权限采用权限继承制度</td>
<td><input name="ClassMaster" type="text" id="ClassMaster" size="37" maxlength="100">
</td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目链接地址:</strong><br>
如果想将栏目链接到外部地址,请输入完整的URL地址,否则请保持为空。</td>
<td><input name="LinkUrl" type="text" id="LinkUrl" size="37" maxlength="255" disabled></td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目浏览权限:</strong><br>
只有具有相应权限的人才能浏览此栏目中的图片。</td>
<td><select name="BrowsePurview" id="BrowsePurview">
<option value="9999" <%if BrowsePurview=9999 then response.write " selected"%>>游客</option>
<option value="999" <%if BrowsePurview=999 then response.write " selected"%>>注册用户</option>
<option value="99" <%if BrowsePurview=99 then response.write " selected"%>>收费用户</option>
<option value="9" <%if BrowsePurview=9 then response.write " selected"%>>VIP用户</option>
<option value="5" <%if BrowsePurview=5 then response.write " selected"%>>管理员</option>
</select></td>
</tr>
<tr class="tdbg">
<td width="350"><strong>栏目发表图片权限:</strong><br>
只有具有相应权限的人才能在此栏目中发表图片。</td>
<td><select name="AddPurview" id="AddPurview">
<option value="999" <%if AddPurview=999 then response.write " selected"%>>注册用户</option>
<option value="99" <%if AddPurview=99 then response.write " selected"%>>收费用户</option>
<option value="9" <%if AddPurview=9 then response.write " selected"%>>VIP用户</option>
<option value="5" <%if AddPurview=5 then response.write " selected"%>>管理员</option>
</select></td>
</tr>
<tr class="tdbg">
<td height="40" colspan="2" align="center"><input name="Action" type="hidden" id="Action" value="SaveAdd">
<input name="Add" type="submit" value=" 添 加 " <%if SkinCount=0 or LayoutCount=0 then response.write " disabled"%> style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='ad_Class_Photo.asp'" style="cursor:hand;">
<%if SkinCount=0 then response.write "<li><font color=red>请先添加栏目配色模板</font></li>"
if SkinCount=0 then response.write "<li><font color=red>请先添加栏目栏目设计模板</font></li>" %></td>
</tr>
</table>
</form>
<script language="JavaScript" type="text/JavaScript">
function check()
{
if (document.form1.ClassName.value=="")
{
alert("栏目名称不能为空!");
document.form1.ClassName.focus();
return false;
}
}
</script>
<%
end sub
sub Modify()
dim ClassID,sql,rsClass,i
ClassID=trim(request("ClassID"))
if ClassID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
exit sub
else
ClassID=CLng(ClassID)
end if
sql="select * From PhotoClass where ClassID=" & ClassID
set rsClass=server.CreateObject ("Adodb.recordset")
rsClass.open sql,conn,1,3
if rsClass.bof and rsClass.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的栏目!</li>"
else
%>
<form name="form1" method="post" action="ad_Class_Photo.asp" onsubmit="return check()">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -