标题:【求助】如何定义这个代码四个版面一组插入调用广告,非循环出现广告
只看楼主
liujia0919
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2011-3-18
结帖率:100%
已结贴  问题点数:20 回复次数:3 
【求助】如何定义这个代码四个版面一组插入调用广告,非循环出现广告
<table width="956" height="96" border="0" align="center">
  <tr>
    <th width="740" height="16" align="left" valign="top" scope="col"><div align="center">
      <%
        for i=1 to RecordCount
        typeID=Arraytyid(i)
        typeName=ArraytyName(i)
        %>
        <table border="0"cellpadding="0" cellspacing="0" style="margin-bottom:5px;margin-top:5px;" width="98%" id="AutoNumber6">
          <tr>
            <td width="49%" valign="top" background="images/lmtop-4.gif" style="border-collapse: collapse;border: 1 solid #B7C2A2;"><table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber12">
              <tr>
                <td  background="images/lmtop.gif" height="30" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font><A class=middle HREF="Type.asp?typeid=<%=typeid%>"><%=typeName%></A></font> </td>
                </tr>
              <tr>
                <td width="10%" align="left" valign="top" bgcolor="#D7ECF8"><%
                                    set rs=server.CreateObject("ADODB.RecordSet")
                                    rs.Source="select top " & L_BG & " * from "& db_News_Table &" where (typeid=" & typeid &" and checkked=1 and picnews=1 and picname is not null) order by newsid DESC"
                                    rs.Open rs.Source,conn,1,1
                                    if rs.EOF then
                                        Response.Write "<img src='images/notopic.gif' width=56 border=0 height=56>"
                                    else
                                    while not rs.EOF
                                        title=rs("title")
                                        fileExt=lcase(getFileExtName(rs("picname")))
                                    %>
                  <a class="class" target="_blank" href="ReadNews.asp?newsid=<%=rs("newsid")%>" title="<%=htmlencode4(title)%>">
                    <%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%>
                    <img src="<%=FileUploadPath & rs("picname")%>" width="56" border=1 style=border-color:#ffffff height="56"> </a>
                  <%end if%>
                  <%if fileext="swf" then%>
                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,0,0" width="56" height="56">
                    <param name="movie" value="<%=FileUploadPath & rs("picname")%>">
                    <param name="quality" value="high">
                    <param name="Play" value="-1">
                    <param name="Loop" value="0">
                    <param name="Menu" value="-1">
                    <embed src="<%=FileUploadPath & rs("picname")%>" width="56" pluginspage="http://www. type="application/x-shockwave-flash"></embed>
                    </object>
                  <%end if%>
                  <%
                                        rs.MoveNext
                                        wend
                                        end if
                                        rs.close
                                        set rs=nothing
                                    %>                </td>
                  <td width="90%" valign="top" bgcolor="#F0F4F6"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" " width="100%" id="AutoNumber11">
                    <% dim rs3
                                            set rs3=server.CreateObject("ADODB.RecordSet")
                                            rs3.Source="select top " & top_news & " * from "& db_News_Table &" where (typeid=" & typeid &" and checkked=1 ) order by newsid DESC"
                                            rs3.Open rs3.Source,conn,1,1
                                            while not rs3.EOF
                                            newsurl="ReadNews.asp?NewsID=" & rs3("NewsID")
                                            newswwwurl=rs3("titleface")
                                            fileExt=lcase(getFileExtName(rs3("picname")))
                                            if showyear=1 then
                                                datetime="<font class=middle>" & year(rs3("UpdateTime"))  &"."& right("0" & Month(rs3("UpdateTime")),2)  & "."& right("0" & Day(rs3("UpdateTime")),2) &"</font>"
                                            else
                                                datetime="<font class=middle>"& right("0" & Month(rs3("UpdateTime")),2)  &"."& right("0" & Day(rs3("UpdateTime")),2) &"</font>"
                                            end if
                                            if rs3("picnews")=1 then
                                                if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                                                img=" <img src='images/news_img.gif' border='0'>"
                                                end if
                                            else
                                                img=""
                                            end if
                                            '增加小类名称程序开始
                                        if rs3("bigclassID")<>"" Then
                                            C=rs3("typeid")
                                            B=rs3("bigclassID")
                                            set rs22=server.createobject("adodb.recordset")
                                            sql="SELECT bigclassID,bigclassname FROM "& db_BigClass_Table &" WHERE bigclassID="&B
                                            Set rs22=Conn.Execute(sql)
                                            A=rs22("bigclassname")
                                            H="BigClass.asp?TypeId=" & C & "&BigClassId=" & B
                                            rs22.close
                                            set rs22=Nothing
                                        else
                                            A="本栏"
                                            C=rs3("typeid")
                                            H="Type.asp?TypeId=" & C
                                        end if
                                            '增加小类名称程序结束
                                        %>
                    <tr>
                      <td><table width="100%" border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" >
                        <tr>
                          <td><A class="middle" HREF="<%=H%>"><%=A%></A>|<%=img%> <a class="middle" href="<%if rs3("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(rs3("title"))%>" target="_blank"> <font color="<%=rs3("titlecolor")%>"> <%=CutStr(htmlencode4(rs3("title")),20)%> </font> </a>
                            <!--标题后评论提示-->
                            <%if reviewable="1" then%>
                            <% if rs3("titlesize")>=1 then %>
                            <A class=middle HREF="<%=path%>Review.asp?NewsID=<%=rs3("NewsID")%>" target="_blank" ><font color=red>评</font></A>
                            <%end if %>
                            <%end if %>
                            <!--标题后评论提示-->
                            <%''if showauthor="1" then%>
                            <%''=rs3("Author")%>
                            <%''end if%>
                            <%if year(rs3("updatetime"))=year(date()) and month(rs3("updatetime"))=month(date()) and day(rs3("updatetime"))=day(date()) then%>
                            <font color="#ff0000">新</font>
                            <%end if%>                            </td>
                              <td align="right"><%if showtime="1" then%>
                                <%=datetime%>
                                <%end if%>                            </td>
                            </tr>
                        </table></td>
                      </tr>
                    <%
                                            rs3.MoveNext
                                            wend
                                            %>
                  </table></td>
                </tr>
              <tr>
                <td width="10%" align="right" bgcolor="#D7ECF8"></td>
                  <td width="90%" align="right" bgcolor="#F0F4F6"><a class="class" href="Type.asp?typeid=<%=typeid%>"><img src="images/more.gif" border="0" alt="更多<%=typeName%>" /></a></td>
                </tr>
            </table></td>
            <%i=i+1
                        typeID=Arraytyid(i)
                        typeName=ArraytyName(i)
                        if i<=RecordCount then
                        %>
            <td width="2%" valign="top" background="images/t.gif"></td>
            <td width="49%" valign="top" background="images/lmtop-4.gif" style="border-collapse: collapse;border: 1 solid #B7C2A2;"><table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber13">
              <tr>
                <td background="images/lmtop.gif" height="30" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font><A class=middle HREF="Type.asp?typeid=<%=typeid%>"><%=typeName%></A></font> </td>
                </tr>
              <tr>
                <td width="10%" align="left" valign="top" bgcolor="#D7ECF8"><%
                                        set rs=server.CreateObject("ADODB.RecordSet")
                                        rs.Source="select top " & L_BG & " * from "& db_News_Table &" where (typeid=" & typeid &" and checkked=1 and picnews=1 and picname is not null) order by newsid DESC"
                                        rs.Open rs.Source,conn,1,1
                                        if rs.EOF then
                                        Response.Write "<img src=images/notopic.gif width=56 border=0 height=56>"
                                        else
                                        while not rs.EOF
                                        title=rs("title")
                                        fileExt=lcase(getFileExtName(rs("picname")))
                                    %>
                  <a class="class" target="_blank" href="ReadNews.asp?newsid=<%=rs("newsid")%>" title="<%=htmlencode4(title)%>">
                    <%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%>
                    <img src="<%=FileUploadPath & rs("picname")%>" width="56" border=1 style=border-color:#ffffff height="56" /></a>
                  <%end if%>
                  <%if fileext="swf" then%>
                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,0,0" width="56" height="56">
                    <param name="movie" value="<%=FileUploadPath & rs("picname")%>" />
                    <param name="quality" value="high" />
                    <param name="Play" value="-1" />
                    <param name="Loop" value="0" />
                    <param name="Menu" value="-1" />
                    <embed src="<%=FileUploadPath & rs("picname")%>" width="56" pluginspage="http://www. type="application/x-shockwave-flash"></embed>
                    </object>
                  <%end if%>
                  <%
                                        rs.MoveNext
                                        wend
                                        end if
                                        rs.close
                                        set rs=nothing
                                    %>                </td>
                  <td width="90%" valign="top" bgcolor="#F0F4F6"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber14">
                    <%
                                            set rs3=server.CreateObject("ADODB.RecordSet")
                                            rs3.Source="select top " & top_news & " * from "& db_News_Table &" where (typeid=" & typeid &" and checkked=1 ) order by newsid DESC"
                                            rs3.Open rs3.Source,conn,1,1
                                            while not rs3.EOF
                                            newsurl="ReadNews.asp?NewsID=" & rs3("NewsID")
                                            newswwwurl=rs3("titleface")
                                            fileExt=lcase(getFileExtName(rs3("picname")))
                                            if showyear=1 then
                                                datetime="<font class=middle>" & year(rs3("UpdateTime"))  &"."& right("0" & Month(rs3("UpdateTime")),2)  & "."& right("0" & Day(rs3("UpdateTime")),2) &"</font>"
                                            else
                                                datetime="<font class=middle>"& right("0" & Month(rs3("UpdateTime")),2)  &"."& right("0" & Day(rs3("UpdateTime")),2) &"</font>"
                                            end if
                                            if rs3("picnews")=1 then
                                                        if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                                                        img=" <img src='images/news_img.gif' border='0'>"
                                                        end if
                                                        else
                                                        img=""
                                                    end if

                                            '增加小类名称程序开始
                                            if rs3("bigclassID")<>"" then
                                                C=rs3("typeid")
                                                B=rs3("bigclassID")
                                                set rs22=server.createobject("adodb.recordset")
                                                sql="SELECT bigclassID,bigclassname FROM "& db_BigClass_Table &" WHERE bigclassID="&B
                                                Set rs22=Conn.Execute(sql)
                                                A=rs22("bigclassname")
                                                H="BigClass.asp?TypeId=" & C & "&BigClassId=" & B
                                                rs22.close
                                                set rs22=Nothing
                                            else
                                                A="本栏"
                                                C=rs3("typeid")
                                                H="Type.asp?TypeId=" & C
                                            end if
                                            '增加小类名称程序结束
                                        %>
                    <tr>
                      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
                        <tr>
                          <td><A class="middle" HREF="<%=H%>"><%=A%></A>|<%=img%> <a class="middle" href="<%if rs3("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(rs3("title"))%>" target="_blank"> <font color="<%=rs3("titlecolor")%>"> <%=CutStr(htmlencode4(rs3("title")),20)%> </font> </a>
                            <!--标题后评论提示-->
                            <%if reviewable="1" then%>
                            <% if rs3("titlesize")>=1 then %>
                            <A class=middle HREF="<%=path%>review.asp?NewsID=<%=rs3("NewsID")%>" target="_blank" ><font color=red>评</font></A>
                            <%end if %>
                            <%end if %>
                            <!--标题后评论提示-->
                            <%''if showauthor="1" then%>
                            <%''=rs3("Author")%>
                            <%''end if%>
                            <%if year(rs3("updatetime"))=year(date()) and month(rs3("updatetime"))=month(date()) and day(rs3("updatetime"))=day(date()) then%>
                            <font color="#ff0000">新</font>
                            <%end if%>                            </td>
                              <td align="right"><%if showtime="1" then%>
                                <%=datetime%>
                                <%end if%>                            </td>
                            </tr>
                        </table></td>
                      </tr>
                    <%rs3.MoveNext
                                            wend
                                            %>
                  </table></td>
                </tr>
              <tr>
                <td width="10%" align="right" bgcolor="#D7ECF8"></td>
                  <td width="90%" align="right" bgcolor="#F0F4F6"><a class="class" href="Type.asp?typeid=<%=typeid%>"><img src="images/more.gif" border="0" alt="更多<%=typeName%>" /></a></td>
                </tr>
            </table></td>
            <%end if%>
          </tr>
        </table>
      <%
        next
        rs3.close
        set rs3=nothing
        %>


如何定义这个代码四个版面一组插入调用广告,非循环出现广告,现在这个代码直接插入广告后是两个并排一组的,而且广告是依次循环出现,完全没办法调用广告
现在想设置成四个一组插入一个广告。广告不能随栏目增加而反复循环出现
搜索更多相关主题的帖子: background style 
2011-03-18 15:51
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
得分:14 
什么叫一组,一组成员还是一行的意思??

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2011-03-18 17:11
liujia0919
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2011-3-18
得分:0 
一行两个栏目
四个栏目后插入一个广告
广告不能随栏目而循环
2011-03-18 17:12
liujia0919
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2011-3-18
得分:0 

就是这种形式的出现
广告的调用不要循环出现
2011-03-18 17:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334062-1-1.html




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

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