这是一个友情链接的页,我想把它改成在一定范围内不重复随机读取几条信息,要怎么改?
<!--#include file="conn.asp" -->
<%
'自动重置每天点入数据开始
'strsql = "update ttlink set fouttoday=0,fouttime='"&date()&"' where 'fouttime<>#"&date()&"#"
'conn.Execute(strsql)
'strsql = "update ttlink set fintoday=0 where fintime<>#"&date()&"# and sh=1" '此为每天点入数清0的同时,最后点入时间不与当天时间同步。
'strsql = "update ttlink set fintoday=0,fintime='"&date()&"' where fintime<>#"&date()&"# and sh=1" '此为每天点入数清0的同时,最后点入时间与当天同步。
'conn.Execute(strsql)
'自动重置每天点入数据结束
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>首页调用_<%=WebName & ChannelName%></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="760">
<tr>
<td height="25" align="center" >
<p ><div class="main_title<%=skin%>"><font color='#FF0000'><%=WebName & ChannelName%> </font>
<a href="addlink.asp" target="_blank">申请友情链接</a>
| <a href="morelink.asp" target="_blank">友情链接列表</a>
| <a href="admin.asp" target="_blank">用户控制面板</a>
| <a href="help.asp" target="_blank">系统帮助中心</a>
</div></td>
</tr>
<tr>
<table border="1" cellspacing="0" width="760" bgcolor="#CDE4CF" bordercolorlight="#008000" bordercolordark="#FFFFFF" cellpadding="1" >
<% dim rs,i,j,username,tturl,ttname,ttlogo,ttinfo,inp,k,m,gd
set rs=hx.execute("select * from tt_Link where (inp>="&inpc&" and IsVerify="&strTrue&") or (gd=1 and IsVerify="&strTrue&") order by top desc,inp desc") '这句要怎么改?改成在原本条件不变的情况下不重复随机读取10或20条信息?
i=0
m=0
if MaxLine=0 then
MaxLine=10000
end if
do while not rs.eof and m<MaxLine
%>
<tr >
<%
for j=1 to LineNum
if rs.eof then
%>
<td class="tr<%=skin%>" align="center" width="760"> <center><a href="addlink.asp" target="_blank">
<%if k=<LineLogo*LineNum then%>
<img src='images/your_link.gif' width=88 height=31 border=0 alt="申请您的座位">
<%else%>
您的位置
<%end if%>
</a>
</td>
<%else
%>
<td class="tr<%=skin%>" width="760" class=tdc1 align="center">
<% if i<LineLogo*LineNum then
ttlogo=rs("ttlogo")
ttinfo=rs("ttinfo")
ttname=rs("ttname")%>
<center><a href="ttout.asp?username=<%=rs("username")%>" title="<%=ttname%>" target=_blank>
<% if ttlogo="" or ttlogo="" &WebUrl & "link/images/wu.gif" then %>
<table width="88" height="31" background="Images/nologo2.gif"><tr><td class=tdc1 align="center"><a href="ttout.asp?username=<%=rs("username")%>" title="<%=ttinfo%>" target=_blank><% if len(rs("ttname"))>6 then%><%if rs("gd")=1 then response.write "<font color=#FF0000>" end if%><%=""&Left(rs("ttname"),6)%><%if rs("gd")=1 then response.write "</font >" end if%><% else%><%if rs("gd")=1 then response.write "<font color=#FF0000>" end if%><%=""&rs("ttname")%><%if rs("gd")=1 then response.write "</font >" end if%><%end if%></a></td></tr></table> <%else%><% if j = MaxLine * LineNum then%>
<a href="/link/friendlink.asp" target="_blank" class="t"><img src="/link/images/gdlj.gif" width=88 height=31 border=0"</a>
<%else%><img src="<%=rs("ttlogo")%>" width=88 height=31 border=0 alt="<% if len(ttinfo)>30 then%><%=""&Left(ttinfo,30)%><% else%><%=""&ttinfo%><%end if%>"><%end if%>
<%end if%>
</a>
<%else%>
<table><tr><td class=tdc1 align="center">
<% if j = MaxLine * LineNum then%>
<a href="/link/friendlink.asp" target="_blank" class="t">更多链接>></a>
<%else%>
<a href="ttout.asp?username=<%=rs("username")%>" title="<%=ttinfo%>" target=_blank><% if len(rs("ttname"))>7 then%><%if rs("gd")=1 then response.write "<font color=#FF0000>" end if%><%=""&Left(rs("ttname"),7)%><%if rs("gd")=1 then response.write "</font >" end if%><% else%><%if rs("gd")=1 then response.write "<font color=#FF0000>" end if%><%=""&rs("ttname")%><%if rs("gd")=1 then response.write "</font >" end if%><%end if%></a><%end if%></td></tr></table>
<%
end if
i=i+1
k=k+1
rs.movenext
end if
next
%> </tr>
<%
m=m+1
loop
rs.close
set rs=nothing
'删除系统缓存
set hxcache=new cls_cache
hxcache.Name="js"
%>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="760">
<tr>
<td height="25" align="center" class="main_title<%=skin%>"><p ><div>本智能友情链接管理系统动态排名,按日均点进次数的多少来排列顺序,且日均大于<%=inpc%>次以上才在首页显示(前<%=LineLogo*LineNum%>位显示图标)!</div></td>
</tr>
</table></center>
麻烦各位帮帮我!谢谢!
[此贴子已经被作者于2007-9-19 15:44:53编辑过]