📄 default.asp
字号:
<!--#include file="conn.asp" -->
<%
dim pmcount,pageno
pmcount=25 '每页新闻数目
%>
<html>
<head>
<title>QbTrade.com最新消息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
<script language="javascript">
function view(id){
var id;
window.open('view.asp?id='+id,'_blank','status=no,scrollbars=yes,top=20,left=110,width=580,height=420');
}
</script>
</head>
<%
dim rs,sql
set rs=server.createobject("adodb.recordset")
%>
<body bgcolor="#FFFFFF">
<script language="JavaScript" src="banner_up.asp">
</script>
<form name="form1" method="post" action="default.asp">
<div align="center">新闻搜索:
<input type="text" name="keyword" class="smallInput">
@
<select name="cataid">
<%
sql="select * from category"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<option value=''>没有分类</option>"
else
do while not rs.eof
response.write "<option value='"&rs("id")&"'"
if request("cataid")<>"" then
if rs("id")=cint(request("cataid")) then response.write " selected "
end if
response.write ">"&rs("title")&"</option>"
rs.movenext
loop
end if
rs.close
%>
</select>
<input type="image" border="0" name="imageField" src="images/search.gif" width="39" height="18">
</div>
</form>
<table width="686" border="0" align="center" cellspacing="3" cellpadding="3">
<tr>
<td colspan="2"><font color="#000000"><font color="#FF0066"><font face="Arial, Helvetica, sans-serif">QB</font></font><font face="Arial, Helvetica, sans-serif">Trade.com</font></font>新闻中心
- <font color="#FF0000">QB<font color="#000000">Trade.com</font> N</font><font color="#FF9900">e</font><font color="#00CC00">w</font><font color="#0000FF">s</font>
center</td>
</tr>
<tr>
<td width="136" bgcolor="#FFCC00" valign="top">
<table width="100%" border="0">
<tr>
<td>
<div align="center"><font color="#FF0000">..::新闻分类::..</font></div>
</td>
</tr>
<%
'on error resume next
sql="select * from category"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td><div align='center'>没有分类</div></td></tr>"
else
do while not rs.eof
%>
<tr>
<td>
<div align="center"><a href="default.asp?cataid=<%=rs("id")%>"><%=rs("title")%></a></div>
</td>
</tr>
<%
rs.movenext
loop
end if
rs.close
%>
<tr>
<td>
<div align="center"><font color="#FF0000">..:.<a href="default.asp">全部新闻</a>.:..</font></div>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0">
<tr>
<td width="17%"><img src="images/news.gif" width="16" height="11"></td>
<td width="83%">附带插图</td>
</tr>
<tr>
<td width="17%"><img src="images/zip.gif" width="15" height="16"></td>
<td width="83%">zip下载</td>
</tr>
<tr>
<td width="17%"><img src="images/rar.gif" width="16" height="15"></td>
<td width="83%">rar下载</td>
</tr>
<tr>
<td width="17%"><img src="images/exe.gif" width="18" height="16"></td>
<td width="83%">exe下载</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div align="center">
<script language=javascript>
document.write("<a href=\"http://sendto.163.com:88/recommend.php?ID=23232&referer="+parent.location+"&parentTitle="+document.title+"parentTitleEnd\" target=OpenWindow>介绍给朋友</a>");
</script>
</div>
</td>
</tr>
</table>
</td>
<td width="547" bgcolor="#FFFFCC" nowrap>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#000000">
<tr bgcolor="#009900">
<td colspan="4">
<div align="right"><font color="#FFFFFF">...::
<%
dim cataid
cataid=request("cataid")
if cataid="" then
response.write "最新消息"
else
sql="select * from category where id="&cstr(request("cataid"))
rs.open sql,conn,1,1
catid=rs("title")
rs.close
if request("keyword")<>"" then response.write "搜索<font color=red>"&request("keyword")&"</font> @ "
response.write catid
end if
%>
::...</font></div>
</td>
</tr>
<tr bgcolor="#CCFF99">
<td width="14%">
<div align="center">类别</div>
</td>
<td width="63%">
<div align="center">标题</div>
</td>
<td width="15%">
<div align="center">加入时间</div>
</td>
<td width="8%">
<div align='center'>点击</div>
</td>
</tr>
<%
if request("keyword")="" then
if cataid="" then
sql="select * from news order by id desc"
else
sql="select * from news where cataid='"&catid&"' order by id desc"
end if
else
sql="select * from news where (title like '%"&request("keyword")&"%' or content like '%"&request("keyword")&"%') and cataid='"&catid&"' order by id desc"
end if
rs.open sql,conn,1,1
if pmcount="" or isempty(pmcount) or pmcount<1 then
pmcount=25
end if
rs.pagesize=pmcount '设置每页数
mpage=rs.pagecount '得到总页数
pageno=request("pageno")
if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
if rs.bof and rs.eof then
response.write "<tr><td colspan='5'><div align='center'>没有新闻</div></td></tr>"
else
rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount
do while not rs.eof and loopno>0
%>
<tr>
<td width="14%">
<div align='center'><%=rs("cataid")%></div>
</td>
<td width="63%"><a href="javascript:view(<%=rs("id")%>)">
<%response.write rs("title")
if rs("image")<>"" then
response.write "<img src='images/news.gif' border=0>"
end if
select case right(rs("linkurl"),4)
case ".zip"
response.write "<img src='images/zip.gif' border=0>"
case ".rar"
response.write "<img src='images/rar.gif' border=0>"
case ".exe"
response.write "<img src='images/exe.gif' border=0>"
end select
%>
</a></td>
<td width="15%">
<div align='center'><%=rs("addtime")%></div>
</td>
<td width="8%">
<div align='center'><%=rs("hits")%></div>
</td>
</tr>
<%
rs.movenext
loopno=loopno-1
loop
end if
rs.close
set rs=Nothing
endconnection
%>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class=buinput>
<tr align="right">
<td>
<%
if cint(pageno)>1 then%>
[<a href='default.asp?cataid=<%=cataid%>&pageno=<%=pageno-1%>&keyword=<%=request("keyword")%>'>上一页</a>]
<%
end if
if cint(pageno)<cint(mpage) then
%>
[<a href='default.asp?cataid=<%=cataid%>&pageno=<%=pageno+1%>&keyword=<%=request("keyword")%>'>下一页</a>]
<%end if%>
共<%=cstr(pageno)&"/"&cstr(mpage)%>页 </td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#99CCFF">
<td colspan="2" valign="top">
<div align="center"><font color="#660099">爆料有奖!凡是跟上面有关的其他新闻,请发到<a href="mailto:qbtrade@21cn.com">qbtrade@21cn.com</a>来,根据新闻价值赠送10~100Q币不等。</font></div>
</td>
</tr>
</table>
<script language="JavaScript" src="http://www.qbtrade.com/showlink.asp?user=qbtrade&style=1"></script>
<script language="JavaScript" src="copyright.js"></script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -