?? admin_news_list.asp
字號:
<%
if session("admin__user")="" then
Response.Redirect "login.asp?id=8"
end if
%>
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
<STYLE type="text/css"> <!-- a:link { text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited { text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋體"; TEXT-DECORATION: underline;}
body { font-size: 9pt; font-family: 宋體, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋體", "Arial";color: #000000}
p {FONT-SIZE: 9pt; FONT-FAMILY: "宋體", "Arial";color: #000000}
input {FONT-SIZE: 9pt; FONT-FAMILY: "宋體", "Arial";color: #000000}
body { margin-top: 0; margin-bottom: 0; color: #000000 }
--></STYLE>
<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>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<br>
<div align="center">
<table border="1" width="600" id="table2" cellspacing="0" cellpadding="6" style="border-collapse: collapse" bordercolor="#C0C0C0">
<tr>
<td bgcolor="#F5F5F5">
<p align="center">分類顯示:
<select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt">
<option value>請選擇欄目</option>
<option value=admin_news_list.asp?all=all>顯示所有新聞信息</option>
<%
sql = "select * from lm where lm<>'' order by id asc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
while not rs.eof
response.write "<optgroup label=(ID:"&rs("id")&")"&rs("lm")&">"
sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
while not rs2.eof
%>
<option value='admin_news_list.asp?lm=<%=rs2("id")%>' <% if int(lmid)=rs2("id") then response.write " selected" %>>├(編號:<%=rs2("id")%>)<%=rs2("lm2")%></option>
<%
rs2.movenext
wend
rs.movenext
wend
rs.close
set rs=nothing
%>
</select>
</td>
</tr>
<%if session("dj")=1 then%>
<tr>
<td>
<!--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 > 10)
{
alert("在 關鍵字 域中,請最多輸入 10 個字符。");
theForm.title.focus();
return (false);
}
return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_news_list.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<center>
<table border="0" width="586" id="table3" cellpadding="0">
<tr>
<td width="292">
<p align="right">按標題模糊搜索所有新聞</td>
<td width="292">
<!--webbot bot="Validation" s-display-name="關鍵字" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="10" --><input type="text" name="title" size="20" maxlength="10" style="border-style: solid; border-width: 1px"><input type="submit" value="搜索" name="B1" style="border: 1px solid #000000; background-color: #FFFFFF"></td>
</tr>
</table>
</center>
</td>
</tr>
<%end if%>
<%
lm=trim(request("lm"))
if lm<>"" then
sql = "select * from lm where id="&lm
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
%>
<tr>
<td align=center><font color=ff0000><B>查看“<%=rs("lm2")%>”的新聞文章</b></font></td>
</tr>
<%end if%>
</table>
</div>
</form>
<div align="center">
<table border="1" width="750" id="table1" cellspacing="0" cellpadding="3" style="border-collapse: collapse" bordercolor="#C0C0C0">
<tr>
<td width="236" align="center" bgcolor="#F5F5F5" background="images/topBar_bg.gif"><b>(編號)標題(閱讀)</b></td>
<td width="89" align="center" bgcolor="#F5F5F5" background="images/topBar_bg.gif"><b>欄目</b></td>
<td width="115" align="center" bgcolor="#F5F5F5" background="images/topBar_bg.gif"><b>加入時間</b></td>
<td width="77" align="center" bgcolor="#F5F5F5" background="images/topBar_bg.gif"><b>加入人員</b></td>
<td width="168" align="center" bgcolor="#F5F5F5" background="images/topBar_bg.gif"><b>操作</b></td>
</tr>
<%
lm=trim(request("lm"))
title=trim(request("title"))
sql = "select title,adduser,id,lm,lm2,time,hit,ontop,updat,tj,titlecolor from news "
' sql= sql &" where lm2='0' "
if lm<>"" then
sql = sql & " where lm2='"&lm&"' "
end if
if title<>"" and lm="" then
sql = sql & " where title like '%"&title&"%' "
end if
sql= sql& " order by ontop desc , id desc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount<>0 then
page=int(request.QueryString ("page"))
rs.PageSize=20
pagecount=rs.pagesize
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
gg=rs.recordcount/pagecount
gh=int(gg)
if gh<=1 then gh=1
if gg>gh then gh=gh+1
gg=gh
for i=1 to pagecount
%>
<tr>
<td width="236">(<%=rs("id")%>)<a href="news_view.asp?newsid=<%=rs("id")%>" target=_blank title='<%=rs("title")%>'><font color=<%=trim(rs("titlecolor"))%>><%=titleb(rs("title"),20)%></font></a><font color=999999>(<%=rs("hit")%>)</font></td>
<td width="89" align=center>
<%
lm2=trim(rs("lm2"))
if lm2="" then lm2=0
sql2 = "select * from lm where id="&clng(lm2)
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
if rs2.recordcount<>0 then
response.write rs2("lm2")
else
response.write "<font color=blue>欄目不正確</font>"
end if
%></td>
<td width="115" align="center"><%=rs("time")%></td>
<td width="77">
<p align="center"><%=rs("adduser")%></td>
<td width="168">
<%
if rs("adduser")=session("admin__user") or session("dj")="1" then
%>
<p align="center">
<%
if rs("tj")="不推薦" then
Response.Write "<a href=admin_news_tj.asp?tj=推薦&id="&rs("ID")&"&page="&page&">沒推薦</a> "
else
Response.Write "<a href=admin_news_tj.asp?tj=不推薦&id="&rs("ID")&"&page="&page&">已推薦</a> "
end if
%>
<%
ontop=rs("ontop")
if ontop=3 then
response.write "<a href=admin_news_ontop.asp?id="&rs("id")&"&ontop=5&page="&page&"&title="&title&"&lm="&lm&">沒固頂</a> "
else
response.write "<a href=admin_news_ontop.asp?id="&rs("id")&"&ontop=3&page="&page&"&title="&title&"&lm="&lm&">已固頂</a> "
end if
%><a href="admin_news_add.asp?id=<%=rs("ID")%>">修改</a>
<a href=# onclick='window.open("NewsPL.asp?id=<%=rs("id")%>","newsview","width=680,height=400,top=70,left=150,scrollbars=yes" )'>評論</a>
<a onclick='{if(confirm("您確定刪除嗎?此操作將不能恢復!")){return true;}return false;}' href=admin_news_del2.asp?id=<%=rs("id")%>&page=<%=page%>>刪除</a>
<%end if%></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
else
Response.Write "<tr><td colspan=4>暫無信息</td></tr>"
end if
%>
</table>
</div>
<center><br>
<%
if rs.recordcount<>0 then
if page>1 then%>
<a href='<%=request.servervariables("URL")%>?page=1&title=<%=title%>&lm=<%=lm%>'>首頁</a>
<a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&title=<%=title%>&lm=<%=lm%>'>上一頁</a>
<%end if%>
<%if page<gg then%>
<a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&title=<%=title%>&lm=<%=lm%>'>下一頁</a>
<a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&title=<%=title%>&lm=<%=lm%>'>尾頁</a>
<%end if%>
共<%=rs.recordcount%>條 每頁顯示<%=pagecount%>條 第<%=page%>頁 共<%=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%>&title=<%=title%>&lm=<%=lm%>" <%if page=i then response.write "selected"%>>第<%=i%>頁</option>
<%next%>
</select>
</p>
<%end if%>
</center>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -