showcs_body.asp

来自「功能简介: 1) 首页投票调查系统 2)FLASH导航清新直观(带FLA源文件」· ASP 代码 · 共 209 行

ASP
209
字号
<%sub showcs_body()
dim totalcs,Currentpage,totalpages,i

sql="select * from coolsites order by cs_id DESC"
if request.querystring("cscat_id")<>"" then
sql="select * from coolsites where cscat_id="&request.querystring("cscat_id")&" order by cs_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
totalcs=rs.recordcount
%>
<table width="<%=tablewidth%>" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
  <tr> 
    <td height="10" colspan="3"></td>
  </tr>
  <tr> 
    <td align="center" valign="top" width="554"> 
     
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td height="6"></td>
        </tr>
      </table>
      <%
if not rs.eof then
rs.movefirst
rs.pagesize=coolsitesperpage
if trim(request("page"))<>"" then
   currentpage=clng(request("page"))
   if currentpage>rs.pagecount then
      currentpage=rs.pagecount
   end if
else
   currentpage=1
end if
   totalcs=rs.recordcount
   if currentpage<>1 then
       if (currentpage-1)*coolsitesperpage<totalcs then
	       rs.move(currentpage-1)*coolsitesperpage
		   dim bookmark
		   bookmark=rs.bookmark
	   end if
   end if
   if (totalcs mod coolsitesperpage)=0 then
      totalpages=totalcs\coolsitesperpage
   else
      totalpages=totalcs\coolsitesperpage+1
   end if
i=0
do while not rs.eof and i<coolsitesperpage
%>
      <table width="98%" border="0" cellspacing="0" cellpadding="10" align="center">
        <tr> 
          <td width="37%" align="center"> 
            <table width="98%" border="0" cellspacing="1" cellpadding="3" bgcolor="#D2D2D2">
              <tr> 
<td bgcolor="#FFFFFF" align="center"><a href="<%=rs("cs_pic")%>" target="_blank"><img src="<%=rs("cs_pic")%>" a width="160" height="120" border="0" lt="点击查看该图片"></a></td>
              </tr>
            </table>
          </td>
          <td width="63%" class="chinese">网站名称:<%=rs("cs_name")%><br>
            网站地址:<a href="redirectcs.asp?cs_id=<%=rs("cs_id")%>" target="_blank"><%=rs("cs_url")%></a><br>
            加入时间:<%=rs("cs_date")%><br>
            点击次数:<%=rs("cs_count")%><br>
			网站简介:<font color="#555555"><%=rs("cs_desc")%></font>
			</td>
        </tr>
        <tr> 
          <td colspan="2" height="1" background="images/dotlineh.gif"></td>
        </tr>
      </table>
      <%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
      <table width="98%" border="0" cellspacing="0" cellpadding="10" align="center">
        <tr> 
          <td bgcolor="#FFFFFF" colspan="2" height="22" align="center" class="chinese">当前没有酷站!</td>
        </tr>
      </table>
      <%end if
end if%>
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center" class="chinese">
        <form name="form1" method="post" action="showcs.asp?cscat_id=<%=request.querystring("cscat_id")%>">
          <tr> 
            <td align="right"> <%=currentpage%> /<%=totalpages%>页,<%=totalcs%>条记录/<%=coolsitesperpage%>个每页. 
              <%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
              <%=i%> 
              <%else%>
              <a href="showcs.asp?page=<%=i%>&cscat_id=<%=request.querystring("cscat_id")%>"><%=i%></a> 
              <%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
              <a href="showcs.asp?page=<%=page%>&cscat_id=<%=request.querystring("cscat_id")%>" title="下一页">>></a> 
              <%end if%>
              &nbsp;&nbsp;&nbsp;&nbsp; 
              <input type="text" name="page" class="textarea" size="4">
              <input type="submit" name="Submit" value="Go" >
            </td>
          </tr>
        </form>
      </table>
      <br>
    </td>
    <td align="center" valign="top" width="1" background="images/dotlinev.gif"></td>
    <td align="center" valign="top" width="205"> 
      <table width="96%" border="0" cellspacing="0" cellpadding="5" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
        <tr> 
          <td bgcolor="#EFEBEF" align="center" class="chinese" background="../images/pic000/c007.jpg">酷站分类</td>
        </tr>
      </table>
      <table width="96%" border="0" cellspacing="1" cellpadding="0" bgcolor="#EFEBEF">
        <tr> 
          <td bgcolor="#F5F5F5" align="center"> 
            <table width="85%" border="0" cellspacing="0" cellpadding="4">
              <%sql="select * from cscat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
%>
              <tr> 
                <td align="center" class="chinese"> 
                  <%if request.querystring("cscat_id")<>Cstr(rs("cscat_id")) then%>
                  <a href="showcs.asp?cscat_id=<%=rs("cscat_id")%>"><%=rs("cscat_name")%></a> 
                  <%else%>
                  <font color="#ff6600"><%=rs("cscat_name")%></font> 
                  <%end if%>
                </td>
              </tr>
              <%rs.movenext
loop
if rs.eof and rs.bof then%>
              <tr> 
                <td align="right" class="chinese">当前还没有酷站分类!</td>
              </tr>
              <%end if%>
            </table>
          </td>
        </tr>
      </table>
      <br>
      <table width="96%" border="0" cellspacing="0" cellpadding="5" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
        <tr> 
          <td bgcolor="#EFEBEF" align="center" class="chinese" background="../images/pic000/c007.jpg">酷站点击Top 3</td>
        </tr>
      </table>
      <table width="96%" border="0" cellspacing="1" cellpadding="0" bgcolor="#EFEBEF">
        <tr> 
          <td bgcolor="#FFFFFF" align="center"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="4">
              <%sql="SELECT top 3 * FROM coolsites ORDER by cs_count DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
cn=3
do while not rs.eof

%>
              <tr> 
                <td align="center" class="chinese" bgcolor="#F5F5F5"><a href="redirectcs.asp?cs_id=<%=rs("cs_id")%>" target="_blank"><img src="<%=rs("cs_pic")%>" width="160" height="120"  border="0" alt="进入该网站"></a></td>
              </tr>
              <tr> 
                <td class="chinese" bgcolor="#F5F5F5">网站名称:<%=rs("cs_name")%><br>
                  网站地址:<a href="redirectcs.asp?cs_id=<%=rs("cs_id")%>" target="_blank"><%=rs("cs_url")%></a><br>
                  加入时间:<%=rs("cs_date")%><br>
                  点击次数:<%=rs("cs_count")%> </td>
              </tr>
<%
cn=cn-1
if cn<1 then exit do
rs.movenext
loop
if rs.eof and rs.bof then%>
              <tr> 
                <td align="center" class="chinese" bgcolor="#F5F5F5">当前还没有酷站</td>
              </tr>
              <%end if%>
            </table>
          </td>
        </tr>
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td background="images/dotlineh.gif" height="1" width="544"></td>
    <td background="images/dotlineh.gif" height="1" width="1"></td>
    <td background="images/dotlineh.gif" height="1" width="205"></td>
  </tr>
</table>
<%
rs.close
set rs=nothing
end sub%>

⌨️ 快捷键说明

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