如果控制显示的字数??
这是首页调用的新闻程序,如果控制在首页显示的字数,其他的省略为...??
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn_news.asp" -->
<% dim s
s=request("s")
%>
<%
Dim rs__MMColParam
rs__MMColParam = "1"
If (Request.QueryString("t_id") <> "") Then
rs__MMColParam = Request.QueryString("t_id")
End If
%>
<%
Dim rs
Dim rs_numRows
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conn_news_STRING
rs.Source = "SELECT * FROM t_news WHERE n_tid = " + Replace(rs__MMColParam, "'", "''") + " and n_check = true ORDER BY n_id DESC"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
rs_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = s
Repeat1__index = 0
rs_numRows = rs_numRows + Repeat1__numRows
%>
<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>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs.EOF))
%>
document.write('<table width="98%" border="0" cellspacing="0" cellpadding="0"><tr> <td width="5%" align="center" height="16"><img src="news/pic_site/arrow.gif" width="15" height="11"></td><td><a href="news/<%=(rs.Fields.Item("n_tid").Value)%>/<%=(rs.Fields.Item("n_fname").Value)%>" target="_blank"><%=(rs.Fields.Item("n_title").Value)%></a></td><td width="20%"><%= DoDateTime((rs.Fields.Item("n_date").Value), 4, 1033) %></td></tr></table>');
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
<%
rs.Close()
Set rs = Nothing
%>