⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 js-link_2.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 ASP
字号:
<!--
/*   
	调用方法:
  <script TYPE="text/javascript" language="javascript" src="js-link_2.asp?link=0&x=8&y=2"></script>	
	参数调用说明:
	1、link=0 ---文字方式, link=1 ----图形方式,link=2 ---下拉式
    2、x=8   -----每行有多少个链接
	3、y=2  ------共有多少行链接 
	*/
//-->

<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
 var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
 if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->


<%
lnk=trim(request("link"))      'link=0  文字方式,link=1 图形方式,2-下拉式
if (lnk="" or (lnk<>"0" and  lnk<>"1" and lnk<>"2")) then lnk="1"  '默认方式是图形方式
x=trim(request("x"))
y=trim(request("y"))

 if x="" or not isnumeric(x) then x=8  '默认一行8个连接
 if y="" or not isnumeric(y) then y=2  '默认有2行连接
 
 x=clng(x)
 y=clng(y)

top_n=x*y

lb=trim(request("lb"))

if (not isNumeric(lb)) then
	lb=0
end if
   
'图片连接开始
if lnk="2" then 
    sql = "select  *  from link where linkname<>'' " 
else
    sql = "select top "&top_n&"  *  from link where ( logo like '%.jpg%' or logo like '%.JPG%' or logo like '%.gif%' or logo like '%.GIF%' ) "  
end if

if lb<>0 then sql=sql&" and lb="&lb&" "
sql=sql&" and sh=1 order by ontop desc , upd desc , id desc"

Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1

if rs.recordcount=0 then 
    %>
	document.write ("无链接");
	<%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.end
end if

if lnk="2" then 
   y=1
   x=rs.recordcount
end if

 redim  array_lnk(y-1,x-1)   '定义一个连接数组 

'判断有多少个图形,是否够排列
for y_n=0 to y-1
      for x_n=0 to x-1
	       if  not rs.eof then
				url=trim(rs("url"))               '获取图片连接url地址
				linkname=trim(rs("linkname") )    '获取图片连接网站名字
				logo=trim(rs("logo"))             '获取图片地址
				js=trim(rs("js"))                '获取网站介绍文字
                
				if isempty(url) or isNull(url)  then url="#"
				if isempty(linkname) or isNull(linkname) then linkname="空链接"
				if isempty(logo) or isNull(logo) then logon="images/nologo.gif"
				if isempty(js)  or isNull(js) then js="暂无介绍"

				'把这些全部保存给数组
                array_lnk(y_n,x_n)=url&"$$$$$"&linkname&"$$$$$"&logo&"$$$$$"&js
				rs.movenext
            else
                array_lnk(y_n,x_n)="Link-apply.asp"&"$$$$$"&"空链接"&"$$$$$"&config("path")&"images/nologo.gif"&"$$$$$"&"暂无介绍"
		   end if
        next 
 next
rs.close
set rs=nothing
conn.close
set conn=nothing
'结束link表的读取.


   if lnk="0" or lnk="1" then 
      write_html="<div align='center'><table border='0' cellpadding='1' cellspacing='0' width='100%' id='tableasdaDF1'>"
   end if
   if lnk="2" then    write_html="<div align='center'><SELECT onchange=FP_jumpMenu(this,'_new',false) id=id1 name=D1><option>友情链接</option>"

   for yyyy=0 to y-1    '循环行,要求显示图片连接几行就循环几次 
          
		  if lnk<>"2"  then  write_html=write_html&"<tr>"
		
			for xxxx=0 to x-1   '循环列,每行要求几个图片连接就循环几次

			   some_lnk=split(array_lnk(yyyy,xxxx),"$$$$$")

				url=some_lnk(0)              '获取图片连接url地址
				linkname=some_lnk(1)      '获取图片连接网站名字
				logo=some_lnk(2)             '获取图片地址
				js=some_lnk(3)                 '获取网站介绍文字
                 
              if lnk="0"  then   '0-文字方式, 
                    write_html=write_html&"<td align='center'><a href="&url&" title="&linkname&" target=_blank>"&linkname&"</a></td>"
			 end if
			 if lnk="1"  then 		 '1-图片方式
                     write_html=write_html&"<td align=center><a href="&url&" title="&js&" target=_blank><img width=88 height=31 border=0 src="&logo&"></a></td>"
			  end if
             if lnk="2" then
			       if url<>"#"  then   write_html=write_html&"<option value="&url&">"&linkname&"</option>"
			 end if
            next
            if lnk<>"2"  then  write_html=write_html&"</tr>"
	next

  if lnk="2" then 
      write_html=write_html&"</select></div>"
  else
     write_html=write_html&"</table></div>"
 end if
   %>
  document.write("<%=write_html%>"); 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -