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

📄 admin_article_catalog.asp

📁 动感系统XP Access版,服务器需要安装Jmail 组件 配置SendMessages.asp 最后部分的参数
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/function.asp" -->
<HTML><HEAD><TITLE>后台管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="admin.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<!-- #include file="admin_header.asp" -->
<table width="100%" border="0" cellspacing="2">
  <tr>
    <td width="20%" align="center" valign="top" class="tdbgleft"><!-- #include file="Admin_Left.asp" --></td> 
    <td  class="b1" valign="top">
<%
	dim str
if not isnull(cUserName) and cUserName<>"" then 
	if chkMaster(cUserName) then   	
		call main()
	else
		msgtitle="栏目管理"
 		msginfo="<li>操作错误,你不是系统管理员,没有权限进行此项操作!</li>" 
  		call Sysmsg(msgtitle,msginfo) 
  	end if
else
	msgtitle="栏目管理"
	msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.asp"" target=_top>点此登录系统</a></li>" 
	call Sysmsg(msgtitle,msginfo) 
end if
	sub main()
%>
      <table width="100%" border="0" cellspacing="1" cellpadding="3"  align=center>
        <tr> 
          <td width="100%" class="tdbg1" colspan=2>栏目管理 </td>
</tr>
<tr>
<td colspan=2>
<p class="tdbg2"><B>注意</B>:<BR>
              ①删除栏目同时将删除该栏目下所有帖子!删除分类同时删除下属栏目和其中文章! 操作时请完整填写表单信息。<BR>
              ②如果选择<B>复位所有版面</B>,则所有版面都将作为一级栏目(分类),这时您需要重新对各个版面进行归属的基本设置,<B>不要轻易使用该功能</B>,仅在做出了错误的设置而无法复原版面之间的关系和排序的时候使用
</td>
</tr>
<tr>
<td>
<B>栏目操作选项</B></td>
          <td class="tdbg2"><a href="Admin_Article_Catalog.asp">栏目管理首页</a> | <a href="Admin_Article_Catalog.asp?action=add">新建栏目版面</a> 
            | <a href="?action=orders">一级分类排序</a> | <a href="?action=boardorders">N级分类排序</a> 
            | <a href="?action=RestoreBoard" onclick="{if(confirm('复位所有版面将把所有版面恢复成为一级大分类,复位后要对所有版面重新进行归属的基本设置,请慎重操作,确定复位吗?')){return true;}return false;}">复位所有版面</a> 
          </td>
</tr>
</table>

<%
select case Request("action")
case "add"
	call add()
case "edit"
	call edit()
case "savenew"
	call savenew()
case "savedit"
	call savedit()
case "del"
	call del()
case "orders"
	call orders()
case "updatorders"
	call updateorders()
case "boardorders"
	call boardorders()
case "updatboardorders"
	call updateboardorders()
case "addclass"
	call addclass()
case "saveclass"
	call saveclass()
case "RestoreBoard"
	call RestoreBoard()
case else
	call CatalogInfo()
end select
end sub

sub CatalogInfo()
 %>
      <table width="100%" cellspacing="1" cellpadding="2" align=center>
        <tr class="tdbg1"> 
          <td width="35%"><strong>栏目版面</strong> </td>
          <td width="35%"><strong>操作</strong> </td>
</tr>
<%
sql="select * from info_Catalog order by rootid,orders"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
%>
        <tr class="tdbg2"> 
          <td width=35% > 
            <%
 if rs("depth") =1 then  Response.Write "&nbsp;&nbsp;<font color=""#666666"">├</font>"
 if rs("depth") >1 then
 for i=2 to rs("depth")
	Response.Write "&nbsp;&nbsp;<font color=""#666666"">│</font>"
 next
 Response.Write "&nbsp;&nbsp;<font color=""#666666"">├</font> "
 end if
 
  if rs("parentid")=0 then Response.Write("<b>")
  Response.Write rs("CatalogName")
  if rs("child")>0 then Response.Write "("&rs("child")&")"
  %>
          </td>
          <td width=65% align=right><a href="Admin_Article_Catalog.asp?action=add&editid=<%=rs("CatalogID")%>">添加版面</a> 
            | <a href="Admin_Article_Catalog.asp?action=edit&editid=<%=rs("CatalogID")%>">版面设置</a> 
            | 
            <%if rs("child")=0 then%>
            <a href="Admin_Article_Catalog.asp?action=del&editid=<%=rs("CatalogID")%>" onclick="{if(confirm('删除将包括该栏目的所有帖子,确定删除吗?')){return true;}return false;}">删除 
            <% else %><a href="#" onclick="{if(confirm('该栏目含有下属栏目,必须先删除其下属栏目方能删除本栏目!')){return true;}return false;}"> 
            删除</a> 
            <%end if%>
          </td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
<% 
end sub 

sub add()
set rs = server.CreateObject ("Adodb.recordset")
	sql="select Max(CatalogID) from info_Catalog"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
	CatalogNum=1
	else
	CatalogNum=rs(0)+1
	end if
	if isnull(CatalogNum) then CatalogNum=1
	rs.close
%>
<form action ="Admin_Article_Catalog.asp?action=savenew" method=post>
<input type="hidden" name="newCatalogID" value="<%=CatalogNum%>">
        <table width="100%" border="0" cellspacing="1" cellpadding="3"  align=center>
          <tr> 
            <td height=24 colspan=2 class="tdbg1"><strong>添加新栏目</strong></td>
