📄 default123.asp
字号:
<!--#include file = "../Include/DBClass.inc.asp"-->
<%
Dim s_keyword, s_cataid, s_RootID
s_keyword = GetSafeStr(Trim(Request("keyword")))
s_cataid = GetSafeStr(Trim(Request("cataid")))
'当然更改为其他跟栏目的时候,只需要适当的更改下面的值,就可以实现不同栏目。
s_RootID = "A"
If s_cataid = "" Then
s_cataid = s_RootID
End If
'检测当前类别类别的合法性,其实我感觉检测与否对系统影响不大
Dim bRs, bSql
Set bRs = Server.CreateObject( "ADODB.Recordset" )
bSql = "SELECT * FROM NewsCata Where C_RootID = '"&s_cataid&"'"
bRs.Open bSql, oConn, 0, 1
If bRs.Eof Then
GoError "请通过页面上的链接进行操作,不要试图进行任何非法操作。"
End If
bRs.Close
Set bRs = Nothing
Dim Pmcount,Pageno
'//设置新闻显示数量
Pmcount = News_Front_Count
%>
<HTML>
<HEAD>
<TITLE><%=Homepage_Title%>-显示详细的信息</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<link rel="stylesheet" href="/Css/Style.css" type="text/css">
<SCRIPT language=javascript>
<!--
function mOvr(src,clrOver) {
if (!src.contains(event.fromElement)) {
src.bgColor = clrOver;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.bgColor = clrIn;
}
}
// -->
</SCRIPT>
</HEAD>
<BODY LeftMargin=0 TopMargin=0 Background="../images/bg.gif">
<!--#include file = "../Include/Header.asp"-->
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td height="100" background="../images/av_news.jpg"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="777" height="100">
<param name=movie value="../images/movie.swf">
<param name=quality value=high>
<param name="wmode" value="transparent">
<param name="menu" value="false">
<embed src="../images/movie.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="777" height="100" wmode="transparent" menu="false">
</embed>
</object></td>
</tr>
</table>
<table cellspacing=0 cellpadding=0 width=777 align=center border=0 bgcolor="#FFFFFF">
<tbody>
<tr>
<td valign=top width=200 bgcolor=#f5f5f5>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td background="images/bg_1.gif" height=25>
<div align="center"><b><font color="#cc0000">□ 信息栏目导航</font></b></div>
</td>
</tr>
<tr>
<td background="../images/line_3.gif" height=1></td>
</tr>
<tr>
<td bgcolor=#f5f5f5 height=30> </td>
</tr>
<tr>
<td height=1>
<table cellspacing=0 cellpadding=0 width="80%" align=center border=0>
<tbody>
<tr>
<td width="100%" background="../images/line_3.gif" height=1></td>
</tr>
</tbody>
</table>
</td>
</tr>
<%
Dim mRs, mSql, mRootID, mLen, TempListStr
set mRs = server.CreateObject("Adodb.Recordset")
mSql="SELECT * FROM NewsCata ORDER BY C_RootID DESC"
mRs.Open mSql,oConn,1,1
Do While Not mRs.Eof
mRootID = mRs("C_RootID")
mLen = Len(mRootID)
If mLen = 5 Then '这里是读取所有的二级栏目
TempListStr="<tr valign=center align=middle bgcolor=#ffffff>"
TempListStr=TempListStr&"<td onMouseOver=mOvr(this,'#ffffff'); onMouseOut=mOut(this,'#f5f5f5'); bgcolor=#f5f5f5 height=25>"
TempListStr=TempListStr&"<div align=right><a href='?cataid="&Trim(mRs("C_RootID"))&"'>"&Trim(mRs("C_Title"))&"</a> <img src='../images/pot_11.gif'> </div></td>"
TempListStr=TempListStr&"<tr>"
TempListStr=TempListStr&"<td bgcolor=#f5f5f5>"
TempListStr=TempListStr&"<table cellspacing=0 cellpadding=0 width=80% align=center border=0>"
TempListStr=TempListStr&"<tbody>"
TempListStr=TempListStr&"<tr> "
TempListStr=TempListStr&"<td width='100%' background='../images/line_3.gif' height=1></td>"
TempListStr=TempListStr&"</tr>"
TempListStr=TempListStr&"</tbody>"
TempListStr=TempListStr&"</table>"
TempListStr=TempListStr&"</td>"
TempListStr=TempListStr&"</tr>"
Response.Write TempListStr
End if
mRs.MoveNext
Loop
mRs.Close
set mRs = Nothing
%>
<tr>
<td height=30>
</td>
</tr>
</tbody>
</table>
</td>
<td valign=top style="border-left:1px #000000 dotted"><br>
<table cellspacing=0 cellpadding=0 width=596 border=0>
<tbody>
<tr>
<td valign=top>
<table cellspacing=0 cellpadding=0 width="96%" align=center border=0>
<tbody>
<tr>
<td><img src="../images/title_news.gif" width="550" height="78"></td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
'开始读取当前位置的信息
Dim aRs, aSql, aRootID, aTitle, aLen, i, TempStr
Response.write "当前类别:"
If Len(s_cataid) < 5 Then
Response.Write "<font color=#FF0000>所有内容</font>"
Else
TempStr = "<a href='?cataid='>所有内容</a>"
aLen = Int(Len(Trim(s_cataid))/4)
For i = 1 To aLen
aRootID = Mid(s_cataid,1,4*i+1)
Set aRs = Server.CreateObject( "ADODB.Recordset" )
aSql = "SELECT * FROM NewsCata WHERE C_RootID = '"&aRootID&"' ORDER BY C_ID DESC"
aRs.Open aSql, oConn, 0, 1
If Not aRs.Eof Then
aTitle = aRs("C_Title")
End If
aRs.Close
Set aRs = Nothing
If i = aLen Then
TempStr = TempStr & " >> <font color='#FF0000'>"& aTitle &"</font></a>"
Else
TempStr = TempStr & " >> <a href='?cataid="& aRootID &"'>"& aTitle &"</a>"
End If
Next
Response.Write TempStr
End If
%>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#E1F0FF">
<form name="search" method="post" action="Default.asp">
<tr>
<td height="20" width="3%" valign="bottom">
<div align="right"></div>
</td>
<td height="20" width="97%">
<div align="center">信息搜索-->>> 关键词:
<input type="text" name="keyword" class="button1" size="20" value="<%=s_keyword%>" onMouseOver=this.focus() onFocus=this.select()>
栏目:
<select name="cataid" onChange="javascript:document.search.submit();">
<option value="">---> 信息快递 <---</option>
<%
'开始读取数据库中已经定义的新闻类别
'其实这么写,感觉太没有效率了,应该定义一个子程序
Dim cRs, cSql, j, TempCataStr
Set cRs = Server.CreateObject( "ADODB.Recordset" )
cSql = "SELECT * FROM NewsCata Where C_RootID LIKE '"&s_RootID&"%' And C_RootID <> '"&s_RootID&"' ORDER BY C_RootID"
cRs.Open cSql, oConn, 1, 3
Do While Not cRs.EOF
TempCataStr = "<option value='"&Trim(cRs("C_RootID"))&"'"
If Trim(cRs("C_RootID")) = Trim(s_cataid) Then TempCataStr = TempCataStr&" selected"
TempCataStr = TempCataStr&">"
TempCataStr = TempCataStr&" | |"
For j = 1 To Int(Len(Trim(cRs("C_RootID")))/4) - 1
TempCataStr = TempCataStr&" |"
Next
TempCataStr = TempCataStr&"_"&Trim(cRs("C_Title"))&"</option>"
Response.Write TempCataStr
cRs.MoveNext
Loop
cRs.Close
Set cRs = Nothing
%>
</select>
<input type="image" border="0" name="imageField" src="images/search.gif" width="39" height="18">
</div>
</td>
</tr>
</form>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#000000" style="word-break:break-all;">
<%
If News_Check = 1 Then
If s_keyword <> "" Then
sSql = "SELECT * FROM NewsData WHERE D_CataID LIKE '"&s_cataid&"%' and D_Title LIKE '%"&s_keyword&"%' and D_Num = 1 ORDER BY D_SortID DESC"
Else
sSql = "SELECT * FROM NewsData WHERE D_CataID LIKE '"&s_cataid&"%' and D_Num = 1 ORDER BY D_SortID DESC"
End If
Else
If s_keyword <> "" Then
sSql = "SELECT * FROM NewsData WHERE D_CataID LIKE '"&s_cataid&"%' and D_Title LIKE '%"&s_keyword&"%' ORDER BY D_SortID DESC"
Else
sSql = "SELECT * FROM NewsData WHERE D_CataID LIKE '"&s_cataid&"%' ORDER BY D_SortID DESC"
End If
End If
oRs.Open sSql, oConn, 1, 1
Dim Rcount, Loopno, Mpage
Rcount = oRs.Recordcount
If Pmcount="" or isempty(Pmcount) or Pmcount<1 then
Pmcount=20
End If
oRs.Pagesize = pmcount '设置每页数
Mpage = oRs.Pagecount '得到总页数
Pageno = GetSafeInt(Request("Pageno"),1)
If Cint(Pageno) < 1 Then Pageno = 1
If Cint(Pageno) > Mpage Then Pageno = Mpage
If oRs.Bof and oRs.Eof then
Response.write "<tr><td colspan='6'> 暂时没有任何新闻!</td></tr>"
Else
oRs.Absolutepage = Pageno '将指针移至指定页的第一条记录
Loopno = Pmcount
Do While Not oRs.Eof and Loopno > 0
%>
<tr>
<td width="3%" height="24"><img height=6 src="../images/pot_1.gif" width="4" nowrap></td>
<td width="97%" background="images/bg.gif" height=24>
<a href='Show.asp?id=<%=oRs("D_ID")%>' class='tt1' target='_blank'><%Response.Write oRs("D_Title")%></a>
<%
if Trim(oRs("D_SavePathFileName"))<>"" then
Response.Write " <img src='images/news.gif' border=0>"
end if
%>
<a title="<%=oRs("D_AddTime")%>"><font color="#FF9900">[
</font><font color=#FF9900><%=FormatDateTime(oRs("D_AddTime"),vbshortdate)%>
浏览:<%=oRs("D_Hits")%> ]</font></a></td>
</tr>
<%
oRs.Movenext
Loopno=Loopno-1
Loop
oRs.Close
Set oRs=Nothing
End if
%>
</table>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E1F0FF">
<form name="pageform" method="post" action="Default.asp">
<tr>
<td height="25">
<div align="left"> 共 <%=Cstr(rcount)%> 条新闻 当前为:<font color="#FF0000"><%=Cstr(Pageno)&"</font>/"&Cstr(Mpage)%>页 每页 <%=pmcount%> 条</font></div></td>
<td>
<div align="right">
<%If Cint(Pageno)>1 Then%>
<font face="Webdings" color="#FF0000">7</font> <a href='?cataid=<%=s_cataid%>&keyword=<%=s_keyword%>&pageno=<%=Pageno-1%>' class="tt5">上一页</a>
<%End If
If Cint(Pageno) < Cint(Mpage) Then
%>
<font face="Webdings" color="#FF0000">8</font> <a href='?cataid=<%=s_cataid%>&keyword=<%=s_keyword%>&pageno=<%=Pageno+1%>' class="tt5">下一页</a>
<%End If%>
跳到第 <input type=text size=3 name="Pageno" value="<%=pageno%>" class="button1"> 页
<input type="hidden" name="cataid" value="<%=s_cataid%>">
<input type="hidden" name="keyword" value="<%=s_keyword%>">
<input name="imageField2" type="image" src="../Images/Go.gif" border="0" align="absmiddle">
</font></div></td>
</tr>
</form>
</table></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td bgcolor=#9ac7cf height=1></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--#include file = "../Include/Footer.asp"-->
<%
Call Footer()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -