?? newssort.asp
字號:
?<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
'┊ ┊
'┊ 互連在線企業網站管理系統(NWEB) ┊
'┊ ┊
' 版權所有 csys.com.cn
'
' 程序制作 互連在線工作室
' Q Q:61128110
'
' 相關網址 [產品介紹]http://www.csys.com.cn
' [支持論壇]http://www.csys.com.cn/bbs
'
' 演示網址 http://www.csys.com.cn
'┊ ┊
'└┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
%>
<% Option Explicit %>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>新聞分類</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<META NAME="copyright" CONTENT="Copyright 2004-2008 - csys.com.cn-STUDIO" />
<META NAME="Author" CONTENT="互連在線網絡技術工作室,www.csys.com.cn" />
<META NAME="Keywords" CONTENT="" />
<META NAME="Description" CONTENT="" />
<link rel="stylesheet" href="Images/CssAdmin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="CheckAdmin.asp"-->
<%
if Instr(session("AdminPurview"),"|21,")=0 then
response.write ("<font color='red')>你不具有該管理模塊的操作權限,請返回!</font>")
response.end
end if
'========判斷是否具有管理權限
%>
<BODY>
<%
Dim Action
Action=request.QueryString("Action")
Select Case Action
Case "Add"
addFolder
CallFolderView()
Case "Del"
Dim rs,sql,SortPath
Set rs=server.CreateObject("adodb.recordset")
sql="Select * From Csys_NewsSort where ID="&request.QueryString("id")
rs.open sql,conn,1,1
SortPath=rs("SortPath")
conn.execute("delete from Csys_NewsSort where Instr(SortPath,'"&SortPath&"')>0")
conn.execute("delete from Csys_News where Instr(SortPath,'"&SortPath&"')>0")
response.write ("<script language=javascript> alert('成功刪除本類、子類及所有下屬信息條目,點擊確定查看類別樹!');location.replace('NewsSort.asp');</script>")
Case "Save"
saveFolder ()
Case "Edit"
editFolder
CallFolderView()
Case "Move"
moveFolderForm ()
CallFolderView()
Case "MoveSave"
saveMoveFolder ()
Case Else
CallFolderView()
End Select
%>
</BODY>
</HTML>
<%
'調用顯示節點------------------------------
Function CallFolderView()
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<tr>
<td height="24" nowrap><font color="#FFFFFF"><strong>類別樹查看管理:</strong></font></td>
</tr>
<tr>
<td height="24" align="center" nowrap bgcolor="#EBF2F9"><a href="NewsSort.asp?Action=Add&ParentID=0">添加一級分類</a><font color="#0000FF"> | </font><a href="NewsList.asp" onClick='changeAdminFlag("新聞列表")'>查看所有新聞</a></td>
</tr>
<tr>
<td height="24" nowrap bgcolor="#EBF2F9"><% Folder(0) %></td>
</tr>
</table>
<%
End Function
'列出所有節點------------------------------
Function Folder(id)
Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType
Set rs=server.CreateObject("adodb.recordset")
sql="Select * From Csys_NewsSort where ParentID="&id&" order by id"
rs.open sql,conn,1,1
if id=0 and rs.recordcount=0 then
response.write ("暫無分類!")
response.end
end if
i=1
response.write("<table border='0' cellspacing='0' cellpadding='0'>")
while not rs.eof
ChildCount=conn.execute("select count(*) from Csys_NewsSort where ParentID="&rs("id"))(0)
if ChildCount=0 then
if i=rs.recordcount then
FolderType="SortFileEnd"
else
FolderType="SortFile"
end if
FolderName=rs("SortName")
onMouseUp=""
else
if i=rs.recordcount then
FolderType="SortEndFolderClose"
ListType="SortEndListline"
onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
else
FolderType="SortFolderClose"
ListType="SortListline"
onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
end if
FolderName=rs("SortName")
end if
response.write("<tr>")
response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap>"&FolderName&" ")
response.write("<font color='#FF0000'>分類:</font><a href='NewsSort.asp?Action=Add&ParentID="&rs("id")&"'>添加</a>")
response.write("<font color='#367BDA'> | </font><a href='NewsSort.asp?Action=Edit&ID="&rs("id")&"'>修改</a>")
response.write("<font color='#367BDA'> | </font><a href='NewsSort.asp?Action=Move&ID="&rs("id")&"&ParentID="&rs("Parentid")&"&SortName="&rs("SortName")&"&SortPath="&rs("SortPath")&"'>移</a>")
response.write("→<a href='#' onclick='SortFromTo.rows[4].cells[0].innerHTML=""→ "&rs("SortName")&""";MoveForm.toID.value="&rs("ID")&";MoveForm.toParentID.value="&rs("ParentID")&";MoveForm.toSortPath.value="""&rs("SortPath")&""";'>至</a>")
response.write("<font color='#367BDA'> | </font><a href=javascript:ConfirmDelSort('NewsSort',"&rs("id")&")>刪除</a>")
response.write(" <font color='#FF0000'>新聞:</font><a href='NewsEdit.asp?Result=Add' onClick='changeAdminFlag(""添加新聞"")'>添加</a>")
response.write("<font color='#367BDA'> | </font><a href='NewsList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&"' onClick='changeAdminFlag(""新聞列表"")'>列表</a>")
response.write("</td></tr>")
if ChildCount>0 then
%>
<tr id="a<%= rs("id")%>" style="display:yes"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
<%
end if
rs.movenext
i=i+1
wend
response.write("</table>")
rs.close
set rs=nothing
end function
'添加節點---------------------------------
Function addFolder()
Dim ParentID
ParentID=request.QueryString("ParentID")
addFolderForm ParentID
end function
'添加節點表單------------------------------
Function addFolderForm(ParentID)
Dim ParentPath,SortTextPath,rs,sql
if ParentID=0 then
ParentPath="0,"
SortTextPath=""
else
Set rs=server.CreateObject("adodb.recordset")
sql="Select * From Csys_NewsSort where ID="&ParentID
rs.open sql,conn,1,1
ParentPath=rs("SortPath")
end if
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<form name="FolderForm" method="post" action="NewsSort.asp?Action=Save&From=Add">
<tr>
<td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle"> <strong>添加類別:通過"發布"可控制每種分類是否在網站里顯示出來。</strong></font></td>
</tr>
<tr>
<td height="24" nowrap bgcolor="#EBF2F9">| 根類 → <% if ParentID<>0 then TextPath(ParentID)%></td>
</tr>
<tr>
<td height="24" bgcolor="#EBF2F9">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -