📄 ppst_news.asp
字号:
<!--#include file="PPst_Conn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>爬爬思特新闻管理系统1.2版 Powered By PaPasite</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
SCROLLBAR-FACE-COLOR: #000000;
MARGIN: 0px;
SCROLLBAR-HIGHLIGHT-COLOR: #EEEEEE;
SCROLLBAR-SHADOW-COLOR: #EEEEEE;
SCROLLBAR-3DLIGHT-COLOR: #CCCCCC;
SCROLLBAR-ARROW-COLOR: #EEEEEE;
SCROLLBAR-TRACK-COLOR: #EEEEEE;
SCROLLBAR-DARKSHADOW-COLOR: #CCCCCC;
TEXT-DECORATION: none
}
td,th {
font-size: 12px;
color: #000000;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FF0000;
}
.cuti_baise {
font-size: 12px;
color: #FFFFFF;
font-weight: bold;
}
.cuti_red {
font-size: 20px;
color: #FF0000;
font-weight: bold;
}
.Heitable {
border: 1px solid #000000;
}
.heisefont {
font-size: 12px;
color: #000000;
}
.baisefont {
font-size: 12px;
color: #ffffff;
}
input,select,Textarea{background-color: #FFFFFF; border: 1 solid #000000; color: #000000; font-family:Verdana, Arial,宋体; font-size: 9pt; line-height: 14px;}
-->
</style>
<script language=Javascript> //全选全不选
function checkAll(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked;
}
function checkItem(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getElementsByName(e.name);
for (var i=0; i<aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
}
</script>
<%If Action="51Add" or Action="Edit" then
set rs=server.CreateObject("ADODB.RECORDSET")
sql="select * from PPst_SmallClass"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("[<%=rs("SmallClassid")%>] <%=rs("Smallclassname")%>","<%=rs("ForBigClassID")%>","<%=rs("SmallClassid")%>");
<%
count = count + 1
rs.movenext
loop
Set rs=Nothing
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.SmallClassID.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.SmallClassID.options[document.form1.SmallClassID.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<%End If%>
</head>
<!-- Powered By PaPasite -->
<body >
<%
If Action="Login" then
If Request("UserName")<>UserName or Request("Password")<>UserPwd then
response.Write "<br><br><br><center>用户名或密码错误...<br><br><a href="&ThisFileName&">》》返回登陆...</a></center><body><html>"
Conn.Close
response.End()
Else
Session("adminLevel")=10
End If
End If
If Action="Logout" then
Session("adminLevel")=""
End If '以上代码必须放在有程序之前
If Session("adminLevel")<>10 then '如果没有登陆则显示登陆口,并停止运行程序
response.write "<br><br><br><center><table width=200 border=0 align=center cellpadding=0 cellspacing=1 bgcolor=#000000>"
response.write "<form action="&ThisFileName&"?Action=Login method=post><tr><td height=20 align=center valign=middle colspan=2 bgcolor=#FFFFFF>后台登陆</td></tr>"
response.write "<tr><td width=70 align=center valign=middle bgcolor=#FFFFFF>用户名:</td><td align=left valign=middle height=20 bgcolor=#FFFFFF> <input type=Text Name=UserName size=15></td></tr>"
response.write "<tr><td width=70 align=center valign=middle bgcolor=#FFFFFF>密 码:</td><td align=left valign=middle height=20 bgcolor=#FFFFFF> <input type=PassWord Name=PassWord size=15></td></tr>"
response.write "<tr><td height=20 align=center valign=middle colspan=2 bgcolor=#FFFFFF><input type=submit name=submit value=""登 陆""></td></tr>"
response.write "</form></table></center></body></html>"
Conn.Close
response.end()
End If
Dim ID,Title,Author,Content,AddTime,ButtonValue
Function GetBigClassName(NewsBigClassID) '定义一个过程,将分类ID转换为名称
Set RsBigClass=Server.CreateObject("Adodb.RecordSet")
SqlBigClass="Select * From PPst_BigClass Where BigClassID="&NewsBigClassID
rsBigClass.open sqlBigClass,conn,1,1
GetBigClassName=RsBigClass("BigClassName")
RsBigClass.Close
End Function
Function GetSmallClassName(NewsSmallClassID) '定义一个过程,将分类ID转换为名称
Set RsSmallClass=Server.CreateObject("Adodb.RecordSet")
SqlSmallClass="Select * From PPst_SmallClass Where SmallClassID="&NewsSmallClassID
rsSmallClass.open sqlSmallClass,conn,1,1
GetSmallClassName=RsSmallClass("SmallClassName")
RsSmallClass.Close
End Function
If Action="Shenhe" then '改变状态
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From PPst_News Where ID="&Request("ID")
rs.open sql,conn,1,3
If rs("Shenhe")=0 then
rs("Shenhe")=1
Else
rs("Shenhe")=0
End If
rs.update
rs.close
response.redirect ThisFileName&"?Result=改变新闻状态成功!"
End If
If Action="DelAll" then
SQL="Delete * from [PPst_News] where ID in ("&Request("AllID")&")"
Conn.Execute (SQL)
response.redirect ThisFileName&"?Result=批量删除新闻成功!"
End If
If Action="ShenheAll" then
SQL="Update [PPst_News] Set Shenhe="&Request("ShenheValue")&" where ID in ("&Request("AllID")&")"
Conn.Execute (SQL)
response.redirect ThisFileName&"?Result=批量审核新闻成功!"
End If
ButtonValue=" 添 加 " '设定按钮的默认值为"添加",
If Action="Add" and Request("ID")="" then '如果表单ID为空,表示是添加新的
If Request("BigClassID")="" or Request("SmallClassID")="" Then
response.Write "<br><br><br><center>你必须选择分类后才能添加信息!!<br><br><a href="&ThisFileName&"?action=51Add>》》返回...</a></center><body><html>"
rs.Close
Conn.Close
response.End()
End If
If Request("Title")="" or Request("Content")="" then
response.Write "<br><br><br><center>新闻标题和内容都不能为空..<br><br><a href="&ThisFileName&">》》返回...</a></center><body><html>"
Conn.Close
response.End()
End If
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From PPst_News"
rs.open sql,conn,1,3
rs.AddNew
rs("Title")=Request("Title")
rs("Author")=Request("Author")
rs("BigClassID")=Request("BigClassID")
rs("SmallClassID")=Request("SmallClassID")
rs("Content")=PPst_Save(Request("Content"))
rs("SmallPicURL")=Request("SmallPicURL")
If Request("Shenhe")=1 then rs("Shenhe")=1
rs("AddTime")=Now()
rs.update
rs.close
response.redirect ThisFileName&"?Action=51Add&Result=添加成功!"
End If
If Action="Add" and Request("ID")<>"" then '如果表单ID不为为空,表示是编辑新闻
If Request("Title")="" or Request("Content")="" then
response.Write "<br><br><br><center>新闻标题和内容都不能为空..<br><br><a href="&ThisFileName&">》》返回...</a></center><body><html>"
Conn.Close
response.End()
End If
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From PPst_News Where ID="&Request("ID")
rs.open sql,conn,1,3
rs("Title")=Request("Title")
rs("Author")=Request("Author")
If Request("BigClassID")<>"" and Request("SmallClassID")<>"" then
rs("BigClassID")=Request("BigClassID")
rs("SmallClassID")=Request("SmallClassID")
End If
rs("Content")=PPst_Save(Request("Content"))
rs("SmallPicURL")=Request("SmallPicURL")
rs.update
rs.close
response.redirect ThisFileName&"?BigClassID="&request("BCID")&"&SmallClassID="&request("SCID")&"&page="&request("page")
End If
If Action="Del" then
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Delete * From PPst_News Where ID="&Request("ID")
rs.open sql,conn,1,3
rs.close
response.redirect ThisFileName&"?Result=删除成功!"
End If
If Action="DelPinglun" then
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Delete * From PPst_Pinglun Where ID="&Request("PID")
rs.open sql,conn,1,3
rs.close
response.redirect ThisFileName&"?Action=AdminPinglun&ID="&Request("ID")&"&ActionResult=删除成功!"
'Cstr(Request.ServerVariables("HTTP_REFERER"))
End If
If Action="DelAllPinglun" then
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Delete * From PPst_Pinglun Where NewsID="&Request("ID")
rs.open sql,conn,1,3
rs.close
response.redirect ThisFileName&"?Action=AdminPinglun&ID="&Request("ID")&"&ActionResult=删除全部成功!"
End If
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10"></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" align="center" valign="middle"><a href=<%=ClassURL%>>栏目管理</a> --- --- <a href=<%=NewsURL%>?Action=51Add>添加新闻</a> --- --- <a href=<%=NewsURL%>>管理新闻</a> --- --- <a href=<%=ThisFileName%>?Action=Logout>退出后台</a></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10"></td>
</tr>
</table>
<%
If Action="View" then
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From PPst_News Where ID="&Request("ID")
rs.open sql,conn,1,1
ID=rs("ID")
Title=rs("Title")
Author=rs("Author")
AddTime=rs("AddTime")
SmallPicURL=rs("SmallPicURL")
ReadCishu=rs("ReadCishu")
Content=rs("Content")
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000" >
<tr>
<td width="60" height="25" align="center" valign="middle" bgcolor="#FFFFFF">
标题:</td>
<td width="700" align="left" valign="middle" bgcolor="#FFFFFF"> <%=Title%></td>
</tr>
<tr>
<td height="25" align="center" valign="middle" bgcolor="#FFFFFF">作者:</td>
<td align="left" valign="middle" bgcolor="#FFFFFF"> <%=Author%>时间:<%=AddTime%>阅读 <%=ReadCishu%> 次</td>
</tr>
<tr>
<td align="center" valign="Top" bgcolor="#FFFFFF" height="100">内容:</td>
<td align="left" valign="" bgcolor="#FFFFFF" style="word-break:break-all"> <%=Content%> </td>
</tr>
<tr>
<td height="20" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">此处只是提供简单的新闻预览,真实效果请从前台点击查看..</td>
</tr>
<tr>
<td height="20" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><a href="<%=ThisFileName%>">〉〉返回后台</a></td>
</tr>
</table>
<%Response.Write "</body></html>"
rs.close
Conn.Close
Response.End()
End If
If Action="AdminPinglun" then
Set Rs=Server.CreateObject("Adodb.RecordSet")
SQL="Select * From PPst_Pinglun Where NewsID="&Request("ID")&" Order By ID Desc"
Rs.open sql,conn,1,1
Set Rs_News=Server.CreateObject("Adodb.RecordSet")
SQL_News="Select * From PPst_News Where ID="&Request("ID")
Rs_News.open sql_News,conn,1,1
NewsTitle=Rs_News("Title")
Rs_News.Close
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td height="20" align="center" valign="middle" bgcolor="#FFFFFF"> </td>
<td colspan="4" align="left" valign="middle" bgcolor="#FFFFFF"> 新闻标题: <%=NewsTitle%> ---- <A href=<%=ThisFileName%>?Action=DelAllPinglun&ID=<%=request("ID")%>>删除该新闻下所有评论</A> <%="---- <font color=#FF0000>"&Request("ActionResult")&"</font>"%> </td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -