现在有三个文件,都是显示排行榜的,但是它们显示的太长了,把我的网页撑变形了,所以我想麻烦各位一下,改一改,改成如果字附大于十就只显示前十个,如果不大于就正常显示。
第一个:
<%=Forumname%>
<%
dim sql
dim rs
dim flag
dim ostr
recordnum=request.querystring("recordnum")
if recordnum="" then
recordnum=10
end if
browsetype=request.querystring("browsetype")
if browsetype="" then
browsetype=1'说明开新窗口浏览
end if
timeview=request.querystring("timeview")
if timeview="" then
timeview=1
end if
if browsetype=1 then
flag="target='_blank'"
elseif browsetype=0 then
flag="target='_top'"
end if
ntypeid=request.querystring("ntypeid")
if ntypeid="" then
ntypeid=0
end if
if ntypeid=0 then
sql="select top " & recordnum & " * from article order by lastposttime desc"
else
sql="select top " & recordnum & " * from article where ntypeid=" & ntypeid & " order by lastposttime desc"
end if
%>
<% set rs=conn.execute(sql) if rs.eof and rs.bof then response.write " |
该讨论区还暂时没有文章 |
"
else
do while not rs.eof
if timeview=1 then
response.write ">> " & rs("title") & " " & rs("lastposttime") & " |
"
elseif timeview=0 then
response.write ">> " & rs("title") & " |
"
end if
rs.movenext
loop
end if
rs.close
set conn=nothing
%>
第二个:
<%
dim page
if not isempty(request("page")) then
page=cint(request("page"))
else
page=1
end if
dim rs10
set rs10=server.createobject("ADODB.recordset")
rs10.open"select * from zzfl",con,1,1
dim rs8
set rs8=server.createobject("ADODB.recordset")
sql="select * from down order by id desc"
rs8.open sql,con,1,1
dim rs7
set rs7=server.createobject("ADODB.recordset")
%>
<%
rs7.open "select top 10 id,name,dianji from down order by dianji desc",con,1,1
%>
<%if rs7.eof and rs7.bof then
response.write "»¹Ã»ÓÐÏÂÔØ×ÜTOP"
else
dim i
i=0
do while not rs7.eof%>
>> ')""><%=rs7("name")%> |
<%i=i+1
if i>9 then exit do
rs7.movenext
loop
end if
rs7.close
%>
第三个:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<% dim tuicool,strSQL2 strSQL2 ="SELECT * FROM learning WHERE best = true ORDER BY articleid DESC" Set tuicool = Server.CreateObject("ADODB.Recordset") tuicool.open strSQL2,Conn,3,1 cool=1 if tuicool.eof then response.write "Ä¿Ç°»¹Ã»Óо«Æ·ÍƼö" else do while not tuicool.eof if not tuicool.eof then %> >> &typeid=<%=tuicool("typeid")%>&zhuid=<%=tuicool("zhuid")%> target="_blank"><%=tuicool("title")%>
<%tuicool.movenext end if cool=cool+1 if tuicool.eof or cool>rs1("tuishu") then exit do end if loop tuicool.close set tuicool=nothing end if%> |
谢谢了,很急的。