</tr>
          <tr class="tdbg2"> 
            <td width="52%" height=30><U>栏目名称</U></td>
            <td width="48%"> 
              <input type="text" name="CatalogName" size="35">
</td>
</tr>
          <tr class="tdbg2"> 
            <td width="52%" height=24><U>栏目说明</U></td>
            <td width="48%"> 
              <textarea name="Readme" cols="40" rows="5"></textarea>
</td>
</tr>
          <tr class="tdbg2"> 
            <td width="52%" height=30><U>所属类别</U></td>
            <td width="48%"> 
              <select name="class">
<option value="0">做为栏目分类</option>
<%
sql = "select * from info_Catalog order by rootid,orders"
rs.open sql,conn,1,1
 do while not rs.eof 
 Response.Write "<option value="""&rs("CatalogID")&""" "
 if request("editid")<>"" and clng(request("editid"))=rs("CatalogID") then Response.Write "selected"
 Response.Write ">"
 if rs("depth") =1 then  Response.Write "&nbsp;&nbsp;├ "
 if rs("depth") >1 then
 for i=2 to rs("depth")
	Response.Write "&nbsp;&nbsp;│"
 next
 Response.Write "&nbsp;&nbsp;├ "
 end if
 Response.Write rs("CatalogName")&"</option>" & vbcrlf
 rs.MoveNext
 loop
 rs.Close 
%>
</select>
</td>
          <tr class="tdbg2"> 
            <td width="52%" height=24>&nbsp;</td>
            <td width="48%"> 
              <input type="submit" name="Submit" value="添加栏目">
</td>
</tr>
</table>
</form>
<%
set rs=nothing
end sub

sub edit()
set rs = server.CreateObject ("Adodb.recordset")
dim rs_e
sql = "select * from info_Catalog where CatalogID="&request("editid")
set rs_e=conn.execute(sql)
%>
<form action ="Admin_Article_Catalog.asp?action=savedit" method=post>
<input type="hidden" name=editid value="<%=Request("editid")%>">
        <table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center>
          <tr> 
            <td height=24 colspan=2 class="tdbg1"><B>编辑栏目:<%= rs_e("CatalogName") %></b></td>
    </tr>
          <tr class="tdbg2"> 
            <td width="52%" height=30><U>栏目名称</U></td>
            <td width="48%"> 
              <input type="text" name="CatalogName" size="35" value="<%= rs_e("CatalogName") %>"> 
      </td>
    </tr>
          <tr class="tdbg2"> 
            <td width="52%" height=24><U>栏目说明</U><BR>
        可以使用HTML代码</td>
            <td width="48%"> 
              <textarea name="Readme" cols="40" rows="5"><%=rs_e("readme")%></textarea> 
      </td>
    </tr>
          <tr class="tdbg2"> 
            <td width="52%" height=30><U>所属类别</U></td>
            <td width="48%"> 
              <select name="class">
          <option value="0">做为栏目分类</option>
          <%
sql = "select * from info_Catalog order by rootid,orders"
rs.open sql,conn,1,1
 do while not rs.eof 
 Response.Write "<option value="""&rs("CatalogID")&""" "
 if rs_e("parentid")=rs("CatalogID") then Response.Write "selected"
 Response.Write ">"
 if rs("depth") =1 then  Response.Write "&nbsp;&nbsp;├ "
 if rs("depth") >1 then
 for i=2 to rs("depth")
	Response.Write "&nbsp;&nbsp;│"
 next
 Response.Write "&nbsp;&nbsp;├ "
 end if
 Response.Write rs("CatalogName")&"</option>" & vbcrlf
 rs.MoveNext
 loop
 rs.Close 
%>
        </select> </td>
    </tr>
          <tr class="tdbg2"> 
            <td width="52%" height=24>&nbsp;</td>
            <td width="48%"> 
              <input type="submit" name="Submit" value="保存修改"> 
      </td>
    </tr>
  </table>
</form>
<%
set rs=nothing
set rs_e=nothing
end sub

'保存添加栏目信息
sub savenew()
dim Founderr,msginfo,msgtitle
Founderr=false
if request("CatalogName")="" then
	msginfo=msginfo+"<br>"+"<li>请输入栏目名称。"
	Founderr=true
end if
if request("class")="" then
	msginfo=msginfo+"<br>"+"<li>请选择栏目分类。"
	Founderr=true
end if
if request("readme")="" then
	msginfo=msginfo+"<br>"+"<li>请输入栏目说明。"
	Founderr=true
end if
if founderr=true then
    msgtitle="添加新栏目"
	call Sysmsg(msgtitle,msginfo)
	exit sub
end if

dim CatalogID,rootid,parentid,depth,orders,maxrootid,parentstr,neworders
set rs = server.CreateObject ("adodb.recordset")

if request("class")<>"0" then
sql="select rootid,CatalogID,depth,orders,ParentStr from info_Catalog where CatalogID="&request("class")
rs.open sql,conn,1,1
rootid=rs(0)
parentid=rs(1)
depth=rs(2)
orders=rs(3)
    if depth+1>20 then
		msgtitle="添加新栏目"
		msginfo="<li>本系统限制最多只能有20级子栏目</li>"
	    call Sysmsg(msgtitle,msginfo)
	exit sub
    end if

⌨️ 快捷键说明

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