| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 670 人关注过本帖
标题:求助,横向链接如何改成竖向链接显示???
只看楼主 加入收藏
angerzl
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2007-8-20
结帖率:100%
收藏
 问题点数:0 回复次数:3 
求助,横向链接如何改成竖向链接显示???
横向链接如何改成竖向链接显示???
<% call ShowFriendLinks(2,6,6,2) '文字链接
'call ShowFriendLinks(1,10,10,2) '图片链接
%>
搜索更多相关主题的帖子: 链接 
2008-03-26 13:35
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
查看sub ShowFriendLinks()的用法
2008-03-26 13:37
angerzl
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2007-8-20
收藏
得分:0 
'==================================================
'过程名:ShowFriendLinks
'作  用:显示友情链接站点
'参  数:LinkType  ----链接方式,1为LOGO链接,2为文字链接
'       SiteNum   ----最多显示多少个站点
'       Cols      ----分几列显示
'       ShowType  ----显示方式。1为向上滚动,2为横向列表,3为下拉列表框
'==================================================
sub ShowFriendLinks(LinkType,SiteNum,Cols,ShowType)
    dim sqlLink,rsLink,SiteCount,i,strLink
    if LinkType<>1 and LinkType<>2 then
        LinkType=1
    else
        LinkType=Cint(LinkType)
    end if
    if SiteNum<=0 or SiteNum>100 then
        SiteNum=10
    end if
    if Cols<=0 or Cols>20 then
        Cols=10
    end if
    if ShowType=1 then'
        strLink=strLink & "<div id=rolllink style=overflow:hidden;height:100;width:100><div id=rolllink1>"    '新增加的代码
    elseif ShowType=3 then
        strLink=strLink & "<select name='FriendSite' onchange=""if(this.options[this.selectedIndex].value!=''){window.open(this.options[this.selectedIndex].value,'_blank');}""><option value=''>友情文字链接站点</option>"
    end if
    if ShowType=1 or ShowType=2 then
        strLink=strLink & "<table width='100%' cellSpacing='5'><tr align='center' >"
    end if
    
    sqlLink="select top " & SiteNum & " * from FriendLinks where IsOK=True and LinkType=" & LinkType & " order by IsGood,id desc"
    set rsLink=server.createobject("adodb.recordset")
    rsLink.open sqlLink,conn,1,1
    if rsLink.bof and rsLink.eof then
        if ShowType=1 or ShowType=2 then
              for i=1 to SiteNum
                strLink=strLink & "<td>"            
                strLink=strLink & "</td>"
                if i mod Cols=0 and i<SiteNum then
                    strLink=strLink & "</tr><tr align='center' >"
                end if
            next
        end if
    else
        SiteCount=rsLink.recordcount
        for i=1 to SiteCount
            if ShowType=1 or ShowType=2 then
              if LinkType=1 then
                strLink=strLink & "<td width='88'><a href='" & rsLink("SiteUrl") & "' target='_blank' title='网站名称:" & rsLink("SiteName") & vbcrlf & "网站地址:" & rsLink("SiteUrl") & vbcrlf & "网站简介:" & rsLink("SiteIntro") & "'>"
                if rsLink("LogoUrl")="" or rsLink("LogoUrl")="http://" then
                    strLink=strLink & "<img src='images/nologo.gif' width='88' height='31' border='0'>"
                else
                    strLink=strLink & "<img src='" & rsLink("LogoUrl") & "' width='88' height='31' border='0'>"
                end if
                strLink=strLink & "</a></td>"
              else
                strLink=strLink & "<td width='88'><a href='" & rsLink("SiteUrl") & "' target='_blank' title='网站名称:" & rsLink("SiteName") & vbcrlf & "网站地址:" & rsLink("SiteUrl") & vbcrlf & "网站简介:" & rsLink("SiteIntro") & "'>" & rsLink("SiteName") & "</a></td>"
              end if
              if i mod Cols=0 and i<SiteNum then
                strLink=strLink & "</tr><tr align='center' >"
              end if
            else
                strLink=strLink & "<option value='" & rsLink("SiteUrl") & "'>" & rsLink("SiteName") & "</option>"
            end if
            rsLink.moveNext
        next
        if SiteCount<SiteNum and (ShowType=1 or ShowType=2) then
            for i=SiteCount+1 to SiteNum
                if LinkType=1 then
                    strLink=strLink & "<td width='88'></td>"
                else
                    strLink=strLink & "<td width='88'></td>"
                end if
                if i mod Cols=0 and i<SiteNum then
                    strLink=strLink & "</tr><tr align='center' >"
                end if
            next
        end if
    end if
    if ShowType=1 or ShowType=2 then
        strLink=strLink & "</tr></table>"
    end if
    if ShowType=1 then
        strLink=strLink & "</div><div id=rolllink2></div></div>"   '新增代码
    elseif ShowType=3 then
        strLink=strLink & "</select>"
    end if
    response.write strLink
    if ShowType=1 then call RollFriendLinks()    '新增代码
    rsLink.close
    set rsLink=nothing
end sub


不知道要怎么改啊
2008-03-26 14:00
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
call ShowFriendLinks(2,6,6,2)
改成
call ShowFriendLinks(2,6,1,2)
试试
2008-03-26 14:59
快速回复:求助,横向链接如何改成竖向链接显示???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020303 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved