如果控制显示的字数??

geniusxch 2003-12-23 01:41:14
这是首页调用的新闻程序,如果控制在首页显示的字数,其他的省略为...??

<%@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
%>
...全文
49 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