newssort.asp
来自「生成html的ASP企业站点,可以进行二次开发的」· ASP 代码 · 共 377 行 · 第 1/2 页
ASP
377 行
<%@ LANGUAGE = VBScript %>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
<TITLE>新闻类别</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="CheckAdmin.asp"-->
<BODY>
<%
Dim quanxian
quanxian=trim(Request.ServerVariables(name))
if Instr(session("AdminPurview"),"|6,")=0 then
response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
response.end
end if
%>
<br>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
<th height="24" nowrap>新闻检索及分类查看:添加,修改,删除新闻信息</th>
</tr>
<tr>
<td height="24" align="center" nowrap class="forumrow"><a href="NewsEdit.asp?Result=Add" onclick='changeAdminFlag("添加产品信息")'>添加新闻信息</a><font color="#0000FF"> | </font><a href="NewsList.asp" onclick='changeAdminFlag("新闻列表")'>查看所有新闻信息</a><font color="#0000FF"> | </font><a href="NewsSort.asp?Action=Add&ParentID=0" onclick='changeAdminFlag("产品列表")'>添加新闻类别</a><font color="#0000FF"> | </font><a href="Admin_htmlnewsort.asp" onclick='changeAdminFlag("生成新闻分类页面")'>生成新闻分类页面</a><font color="#0000FF"> | </font><a href="Admin_htmlnews.asp" onclick='changeAdminFlag("生成新闻详细页面")'>生成新闻详细页面</a></td>
</tr>
</table>
<%
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 LiangJingCMS_NewsSort where ID="&request.QueryString("id")
rs.open sql,conn,1,1
SortPath=rs("SortPath")
conn.execute("delete from LiangJingCMS_NewsSort where Instr(SortPath,'"&SortPath&"')>0")
conn.execute("delete from LiangJingCMS_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
%>
<%Function CallFolderView()%>
<br>
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
<tr>
<th height="22" sytle="line-height:150%">【管理新闻类别】</th>
</tr>
<tr>
<td align="center" nowrap class="forumRow"><a href="NewsSort.asp?Action=Add&ParentID=0">添加一级分类</a> | <a href="NewsList.asp">查看所有新闻</a></td>
</tr>
<tr>
<td nowrap class="forumRow"><%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 LiangJingCMS_NewsSort where ParentID="&id&" order by id"
rs.open sql,conn,1,1
if id=0 and rs.recordcount=0 then
response.write ("<center>暂无新闻分类</center>")
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 LiangJingCMS_NewsSort where ParentID="&rs("id"))(0)
if ChildCount=0 then
if i=rs.recordcount then
FolderType="SortFileEnd"
else
FolderType="SortFile"
end if
FolderName=rs("SortNameCH")
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("SortNameCH")
end If
datafrom="LiangJingCMS_NewsSort"
response.write("<tr>")
response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"'></td><td nowrap>"&FolderName&" ")
if rs("ViewFlagCH") then
Response.Write "<a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=downCH"" title=""点击更改显示状态""><font color='green'>√</font></a>"
else
Response.Write "<a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=upCH"" title=""点击更改显示状态""><font color='red'>×</font></a>"
end if
if rs("ViewFlagEN") then
Response.Write "<a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=downEN"" title=""点击更改显示状态""><font color='green'>√</font></a>"
else
Response.Write "<a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=upEN"" title=""点击更改显示状态""><font color='red'>×</font></a>"
end if
response.write(" <font color='red'>操作:</font>")
'If rs("ParentID") < 1 Then
response.write("<a href='NewsSort.asp?Action=Add&ParentID="&rs("id")&"'>添加</a> | ")
'End If
response.write("<a href='NewsSort.asp?Action=Edit&ID="&rs("id")&"'>修改</a>")
response.write(" | <a href='NewsSort.asp?Action=Move&ID="&rs("id")&"&ParentID="&rs("Parentid")&"&SortNameCH="&rs("SortNameCH")&"&SortPath="&rs("SortPath")&"'>移</a>")
response.write("→<a href='#' onclick='SortFromTo.rows[4].cells[0].innerHTML=""→ "&rs("SortNameCH")&""";MoveForm.toID.value="&rs("ID")&";MoveForm.toParentID.value="&rs("ParentID")&";MoveForm.toSortPath.value="""&rs("SortPath")&""";'>至</a>")
response.write(" | <a href=javascript:ConfirmDelSort('NewsSort',"&rs("id")&")>删除</a>")
response.write(" <font color='red'>新闻:</font><a href='NewsEdit.asp?Result=Add'>添加</a>")
response.write(" | <a href='NewsList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&"'>列表</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 LiangJingCMS_NewsSort where ID="&ParentID
rs.open sql,conn,1,1
ParentPath=rs("SortPath")
end if
%>
<br>
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
<form name="FolderForm" method="post" action="NewsSort.asp?Action=Save&From=Add">
<tr>
<th height="22" sytle="line-height:150%">【添加新闻类别】</th>
</tr>
<tr>
<td class="forumRow">| 根类 → <% if ParentID<>0 then TextPath(ParentID)%></td>
</tr>
<tr>
<td class="forumRow">中文:
<input name="SortNameCH" type="text" id="SortNameCH" size="28">
生效:
<input name="ViewFlagCH" type="radio" value="1" checked="checked" />
是
<input name="ViewFlagCH" type="radio" value="0" />
否 父类ID:
<input readonly name="ParentID" type="text" id="ParentID" size="6" value="<%=ParentID %>">
父类数字路径:
<input readonly name="ParentPath" type="text" id="ParentPath" size="18" value="<%=ParentPath%>"></td>
</tr>
<tr>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?