📄 admin_zt.asp
字号:
<!--#include file = admin_chk.asp -->
<%
If Not ChkAdmin("Special") Then
Call ArtErr("","")
End If
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
<script src="Include/Common.js" type="text/javascript"></script>
</head>
<table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
<tr align=center>
<th height=25 align=center colspan="2"><strong>专题管理</strong></th>
</tr>
<tr>
<td width=12% height=30 class=forumRow> <strong>管理导航:</strong></td>
<td width=88% height=30 class=forumRow><a href='admin_zt.asp'>专题列表</a> | <a href='admin_zt.asp?Action=Addzt'>新增专题</a></td>
</tr>
</TABLE>
<%
Dim Action
Action = Request("Action")
Select Case Action
Case "Addzt"
Call Addzt()
Case "del"
Call del()
Case Else
Call showmain()
End Select
call CloseConn()
call AdminPageEnd()
Sub showmain()
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr >
<td class="bg_tr" align="center">专题</td>
<td class="bg_tr"align="center">文章数量</td>
<td class="bg_tr"align="center">操作</td>
</tr>
<%
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select id,title from [NewsZt] order by id desc",conn,1,1
if rs.recordcount<>0 then
page=int(request("page"))
rs.PageSize=20
pagecount=rs.pagesize
if page<=0 then page=1
if request("page")="" then page=1
rs.AbsolutePage=page
for i=1 to pagecount
id=rs("id")
%>
<tr height="25" onMouseOver=overColor(this) onMouseOut=outColor(this) class="tdbg">
<td><a href="../News_zt.asp?ztid=<%=id%>" target=_blank><%=rs("title")%></a><font color="#808080">(ID:<%=rs("id")%>)</font></td>
<td align="center">
<%
set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open "select id,ztid from [News] where ztid="&ID&" and sh=1 order by id desc",conn,1,1
Response.Write rs2.recordcount
rs2.close:set rs2=nothing
%>
</td>
<td align="center"><a href="admin_zt.asp?Action=Addzt&editid=<%=id%>">修改</a> <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="?Action=del&delid=<%=id%>">删除</a></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
end if
%>
<tr><td class="Forumrow" align="center" colspan="3">
<%if rs.recordcount<>0 then
if page>1 then
response.write "<a href="&request.servervariables("URL")&"?page=1&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">首页</a> "
response.write "<a href="&request.servervariables("URL")&"?page="&page-1&"&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">上一页</a> "
end if
if page<rs.pagecount then
response.write "<a href="&request.servervariables("URL")&"?page="&page+1&"&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">下一页</a> "
response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&"&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">尾页</a> "
end if
response.write "共"&rs.recordcount&"条 每页显示"&pagecount&"条 共"&rs.pagecount&"页 "
%>
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<select size="1" onChange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
<%for i=1 to rs.pagecount%>
<option value="<%=request.servervariables("URL")%>?page=<%=i%>&id=<%=id%>&lm=<%=lm%>&lb=<%=lb%>&word=<%=word%>" <%if page=i then response.write "selected"%> style="font-size: 9pt">第<%=i%>页</option>
<%next%>
</select>
<%end if%>
</center>
</td></tr></table>
<%
rs.close:set rs=nothing
End Sub
Sub Addzt()
editid=trim(Request("editid"))
saveid=trim(Request("saveid"))
title=trim(Request("title"))
mb=trim(Request("mb"))
icon=trim(Request("icon"))
if editid="" and saveid="" and title<>"" and mb<>"" then
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select top 1 * from [Newszt] order by id desc",conn,1,3
rs.addnew
rs("title")=title
rs("mb")=mb
rs("icon")=icon
rs.update
rs.close:set rs=nothing
call ArtErr("<li>新增 ["&title&"] 专题成功!</li>","2")
elseif editid<>"" and saveid="" and title="" and mb="" then
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [NewsZT] where ID="&editid&" order by id desc",conn,1,1
if rs.recordcount<>0 then
etitle=rs("title")
emb=rs("mb")
eIcon=rs("icon")
end if
rs.close:set rs=nothing
elseif editid="" and saveid<>"" and title<>"" and mb<>"" then
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [NewsZT] where ID="&saveid&" order by id desc",conn,1,3
if rs.recordcount<>0 then
rs("title")=title
rs("mb")=mb
rs("icon")=icon
rs.update
end if
rs.close:set rs=nothing
call ArtErr("<li>专题 ["&title&"] 修改成功!</li>","2")
end if
%>
<table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>
<tr>
<td height=25 class="forumRaw" align="center"><strong>新增专题模版</strong></td>
</tr>
</table>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.title.value == "")
{
alert("请在 专题名称 域中输入值。");
theForm.title.focus();
return (false);
}
if (theForm.title.value.length < 1)
{
alert("在 专题名称 域中,请至少输入 1 个字符。");
theForm.title.focus();
return (false);
}
if (theForm.title.value.length > 200)
{
alert("在 专题名称 域中,请最多输入 200 个字符。");
theForm.title.focus();
return (false);
}
if (theForm.mb.value == "")
{
alert("请在 专题模版 域中输入值。");
theForm.mb.focus();
return (false);
}
if (theForm.mb.value.length < 1)
{
alert("在 专题模版 域中,请至少输入 1 个字符。");
theForm.mb.focus();
return (false);
}
return (true);
}
//--></script>
<table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>
<form method="POST" action="?Action=Addzt&saveid=<%=editid%>" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<tr>
<td width=19% class="forumRow" align="center"><b>专题名称</b></td>
<td class="forumRow" colspan="2">
<!--webbot bot="Validation" s-display-name="专题名称" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="200" --><input type="text" name="title" size="60" value="<%=eTitle%>" maxlength="200"></td>
</tr>
<tr>
<td width=19% class="forumRow" align="center"><b>专题模版</b><br>
<font color="#993300">可以使用<br>
HTML代码</font><br>
<br>
<font color="#666666">
$$通用页头$$<br><BR>
$$网站目录$$<br>
$$列表$$<br>
$$专题名$$<br>
$$ZTID$$<br><BR>
$$通用页尾$$<br></font></td>
<td width=78% class="forumRow">
<!--webbot bot="Validation" s-display-name="专题模版" b-value-required="TRUE" i-minimum-length="1" --><textarea rows="19" name="mb" cols="100"><%=emb%></textarea></td>
<td width="3%" class="forumRow"><a href="javascript:admin_Size(-5,'mb')"><img src="../images/admin/minus.gif" width="20" height="20" border='0' unselectable="on"></a> <a href="javascript:admin_Size(5,'mb')"><img src="../images/admin/plus.gif" width="20" height="20" border='0' unselectable="on"></a> </td>
</tr>
<tr>
<td width=19% class="forumRow" align="center"><b>标题图标</b></td>
<td class="forumRow" colspan="2">
<!-- 小图标 -->
<select size="1" name="select_icon" id="select_icon" onChange="show_icon_cho(pic_div)">
<option value="" <%if icon="" then response.write "selected"%>> (无图标)</option>
<option value="·" <%if icon="·" then response.write "selected"%>>· </option>
<option value="★" <%if icon="★" then response.write "selected"%>> ★</option>
<option value="☆" <%if icon="☆" then response.write "selected"%>>☆</option>
<option value="○" <%if icon="○" then response.write "selected"%>>○</option>
<option value="●" <%if icon="●" then response.write "selected"%>>●</option>
<option value="◎" <%if icon="◎" then response.write "selected"%>>◎</option>
<option value="◇" <%if icon="◇" then response.write "selected"%>>◇</option>
<option value="◆" <%if icon="◆" then response.write "selected"%>>◆</option>
<option value="□" <%if icon="□" then response.write "selected"%>>□</option>
<option value="■" <%if icon="■" then response.write "selected"%>>■</option>
<option value="△" <%if icon="△" then response.write "selected"%>>△</option>
<option value="▲" <%if icon="▲" then response.write "selected"%>>▲</option>
<%
'取出目录中的图标
icon_path=Server.MapPath("../images/icon")
'on error resume next
set fso=server.CreateObject("scripting.filesystemobject")
set objFolder=fso.GetFolder(icon_path)
set objFiles=objFolder.Files
for each objFile in objFiles
if right(objFile.name,3)="gif" or right(objFile.name,3)="jpg" or right(objFile.name,3)="bmp" then
response.write "<option value=../images/icon/"&trim(objFile.name)&" "
if eicon="<img src=../images/icon/"&trim(objFile.name)&" border=0>" then response.write " selected "
response.write ">"&trim(objFile.name)&"</option>"&vbcrlf
end if
next
set objFolder=nothing
set fso=nothing
'结束取出目录中的图标
%>
</select><span id="pic_div" style="DISPLAY:none">
<img name="show_icon" src="" border="0">
(小图标存放在目录:images/icon/);<font color="#CC3300">保存时去掉“../”</font></span><br>
<!-- 图形图标 -->
<input type="text" name="icon" size="40" value="<%=Server.HtmLEncode(icon)%>"> 原图标:<%=icon%>
支持HTML语句。显示在更多新闻时的标题前面。
</td>
</tr>
<tr><td colspan="3"class="forumRow" align="center" height="30">
<p align="center"><input type="submit" value=" 提 交 " name="B1"> <input type="reset" value=" 重 置 " name="B2"> <input type="button" name="go_button" onClick="javascript:location='admin_zt.asp'" value='返回列表' class="button"></p>
</td></tr></form></table>
<%
End Sub
Sub del()
Dim delid:delid=trim(Request("delid"))
if delid<>"" then
conn.Execute "delete from [NewsZt] where ID="&CInt(delid)
call ArtErr("<li>此专题已经成功删除!</li>","2")
end if
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -