<!--#include file="conn.asp"-->
<%
'-------------------------------------
'功能：显示符合条件的友情链接
'更新：2004-1-2 10:37
'作者：未知-部落忍者
'演示：http://www.0cc.cn/link/
'-------------------------------------
%>
<title><%=WebName&ChannelName%>_本程序由★零星部落★提供</title>
<style type="text/css">
</style>
<link rel="stylesheet" href="style.css">
<body leftmargin="0" topmargin="0">
<table width=100% cellpadding=0 cellspacing=0 class="main_title1" align="center">
  <tr> 
    <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><strong><%=WebName&ChannelName%></strong> -- 用户自助申请、修改、查询，系统自动审核，自动排列！</td>
          <td width="100" align="center"><a href="morelink.asp" target="_blank">更多</a> 
            | <a href="addlink.asp" target="_blank">申请</a></td>
        </tr>
      </table>
      </td>
  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="main_tdbg2">
  <tr>
    <td>
<%
if not hxcache.ObjIsEmpty() then
	strjs=hxcache.value
else
	dim rs
	set rs=hx.execute("select username,siteurl,sitename,sitelogo,siteintro,inp from CL_Link where inp>="&inpc&" order by inp desc")
	dim i,n,j,tdwidth
	i=1
	n=1
	j=1
	dim strjs
	tdwidth=formatnumber(100/LineNum,1)
	strjs="<table border=0 cellpadding=3 cellspacing=0>"	
	if rs.eof then
		strjs=strjs + "<tr><td align=center>暂时还没有友情链接</td></tr>"
	else	
		'V1.5新加参数MaxLine
		if MaxLine = 0 then
			Do While Not rs.eof
				if i mod LineNum =1 then
					strjs=strjs + "<tr>"
				end if
				if i <= LineNum * LineLogo then
					strjs=strjs + "<td width="""&tdwidth&"%"" align=center>"
					strjs=strjs + "<a href=""http://"&hx.BaseUrl&"out.asp?username="&rs(0)&""" target=""_blank"">"
					strjs=strjs + "<img src="""&hx.htmlencode2(rs(3))&""" width=88 height=31 border=0 alt="""&hx.htmlencode2(rs(2))&" -- "&hx.htmlencode2(rs(4))&"""></a>"
					strjs=strjs + "</td>"
				else
					strjs=strjs + "<td width="""&tdwidth&"%"" align=center>"
					strjs=strjs + "<a href=""http://"&hx.BaseUrl&"out.asp?username="&rs(0)&""" target=""_blank"">"				
					strjs=strjs + hx.htmlencode2(rs(2))
					strjs=strjs + "</a>"
					strjs=strjs + "</td>"	
				end if
				if i mod LineNum =0 then
					strjs=strjs + "</tr>"
				end if
				
				rs.MoveNext
				i=i+1
			Loop
			

		else 'V1.5新加参数MaxLine的处理
			'MaxLine不能小于LineNum
			if MaxLine <= LineLogo then MaxLine = LineLogo + 1
			Do While Not rs.eof and i <= MaxLine * LineNum
				if i mod LineNum =1 then
					strjs=strjs + "<tr align=""center"">"
				end if
				if i <= LineNum * LineLogo then
					strjs=strjs + "<td width="""&tdwidth&"%"">"
					strjs=strjs + "<a href=""http://"&hx.BaseUrl&"out.asp?username="&rs(0)&""" target=""_blank"">"
					strjs=strjs + "<img src="""&hx.htmlencode2(rs(3))&""" width=88 height=31 border=0 alt="""&hx.htmlencode2(rs(2))&" -- "&hx.htmlencode2(rs(4))&"""></a>"
					strjs=strjs + "</td>"
				elseif int(i/LineNum) = int(MaxLine-1) then
					if i mod LineNum < 8 then
						strjs=strjs + "<td width="""&tdwidth&"%"">"
						strjs=strjs + "<a href=""http://"&hx.BaseUrl&"out.asp?username="&rs(0)&""" target=""_blank"">"				
						strjs=strjs + hx.htmlencode2(rs(2))
						strjs=strjs + "</a>"
						strjs=strjs + "</td>"	
					end if			
				elseif i = MaxLine * LineNum then
						strjs=strjs + "<td width="""&tdwidth&"%"">"		
						strjs=strjs + "<a href=""http://"&hx.BaseUrl&"friendlink.asp"" target=""_blank""><font color=#0000FF>更多链接>></font></a>"		
						strjs=strjs + "</td>"																
				else		
					strjs=strjs + "<td width="""&tdwidth&"%"" align=center>"
					strjs=strjs + "<a href=""http://"&hx.BaseUrl&"out.asp?username="&rs(0)&""" target=""_blank"">"				
					strjs=strjs + hx.htmlencode2(rs(2))
					strjs=strjs + "</a>"
					strjs=strjs + "</td>"	
				end if		

				if i mod LineNum =0 then
					strjs=strjs + "</tr>"
				end if
				
				rs.MoveNext
				i=i+1
			Loop
		
		end if
		
			if i mod LineNum>0 then			
				strjs=strjs + "<td colspan="&LineNum-(i mod LineNum)+1&"></td>"
				strjs=strjs + "</tr>"
			end if	
	end if
	
	strjs=strjs + "</table>"
	hxcache.value=strjs
	rs.close:set rs=nothing
end if
response.write strjs
'hxcache.DelCahe("js")
%>
	</td>
  </tr>
</table>

   <table width=100% border=0 cellpadding=0 cellspacing=0 class="main_title1" align="center">
    <tr>
    <td>〖<a href="addlink.asp" target=_blank>申请友情链接</a>〗〖<a href="morelink.asp" target=_blank>查询网站点击</a>〗〖<a href="editlink.asp" target=_blank>管理网站信息</a>〗〖<a href="getcode.asp" target=_blank>重获链接代码</a>〗〖<a href="index.asp" target=_blank>系统使用说明</a>〗</td>
    </tr>
  </table>
 <%
CloseDatabase%>