?? ku_news.asp
字號:
<!--#include file="ku_top.asp" -->
<%
sub navigation()
response.write " >> "
response.write "本站新聞"
end sub
%>
<%
page_count = 20
MaxPerPage=page_count '分頁顯示的紀錄個數
dim sql
dim rs
dim gstBookID
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
%>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="800" height="50" bgcolor="#ffffff">
<tr>
<td width="218" valign="top">
<div align="center">
<table border="0" width="208" id="table2" bgcolor="#ebebeb" cellpadding="0" cellspacing="0">
<tr>
<td height="30" background="xbqq_img/gonggao.gif">
<p align="center"><b>站 內 公 告</b></td>
</tr>
<tr>
<td><% xbqq_Marquee %></td>
</tr>
<tr>
<td height="0"><hr></td>
</tr>
<tr>
<td height="30" background="xbqq_img/gonggao.gif">
<p align="center"><b>信 息 搜 索</b></td>
</tr>
<tr>
<td height="23"><% xbqq_Search %></td>
</tr>
<tr>
<td height="0"><hr></td>
</tr>
<tr>
<td height="30" background="xbqq_img/gonggao.gif">
<p align="center"><b>站 內 投 票</b></td>
</tr>
<tr>
<td><% xbqq_vote %></td>
</tr>
<tr>
<td height="0"><br></td>
</tr>
</table>
</div>
</td>
<td width="560" valign="top">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="28" id="table1" background="xbqq_img/kind1.gif">
<tr>
<td> <img border="0" src="xbqq_img/ico1.gif" width="11" height="9">
<b>新 聞 動 態</b></td>
</tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="550" height="5">
<tr>
<td></td>
</tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="160" style="border: 1px solid #2C87E9">
<tr>
<td bgcolor="#FFFFFF" width="150">
<!--推薦圖片新聞開始-->
<div align="center">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="50" height="10">
<tr>
<td></td>
</tr>
</table>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="10" height="10">
<tr>
<td>
<%
set RsPic=server.createobject("adodb.recordset")
sql="select top 5 * from News where Ispic=1 ORDER BY id DESC"
RsPic.open sql,conn,1,1
if RsPic.eof or RsPic.bof then
Call NoPic("暫無圖文新聞")
end if
do while not RsPic.eof
Call xbqq_NewsShowPic(RsPic("Pic"),RsPic(0),RsPic("Title"),130,100,18)
RsPic.movenext
loop
RsPic.CLOSE
SET RsPic=Nothing
%>
</td>
</tr>
</table>
</div>
<!--推薦圖片新聞結束-->
</td>
<td bgcolor="#FFFFFF" width="398">
<!-- 新聞列表開始-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top"> <br>
<%
sql="select * from news ORDER BY id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
'Set Rs=Conn.Execute("select * from news ORDER BY id DESC")
rs.pagesize=MaxPerPage
If trim(Request("Page"))<>"" and IsNumeric(Request("Page")) then
CurrentPage= CLng(request("Page"))
If CurrentPage< 1 then
CurrentPage= 1
ElseIf CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If
if rs.eof then
response.write "<p align='center'>還沒有添加新聞...</p>"
else
totalPut=rs.recordcount '記錄總數
if CurrentPage=1 then
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark '移動到開始顯示的記錄位置
showContent
showpages
else
currentPage=1
showContent
end if
end if
rs.close
end if
set rs=nothing
set conn=nothing
sub showContent
%>
<TABLE width="100%" align="center" cellspacing="2" >
<%
dim i
i=0
do while not (rs.eof or err)
%>
<tr>
<td width="26" height="30"> <div align="right"><img src="Images/Gaobei_doc.gif" align="absmiddle"></div></td>
<td width="229"><div align="left"><a href="NewsInfo.asp?id=<%response.write rs(0)%>" title="<%=rs("title")%>">
<% if Getlen(rs("title"))>35 then%>
<%=LeftStr(rs("title"),30)%>...
<%else%>
<%response.write rs("title")%>
<%end if%>
</a></div></td>
<td width="128">[ <%=rs("time")%> ]</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</TABLE>
<%end sub%>
<%sub showpages()%>
<br> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28" align="right">
<%
dim n,k
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
%>
共有<%=rs.recordcount%>個記錄 每頁<%=Page_count%>個記錄
<%
k=currentPage
if k=1 then
response.write " 首頁 "& vbCrLf
response.write " 上一頁 "& vbCrLf
end if
if k<>1 then
response.write "<a href='News.asp?page=1'> 首頁 </a>"
response.write "<a href='News.asp?page="+cstr(k-1)+"'> 上一頁 </a>"
end if
if k=n then
response.write " 下一頁 "& vbCrLf
response.write " 末頁 "& vbCrLf
end if
if k<>n then
response.write "<a href='News.asp?page="+cstr(k+1)+"'> 下一頁 </a>"
response.write "<a href='News.asp?page="+cstr(n)+"'> 末頁 </a> "
end if
%>
</td>
</tr>
</table>
<% end sub %>
</td>
</tr>
</table>
<!-- 新聞列表結束-->
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<!--#include file="xbqq_foot.asp" -->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -