?? detail.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT" codepage=936 %>
<!--#include file="Connections/news.asp" -->
<!--#include file="head_kong.asp" -->
<%
if(request.querystring("n_id") <> "") then Command1__MMColParam = request.querystring("n_id")
%>
<!--#include file="code.asp" -->
<!--#include file="ubb.asp" -->
<%
Dim rsn__MMColParam
rsn__MMColParam = "1"
if (Request.QueryString("n_id") <> "") then rsn__MMColParam = Request.QueryString("n_id")
%>
<%
set rsn = Server.CreateObject("ADODB.Recordset")
rsn.ActiveConnection = MM_news_STRING
rsn.Source = "SELECT * FROM news WHERE n_id = " + Replace(rsn__MMColParam, "'", "''") + ""
rsn.CursorType = 0
rsn.CursorLocation = 2
rsn.LockType = 3
rsn.Open()
rsn_numRows = 0
%>
<%
Dim rsc__MMColParam
rsc__MMColParam = "1"
if (Request.QueryString("true") <> "") then rsc__MMColParam = Request.QueryString("true")
%>
<%
set rsc = Server.CreateObject("ADODB.Recordset")
rsc.ActiveConnection = MM_news_STRING
rsc.Source = "SELECT n_id, n_title FROM news WHERE n_com = " + Replace(rsc__MMColParam, "'", "''") + " ORDER BY n_data DESC"
rsc.CursorType = 0
rsc.CursorLocation = 2
rsc.LockType = 3
rsc.Open()
rsc_numRows = 0
%>
<%
set rsb = Server.CreateObject("ADODB.Recordset")
rsb.ActiveConnection = MM_news_STRING
rsb.Source = "SELECT * FROM big"
rsb.CursorType = 0
rsb.CursorLocation = 2
rsb.LockType = 3
rsb.Open()
rsb_numRows = 0
%>
<%
set rsh = Server.CreateObject("ADODB.Recordset")
rsh.ActiveConnection = MM_news_STRING
rsh.Source = "SELECT n_id, b_id, n_title, n_hit FROM news ORDER BY n_hit DESC"
rsh.CursorType = 0
rsh.CursorLocation = 2
rsh.LockType = 3
rsh.Open()
rsh_numRows = 0
%>
<%
Dim rsr__MMColParam
rsr__MMColParam = "1"
if (Request.QueryString("n_id") <> "") then rsr__MMColParam = Request.QueryString("n_id")
%>
<%
set rsr = Server.CreateObject("ADODB.Recordset")
rsr.ActiveConnection = MM_news_STRING
rsr.Source = "SELECT r_id, n_id FROM review WHERE n_id = '" + Replace(rsr__MMColParam, "'", "''") + "'"
rsr.CursorType = 0
rsr.CursorLocation = 2
rsr.LockType = 3
rsr.Open()
rsr_numRows = 0
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_news_STRING
Command1.CommandText = "UPDATE news SET n_hit =n_hit+1 WHERE n_id =" + Replace(Command1__MMColParam, "'", "''") + ""
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsb_numRows = rsb_numRows + Repeat1__numRows
%>
<%
Dim Repeat3__numRows
Repeat3__numRows = 10
Dim Repeat3__index
Repeat3__index = 0
rsc_numRows = rsc_numRows + Repeat3__numRows
%>
<%
Dim Repeat4__numRows
Repeat4__numRows = 10
Dim Repeat4__index
Repeat4__index = 0
rsh_numRows = rsh_numRows + Repeat4__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
rsr_total = rsr.RecordCount
' set the number of rows displayed on this page
If (rsr_numRows < 0) Then
rsr_numRows = rsr_total
Elseif (rsr_numRows = 0) Then
rsr_numRows = 1
End If
' set the first and last displayed record
rsr_first = 1
rsr_last = rsr_first + rsr_numRows - 1
' if we have the correct record count, check the other stats
If (rsr_total <> -1) Then
If (rsr_first > rsr_total) Then rsr_first = rsr_total
If (rsr_last > rsr_total) Then rsr_last = rsr_total
If (rsr_numRows > rsr_total) Then rsr_numRows = rsr_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (rsr_total = -1) Then
' count the total records by iterating through the recordset
rsr_total=0
While (Not rsr.EOF)
rsr_total = rsr_total + 1
rsr.MoveNext
Wend
' reset the cursor to the beginning
If (rsr.CursorType > 0) Then
rsr.MoveFirst
Else
rsr.Requery
End If
' set the number of rows displayed on this page
If (rsr_numRows < 0 Or rsr_numRows > rsr_total) Then
rsr_numRows = rsr_total
End If
' set the first and last displayed record
rsr_first = 1
rsr_last = rsr_first + rsr_numRows - 1
If (rsr_first > rsr_total) Then rsr_first = rsr_total
If (rsr_last > rsr_total) Then rsr_last = rsr_total
End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
dim strRet
strRet = Server.HTMLEncode(str)
strRet = replace(strRet, vbcrlf,"")
strRet = replace(strRet, vbtab,"")
If (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet, nNamedFormat)
If (properly = 1) Then
Dim TempArray
TempArray = split(strRet, " ")
Dim n
strRet = ""
for n = 0 to Ubound(TempArray) - 1
strRet = strRet & " " & TempArray(n)
next
End If
If (pointed = 1) Then
strRet = strRet & points
End If
End If
DoTrimProperly = strRet
End Function
</SCRIPT>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
</SCRIPT>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoWhiteSpace(str)
DoWhiteSpace=Replace((Replace(str,vbCrlf,"<br>")),chr(32)&chr(32)," ")
End Function
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="intohz.css" type="text/css">
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" height="1">
<tr>
<td bgcolor="#CCCCCC"></td>
</tr>
</table>
<table width="778" height="60" border="0" align="center" cellpadding="0" cellspacing="0" background="images/bg2.gif" bgcolor="#FFFFFF">
<tr>
<td width="79%">
<table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td height="30">
<div align="center"><b class="big"><%=(rsn.Fields.Item("n_title").Value)%></b></div>
</td>
</tr>
<tr>
<td>
<div align="center">日期:<font color="#FF0000"><%= DoDateTime((rsn.Fields.Item("n_data").Value), 2, 1042) %></font> 作者:<font color="#FF0000"><%=(rsn.Fields.Item("n_author").Value)%></font> 閱讀:<font color="#FF0000"><%=(rsn.Fields.Item("n_hit").Value)%></font></div>
</td>
</tr>
</table>
</td>
<td width="21%">
<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<form name="form1" method="get" action="search.asp">
<td>
<div align="center"><br>
<input type="text" name="sss2" size="18">
<br>
<br>
<select name="select" size="1">
<option value="n_title" selected>標(biāo)題</option>
<option value="n_author">作者</option>
<option value="n_content">內(nèi)容</option>
</select>
<input type="submit" name="Submit2" value=" 搜 ">
</div></td>
</form>
</tr>
</table>
</td>
</tr>
</table>
<table width="778" height="200" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" background="images/bg2.gif" bgcolor="#FFFFFF">
<tr>
<td width="79%" valign="top">
<table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td style="word-break:break-all"><%=DoWhiteSpace(ubbcode(rsn.Fields.Item("n_content").Value))%></td>
</tr>
</table>
</td>
<td width="21%" valign="top"> <br>
<table width="99%" height="100" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td height="100%"><br>
<br> <table width="92%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="426DB4">
<tr>
<td height="20" background="images/biao_t.gif"> <font color="#FFFFFF"> 推薦新聞:</font></td>
</tr>
<tr>
<td bgcolor="#F7F7F7" height="150" valign="top"><br> <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" height="16">
<%
While ((Repeat3__numRows <> 0) AND (NOT rsc.EOF))
%>
<tr>
<td width="13"><img src="images/arrow.gif" width="15" height="11"></td>
<td width="167"> <a href="detail.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "n_id=" & rsc.Fields.Item("n_id").Value %>" target="_blank">
<% =(DoTrimProperly((rsc.Fields.Item("n_title").Value), 10, 0, 1, "...")) %>
</a> </td>
</tr>
<%
Repeat3__index=Repeat3__index+1
Repeat3__numRows=Repeat3__numRows-1
rsc.MoveNext()
Wend
%>
</table>
<br> </td>
</tr>
</table>
<br> <table width="92%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="426DB4">
<tr>
<td height="20" background="images/biao_t.gif"> <font color="#FFFFFF"> 閱讀排行:</font></td>
</tr>
<tr>
<td bgcolor="#F7F7F7" height="150" valign="top"><br> <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" height="15">
<%
While ((Repeat4__numRows <> 0) AND (NOT rsh.EOF))
%>
<tr>
<td width="13"><img src="images/arrow.gif" width="15" height="11"></td>
<td width="167"> <a href="detail.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "n_id=" & rsh.Fields.Item("n_id").Value %>" target="_blank">
<% =(DoTrimProperly((rsh.Fields.Item("n_title").Value), 10, 0, 1, "...")) %>
</a> </td>
</tr>
<%
Repeat4__index=Repeat4__index+1
Repeat4__numRows=Repeat4__numRows-1
rsh.MoveNext()
Wend
%>
</table>
<br> </td>
</tr>
</table>
<br> </td>
</tr>
</table>
</td>
</tr>
</table>
<table width="778" height="60" border="0" align="center" cellpadding="0" cellspacing="0" background="images/bg2.gif" bgcolor="#FFFFFF">
<tr>
<td width="79%" valign="top">
<div align="center" class="big"><br>
<span class="big">【目前共有<font color="#FF0000"><%=(rsr_total)%></font>篇對(duì)該新聞的評(píng)論】 【<A HREF="review.asp?n_id=<%=(rsn.Fields.Item("n_id").Value)%>">發(fā)表評(píng)論</A>】</span></div>
</td>
<td width="21%"> </td>
</tr>
</table>
<!--#include file="end.asp" -->
<%
rsn.Close()
%>
<%
rsc.Close()
%>
<%
rsb.Close()
%>
<%
rsh.Close()
%>
<%
rsr.Close()
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -