%
'-------------------------------------
'功能:显示所有友情链接页,带详细分类查找功能
'作者:ITlearner
'演示:http://www.itlearner.com/link/
'-------------------------------------
%>
<%
dim find,webtype,webtypename,pl,ob
dim rs,sql,trs
dim condition,linkstr
find=hx.checkstr(trim(request("find")),50)
webtype=request("webtype")
condition = " where isverify="&strTrue
pl=request("pl")
if pl="" then
pl="inp"
end if
linkstr = "pl=" & pl
ob = request("ob")
if ob<>"asc" then ob="desc"
if webtype="" or not isnumeric(webtype) then
webtype=0
else
'查询是否有此分类,取出类别名称
set trs = hx.execute("select name from CL_WebType where id="&webtype)
if trs.eof then
webtype=0
else
webtypename="类别:"&trs(0)&" - "
end if
set trs = nothing
end if
if webtype>0 then
condition = condition & " and webtype="&webtype
linkstr = linkstr & "&webtype="&webtype
end if
if find<>"" then
condition = condition & " and (sitename like '%"&find&"%' or siteintro like '%"&find&"%' or siteurl like '%"&find&"%')"
linkstr = linkstr & "&find="&find
end if
'分页信息
dim PageNo
PageNo=Request.QueryString("PageNo")
if PageNo="" or not isnumeric(PageNo) then
PageNo=1
else
PageNo=int(PageNo)
end if
dim rowcount
rowcount = PageNo*MaxPageSize
'普通sql语句
sql="select top "&rowcount&" * from CL_Link" & condition &" ORDER BY "&pl&" "&ob
%>
- >全部类别
<%call hx.listwebtype(webtype,1)%>
<%response.flush
hx.showPageInfo "CL_link","username",condition,PageNo,MaxPageSize,linkstr%>
<%
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
rs.move (PageNo-1)*MaxPageSize
dim i
i=0
%>
| 网站名称 |
链接图标 |
网站类别 |
网站登记时间 |
开始统计时间 |
最后点入时间 |
最后点出时间 |
<%Do While Not rs.EOF and i
| " target="_blank"><%=rs("sitename")%> |
" target="_blank"> " width="88" height="31" alt="网址:<%=hx.htmlencode2(rs("siteurl"))%>" border="0"> |
<%=hx.showwebtype(rs("webtype"))%> |
<%=rs("dateandtime")%> |
<%=rs("fromdate")%> |
<%=rs("indate")%> |
<%=rs("outdate")%> |
| 简 介 |
<%=hx.htmlencode2(rs("siteintro"))%> |
| 贡献统计 |
[你站]对[我站]:总计点入 <%=rs("inc")%> 今天点入 <%=rs("inj")%> 平均点入 <%=formatnumber(rs("inp"),2,-1)%>
[我站]对[你站]:总计点出 <%=rs("outc")%> 今天点出 <%=rs("outj")%> 平均点出 <%=formatnumber(rs("outp"),2,-1)%>
|
|
<%
i=i+1
rs.MoveNext
Loop
else
%>
| 没有找到你所查询的网站 |
<%
end if
rs.close
set rs=nothing
%>
<%set hx=nothing%>
<%
Function ShowTop(x,y)
Dim OutStr,constr
Dim rs,sql,i
constr = " where isverify="&strTrue&" and "
if webtype>0 then
constr = constr & "webtype="&webtype&" and "
end if
if y=2 then
if x=1 then
constr=constr&" inc>0 order by inc desc"
else
constr=constr&" outc>0 order by outc desc"
end if
sql="select top 5 sitename,inc,outc,id,siteurl from CL_link "&constr
else
if x=1 then
constr=constr&" inj>0 order by inj desc"
else
constr=constr&" outj>0 order by outj desc"
end if
sql="select top 5 sitename,inj,outj,id,siteurl from CL_link "&constr
end if
OutStr = "