⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list1.asp

📁 红金羚v1.5办公自动化软件是基于大型数据库系统开发的应用系统
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit%>
<!--#include file="newconn.asp"-->
<!-- #include file="inc/char.inc" -->
<!-- #include file="inc/tree.inc"-->
<html>

<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0" CHARSET="GB2312">
<title>天荷.论坛</title>
<link rel="stylesheet" type="text/css" href="forum.css">
</head>

<body>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="16%" height="12">&nbsp;</td>
    <td rowspan="2" width="64%"> 
      <div align="center"><a href="http://www.kuaigou.com"><img src="images/dogb.gif" width="468" height="60" border="0"></a></div>
    </td>
    <td height="40" valign="bottom" rowspan="2"> 
      <div align="center"> 
        <table width="98%" border="1" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC" align="center" height="52" bordercolor="#999999">
          <tr>
            <td width="53%" height="19"> 
              <div align="center"><a href="elogin.asp" target=_blank>论坛管理</a></div>
            </td>
            <td width="47%" height="19"> 
              <div align="center"><a href="myinfo.asp?page=2">信息修改</a></div>
            </td>
          </tr>
          <tr>
            <td width="53%" height="2"> 
              <div align="center"><a href="point.asp">积分排行</a></div>
            </td>
            <td width="47%" height="2"> 
              <div align="center"><a href="query.asp">帖子查询</a></div>
            </td>
          </tr>
        </table>
      </div>
     
    </td>
  </tr>
  <tr> 
    <td width="16%" height="25"> 
      <div align="center"><a href="http://www.yueer.com.cn"><img src="images/yueera1.gif" width="120" height="44" border="0"></a></div>
    </td>
  </tr>
</table>
<p>
  <%

   dim sql,rs,rsBoard,BoardName,boardsql
   dim selStr
   dim mailStr1
   dim mailStr2
   dim boardmaster
   'on error resume next
   selStr="()"    
   if not isEmpty(request("lstRefreshBoard")) then
      boardID=request("lstRefreshBoard")
   elseif not isEmpty(request("BoardID")) then
      boardID=request("BoardID")
   end if
   selStr=""    
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if

 set rsBoard=server.createobject("adodb.recordset")
  boardsql="select * from board where boardID="&request("boardid")
 rsboard.open boardsql,conn,1,1
 if not rsboard.eof then
    boardname=rsboard("boardname")
    session("boardtype")=rsboard("boardtype")
    
    boardmaster=rsboard("boardmaster")
    if trim(rsboard("masteremail"))<>"" then
      mailStr1="<a href='mailto:"+trim(rsboard("masteremail"))+"'>"
      mailStr2="</a>"
    else
      mailStr1=""
      mailStr2=""
    end if
   if boardID>0 then
    set rs=server.createobject("adodb.recordset")
    sql="select AnnounceID,boardID from bbs1 where boardID="+cstr(boardID)+" and parentID=0 ORDER BY announceID desc "
       rs.open sql,conn,1,1
 if not  rs.eof then
     totalAnnounce=rs.recordcount
	 dim i
	 i=0
	 if currentPage=1 then

	 do while not rs.EOF 
	   if selstr="" then
		   selStr=selStr+cstr(rs("announceid"))
	   else
		   selStr=selStr+","+cstr(rs("announceid"))
	   end if

	   i=i+1
	   if i>=maxannounce then exit do
	   rs.MoveNext 
	 loop

	 else
	    if (currentPage-1)*maxannounce<totalAnnounce then
	       rs.move  (currentPage-1)*maxannounce
	       dim bookmark
	       bookmark=rs.bookmark
	       do while not rs.EOF 
	       	   if selstr="" then
		          selStr=selStr+cstr(rs("announceid"))
		       else
		         selStr=selStr+","+cstr(rs("announceid"))
		       end if
         	   i=i+1
	           if i>=maxannounce then exit do
	           rs.MoveNext 
	      loop

	    else
	        currentPage=1
	        do while not rs.EOF 
	        	   if selstr="" then
		             selStr=selStr+cstr(rs("announceid"))
		           else
		             selStr=selStr+","+cstr(rs("announceid"))
		           end if


         	   i=i+1
	           if i>=maxannounce then exit do
	           rs.MoveNext 
	      loop

	    end if
	 end if
	 dim n
     selstr="("+selstr+")"
  
   
	  
	 if selStr<>"()" then
          sql="select * from bbs1 where (rootID in "&selStr& " ) ORDER BY rootID desc,orders "
     else
          sql="select * from bbs1 ORDER BY rootID desc,orders "

	 end if
	end if
         rs.Close
         
         rs.open sql,conn,1,1
         showpage session("boardtype"),boardmaster,totalannounce,request("boardid"),mailstr1,mailstr2
         showlist()
         showpage session("boardtype"),boardmaster,totalannounce,request("boardid"),mailstr1,mailstr2
   else
       response.write "<p> "+session("boardtype")+"<br>版主:"+mailstr1+boardmaster+mailstr2+"<br>" 
       response.write " 本论坛暂无内容 "
  	   response.write "<p><a href='write.asp?boardID="+request("boardid")+"' target="+chr(34)+"BoardAnnounce"+chr(34)+">我要发言</a> <a href='List.asp?boardID="+request("boardid")+"'>刷新浏览</a> "
            
	end if
         
     
      rs.close     

  
   sub showlist()
       on error resume next 
       dim outtext
       dim bytestr
       response.write  "<ul>"
       dim layer
       layer=1
       do while not (rs.eof or err.number<>0)
          do while layer<> rs("layer")
             if rs("layer")> layer then
                outtext=outtext & "<ul>"
                layer=layer+1
             else 
                outtext=outtext &  "</ul>" & chr(13) & chr(10)
                layer=layer-1  
             end if
          loop
          outtext=outtext &  "<li>"
          outtext=outtext & "<img src=images/"&rs("Expression")&">"
          outtext=outtext &  "<a href='showwrite.asp?boardID="+request("boardID")+"&RootID="&cstr(rs("RootID"))&"&ID="&Cstr(rs("announceID"))&"' >"
          dim t       		         
	  if rs("Length")=0 then
	     t=" <无内容>"
          else 
             t=" "
	  end if		   
                   
          if pwsonchsys then
             outtext=outtext & htmlencode(rs("Topic")+t)
          else
             outtext=outtext & Server.HTMLEncode(rs("Topic")+t)
          end if
          outtext=outtext & "</a> - <strong>" 
                    bytestr="("+cstr(rs("length"))
          if not WINNT_CHINESE then
             if rs("Length")-1=1 then
                bytestr=bytestr+" Byte)"
	     else
	        bytestr=bytestr+" Bytes)"
      	     end if
          else 
             bytestr=bytestr+"字)"
          end if

		if pwsonchsys then
             outtext=outtext & htmlencode(rs("UserName"))
          else
             outtext=outtext & Server.HTMLEncode(rs("UserName") ) 
          end if
          outtext=outtext & " </strong><font color=#009966>"&rs("DateAndTime")&"</font> [ 点击:"&rs("Hits")&"] "+bytestr+" <font color='red'>(" + Cstr(rs("child"))+")</font>"+chr(13)+chr(10)
          if trim(rs("DateAndTime"))<>"" and isdate(rs("DateAndTime")) then
             if cbool(cdate(rs("DateAndTime"))>(date()-1))=true then
                outtext=outtext &  "<img src='images/new.gif'>"+chr(13)+chr(10)
             end if
          end if
          rs.movenext
          response.write outtext
          outtext=""
       loop
       if layer<>0 then 
          dim i 
          for i=1 to layer
              outtext=outtext & "</ul>"
          next 
       end if
       outtext=outtext & "</ul>"        
       response.write outtext
   end sub
   
