| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 851 人关注过本帖
标题:我想调用单个分类的图片,要怎么做????
只看楼主 加入收藏
angerzl
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2007-8-20
结帖率:100%
收藏
 问题点数:0 回复次数:3 
我想调用单个分类的图片,要怎么做????
我想调用单个分类的图片,要怎么做????(我不想显示所有分类最新发布的图片,只想让它显示某一个分类的最新图片)

这段代码要怎么改????
<table width="100%" border="0" cellpadding="0" cellspacing="5" bgcolor="#FFFFFF">
              <%

              sql="select top 8 * from album a,members b  where a.member_id=b.member_id  order by a.release_date desc"
           'response.write sql
           set rs=server.createobject("adodb.recordset")
              rs.open sql,conn
              i=1
          while not rs.EOF
        if i=1 then
          response.write "<tr>"
        end if
        if rs("if_multi")="1" then
                  icon="multi.gif"
                else
                  icon="single.gif"
                end if
        if rs("if_best")="1" then
                  icon_best="Icon_4.gif"
                else
                  icon_best="Icon_2.gif"
                end if
                if (cstr(session("can_admin"))="1" or session("class_ID_admin")=rs("class_id")) and session("class_ID_admin")<>"" then
                  delStr="<a href=""javascript:if (confirm('是否删除该作品?')==true){MM_openBrWindow('del.asp?subject=album&topic_id="&rs("album_id")&"','Del');}"" >删</a>"
                end if
    %>
              <td width="20%" valign="bottom" align="center">
                  <!--图片框-->
                  <table border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td><TABLE width=1 border=0 align="center" cellPadding=0 cellSpacing=0>
                          <TBODY>
                          <TD>
                          <TR>
                            <TD bgColor=#ffffff> <TABLE cellSpacing=0 cellPadding=0 border=0>
                                <TBODY>
                                  <TR>
                                    <TD onMouseOver="this.style.backgroundColor='#B8C5CD';return true;" onMouseOut="this.style.backgroundColor='#ffffff';">
                                      <TABLE cellSpacing=0 cellPadding=2 width="100%"
                                border=0>
                                        <TBODY>
                                          <TR>
                                            <TD> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                                                <TBODY>
                                                  <TR>
                                                    <TD align=center><a href="album_detail.asp?album_id=<%=rs("album_id")%>"><img border="0" src="doc_img/album/<%=rs("mini_img")%>" ></a></TD>
                                                  </TR>
                                                </TBODY>
                                              </TABLE></TD>
                                          </TR>
                                        </TBODY>
                                      </TABLE></TD>
                                  </TR>
                                </TBODY>
                              </TABLE></TD>
                          </TR>
                        </TABLE></td>
                    </tr>
                  </table>
                  <b><font color="#808080">
                   <a href="album_detail.asp?album_id=<%=rs("album_id")%>"> <%=rs("album_title")%></a></font></b><br>
                  <%=rs("nickname")%> <br>
          <nobr><font class="en7pt" color="#666666"><img src="images/Icon_1.gif" align="absMiddle" width="19" height="16"><%=rs("click_count")%><img src="images/<%=icon_best%>" align="absMiddle" width="19" height="16"><%=rs("vote_count")%><img src="images/Icon_3.gif" align="absMiddle" width="19" height="16"><%=rs("reply_count")%>
          </font><img src="images/<%=icon%>" align="absMiddle" width="19" height="16"> <%=delStr%></nobr>
          <!--图片框-->       </td>
        <%
        if i=4 then
          response.write "</tr>"
          i=0
        end if
                i=i+1

        rs.movenext
        Wend
            if i<>1 then
                for j=i to 4
                              %>
                              
                <td width="20%" valign="bottom" align="center">
                  
                </td>
              <%
                   next
                   response.write "</tr>"
             end if
            
  rs.close
  set rs=nothing


%>    
    </table>
搜索更多相关主题的帖子: 分类 sql member recordset 
2008-01-19 10:37
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
sql="select top 8 * from album a,members b  where a.member_id=b.member_id  order by a.release_date desc"
改成
sql="select top 8 * from album a,members b  where a.member_id=b.member_id (and 单个分类的条件) order by a.release_date desc"
2008-01-19 10:51
angerzl
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2007-8-20
收藏
得分:0 
and 单个分类的条件 这个要怎么改???
我不知道要怎么改啊,怎么改都不行,
2008-01-19 11:02
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
楼主的分类id有限吗?根据不同的id来确定对应的分类,比如说假设你的分类id的字段名为id
sql="select top 8 * from album a,members b  where a.member_id=b.member_id and id="&Request.QueryString("id")&" order by a.release_date desc"
2008-01-19 11:22
快速回复:我想调用单个分类的图片,要怎么做????
数据加载中...
 
   



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

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