音乐频道首页调用


在INDEX。ASP中加上:

sub main_center_music()
dim oid,topic,id,nid
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0> 音乐频道</td></tr>
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<tr><td width='60%'><table border=0 width='100%'>
<%
oid=0
sql="select top 1 specialid,name,nclass,sclassid,nclassid,yuyan,times,intro,hits,pic from mv_special order by specialid desc"
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then
  id=rs("specialid")
  oid=id
  topic=rs("name")
  nid=rs("specialID")
%>
  <table border=0 cellspacing=0 cellpadding=2 width='100%'>
  <tr><td height=3></td></tr>
  <tr align=center>
  <td width='35%'><%response.write pic_fk(rs("pic"),8,"music_disk_view.asp?albumid="&nid)%></td>
  <td width='65%'>
    <table border=0 width='100%' class=tf>
    <tr><td>名称:<b><a href='music_disk_view.asp?albumid=<%=rs("specialID")%>' alt='浏览专辑:<%=rs("name")%>' target=_blank><%response.write joekoe_cms.code_html(rs("name"),1,8)%></a></b></td></tr>
<tr><td>歌手:<a href='music_singer_view.asp?Name=<%=rs("nclass")%>&id=<%=rs("SClassid")%>&artid=<%=rs("NClassid")%>' alt='查看歌手 <%=rs("NClass")%> 的所有专辑'><%response.write joekoe_cms.code_html(rs("nClass"),1,8)%></a></td></tr>
<tr><td>语言:<%=rs("yuyan")%> 人气:<font class=red><%response.write int(rs("hits"))%></font></td></tr>
<tr><td>发行:<font class=tims><%=rs("times")%></font></td></tr>
    <tr><td class=bw>介绍:<%response.write joekoe_cms.code_html(rs("intro"),1,20)%></td></tr>
    </table>
  </td>
  </tr>
  </table>
<%
end if
rs.close
%>
</td>
<td width='40%'>
  <table border=0 cellspacing=1 cellpadding=0 width='100%'>
  <tr><td height=3></td></tr>
<%
i=0
sql="select top 2 specialid,name,nclass,sclassid,nclassid,yuyan,hits,pic from mv_special where specialid<>"&oid&" order by specialid desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
  id=rs("specialid")
  topic=rs("name")
  nid=rs("specialID")
  if i mod 2=0 then response.write vbcrlf&"  <tr>"
%>
  <td>
    <table border=0 cellspacing=0 cellpadding=2 width='100%'>
    <tr align=center>
    <td width='35%'><%response.write pic_fk(rs("pic"),4,"music_disk_view.asp?albumid="&nid)%></td>
    <td width='65%'>
      <table border=0 cellspacing=0 cellpadding=2 width='100%'>
      <tr><td><b><a href='music_disk_view.asp?albumid=<%=rs("specialID")%>' alt='浏览专辑:<%=rs("name")%>' target=_blank><%response.write joekoe_cms.code_html(rs("name"),1,8)%></a></b></td></tr>
      <tr><td>歌手:<a href='music_singer_view.asp?Name=<%=rs("nclass")%>&id=<%=rs("SClassid")%>&artid=<%=rs("NClassid")%>' alt='查看歌手 <%=rs("NClass")%> 的所有专辑'><%response.write joekoe_cms.code_html(rs("nClass"),1,8)%></a></td></tr>
      <tr><td><%=rs("yuyan")%> 人气:<font class=red><%response.write int(rs("hits"))%></font></td></tr>
      </table>
    </td>
    </tr>
    </table>
  </td>
<%
  if i+1 mod 1=0 then response.write vbcrlf&"  </tr>"
  if i=1 then response.write vbcrlf&"  <tr><td height=1></td></tr>"
  rs.movenext
  i=i+1
loop
rs.close
%>
</tr></table></td></tr></table><%
end sub

在上面调用为:call main_center_music()


在index2.asp最后一个%>上插入以下代码

sub main_center_music(cs_tnum,cs_cnum)
  dim tmp1,tmp_topic,tmp_url
  tmp1=vbcrlf&"<tr align=center>"
  sql="select top "&cs_tnum&" specialid,name,nclass,sclassid,nclassid,yuyan,times,intro,hits,pic from mv_special order by specialid desc"
  set rs=joekoe_cms.exec(sql,1)
  do while not rs.eof
    tmp_topic=rs(1)
    tmp_url="music_disk_view.asp?albumid="&rs(0)
    tmp1=tmp1&vbcrlf&"<td>" & _
         vbcrlf&" <table border=0 cellspacing=0 cellpadding=0>" & _
         vbcrlf&" <tr><td align=center>"&pic_fk(rs("pic"),1,tmp_url)&"</td></tr>" & _
         vbcrlf&" <tr><td align=center height="&dim_num(6)&"><a href='"&tmp_url&"' target=_blank>"&joekoe_cms.code_html(tmp_topic,1,cs_cnum)&"</a></td></tr>" & _
         vbcrlf&" </table>" & _
         vbcrlf&"</td>"
    rs.movenext
  loop
  rs.close
  tmp1=tmp1&vbcrlf&"</tr>"
  tmp1="<table border=0 cellspacing=0 cellpadding=2 width='100%'>"&tmp1&vbcrlf&"</table>"
  response.write vbcrlf&"<table cellspacing=1 cellpadding=4 class=table>" & _
                 vbcrlf&"<tr><td class=td0> 音乐频道</td></tr>" & _
                 vbcrlf&"<tr class=bg_td><td align=center>"&tmp1&"</td></tr>" & _
                 vbcrlf&"</table>"&ukong
end sub

在前面调用的位置插入

call main_center_music(4,8)即可

红色的4表示调用的专辑数量,蓝色的8则是表示显示专辑名的字符数

文章来自: Original
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 6 | 引用: 0 | 查看次数: 734
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