function showpage(boardtype,boardmaster,totalannounce,boardid,mailstr1,mailstr2)
       response.write "<table border='1' width='98%' cellspacing='0' bordercolorlight='#000000' bordercolordark='#FFFFFF'  cellpadding='0'><tr>"
       response.write "<tr><td nowrap bgcolor='#CCCCFF'><p align='center'>"&boardtype&"</td>"
       response.write "<td nowrap bgcolor='#CCCCFF'><p align='center'>"
       response.write "版主:"+mailstr1+boardmaster+mailstr2+"</td>"
       response.write "<td nowrap bgcolor='#CCCCFF'><p align='center'><a href=write.asp?boardID="&boardid&" >我要发言</a></td>"
       response.write "<td nowrap bgcolor='#CCCCFF'><p align='center'><a href=list.asp?boardID="&boardid&"&amp;page=1>刷新浏览</a></td>"
       dim n
	    if totalAnnounce mod maxannounce=0 then
	      n= totalAnnounce \ maxannounce
	    else
	      n= totalAnnounce \ maxannounce+1
	    end if
        response.write "<form method=Post action=list.asp?boardID="&boardid&">"
        
       response.write "<td nowrap align='center' bgcolor='#CCCCFF'>"
       if CurrentPage<2 then
        response.write "<font color='navy'>首页 前页</font>&nbsp;"
        else
          response.write "<a href=list.asp?boardID="&boardid&"&amp;page=1>首页</a>&nbsp;"
          response.write "<a href=list.asp?boardID="&boardid&"&amp;page="&CurrentPage-1&">前页</a>&nbsp;"
        end if
        if n-currentpage<1 then
          response.write "<font color='navy'>后页 尾页</font>"
        else
          response.write "<a href=list.asp?boardID="&boardid&"&amp;page="&(CurrentPage+1)
          response.write ">后页</a> <a href=list.asp?boardID="&boardid&"&amp;page="&n&">尾页</a>"
        end if
        response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页</td>"
        response.write "<td valign=top align=center nowrap bgcolor='#CCCCFF'>"
        response.write "<p>转到:<input type='text' name='page' size=3 maxlength=10 class=smallInput value="&currentpage&">"
        response.write "<input class=buttonface type='submit'  value=' Go '  name='B1'></span></p></td></form>"
       response.write "</table>" 


end function
else
  Response.Write "该论坛不存在!"
  
end if
rsBoard.Close
set rsboard=nothing
   %>
</p>

<hr size="1" width="88%">
<div align="center"><b><font color="#FF0000"><br>
  COPYRIGHT&copy; BY 天荷 &copy 2000~2001 ALL RIGHTS RESERVE</font></b></div>
</body>
</html>

⌨️ 快捷键说明

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