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

📄 topic.asp

📁 单版面小型论坛 单版面小型论坛
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="set.asp"-->
<%
    bid=cint(request("bid"))
    method=trim(request.querystring("method"))
    pageno=request.querystring("pageno")
    findstr=request("findstr")
    
    if isempty(bid) or bid=0 then
        sqlstr="select * from book where type=0 order by ldate desc"
        if method="hot" then
        	sqlstr="select * from book where type=0 order by reply desc"
        end if
        if method="hits" then
        	sqlstr="select * from book where type=0 order by hits desc"
        end if
        if findstr<>"" then
        	sqlstr="select * from book where (title like '%" &findstr& "%' or username like '%" &findstr& "%' or content like '%" &findstr& "%') and type=0 order by ldate desc"
        end if
        bname="各 版 新 帖"
        dbuser=""
    else
        sqlstr="select * from book where bid=" &bid& " and type=0 order by ldate desc"
        bdstr="select * from board where bid=" &bid
        if method="hot" then
        	sqlstr="select * from book where bid=" &bid& " and type=0 order by reply desc"
        end if
        if method="hits" then
        	sqlstr="select * from book where bid=" &bid& " and type=0 order by hits desc"
        end if
        if findstr<>"" then
        	sqlstr="select * from book where (title like '%" &findstr& "%' or username like '%" &findstr& "%' or content like '%" &findstr& "%') and bid=" &bid& " and type=0 order by ldate desc"
        end if
        set rebman=server.createobject("adodb.recordset")
		rebman.open bdstr,conn,1,1
		if not rebman.eof then 
		    bname=rebman("cname")    '版面名称
		end if
		rebman.close
		bdstr="select * from manboard where manbid=" &bid
		rebman.open bdstr,conn,1,1
		if rebman.eof then
		    dbuser="本版诚聘版主。"
		else
		    a=1
		    dbuser=""
			do while not rebman.eof
			    dbuser="<a href='mailto:" &rebman("email")& "'>" &rebman("username")& "</a> | "+dbuser
			    '此版版主
			    rebman.movenext
			    a=a+1
			    if a>4 then
			        exit do
			    end if
			loop
		end if
    end if
    set rebman=nothing
    session("bname")=bname
    session("dbuser")=dbuser
    set reco=server.createobject("adodb.recordset")
    reco.open sqlstr,conn,1,1
    
    if pmcount="" or isempty(pmcount) or pmcount<1 then
        pmcount=15
    end if
    reco.pagesize=pmcount   	'设置每页数
    mpage=reco.pagecount    	'得到总页数
    if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
        pageno=1
    end if

%>  
<html>
<head>
<title>my bbs</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF" ><!--#include file="top2.asp"-->
<center><table width="100%" border="0" cellspacing="2" cellpadding="2" background="images/bg1.gIf"  bgcolor="#7C96B8" class=buinput>
  <tr> 
    <td height="15" colspan="2" width="375"><font color=#336699>版面:<%=session("bname")%></font></td>
    <td height="15" width="235"><font color=#336699>版主:<%=session("dbuser")%></font></td>
    <td height="15" width="100"><font color=#336699>论题:<%=reco.recordcount%> 篇</font></td>
  </tr>
  <tr> 
    <td height="15" colspan="4" class=trtop><font color=#336699>&gt;&gt;分页&nbsp;&nbsp;第 <% for pno=1 to mpage
        if pno=cint(pageno) then%> <%=pno%> <%else%> <a href='topic.asp?bid=<%=bid%>&pageno=<%=pno%><%if method<>"" then%>&method=<%=method%><%end if%><%if findstr<>"" then%>&findstr=<%=findstr%><%end if%>'><%=pno%></a>
      <%end if%><%next%> 页&nbsp;&nbsp;每页&nbsp;<%=pmcount%>&nbsp;条记录。</a></td>
  </tr>
</table>
<table width="614" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
<%if bid<>0 then%>
[ <a href='post.asp?bid=<%=bid%>' title='发表新帖子'>发表</a> ] 
<%end if%>
<%if method<>"" or findstr<>"" then%>
[ <a href="topic.asp?bid=<%=bid%>" title="新新帖子">新新帖子</a> ] 
<%end if%>

<%if method<>"hot" then%>
[ <a href="topic.asp?bid=<%=bid%>&method=hot" title="回复数最多的帖子">热门话题</a> ]
<%end if%>
<%if method<>"hits" then%>
[ <a href="topic.asp?bid=<%=bid%>&method=hits" title="点击数最多的帖子">人气帖子</a> ]
[ <a href=begin.asp>返回</a> ]

<%end if%>
</td>
</tr>
</table>

<table width="100%" border="0" cellspacing="2" cellpadding="2" class=buinput>
<%
    if reco.eof then
%>
  <tr>
    <td height="15" align='center'><%if findstr="" then%>此 版 暂 无 帖 子 !<%else%>未 找 到 与 <font color="red"><%=findstr%></font> 相 关 的 帖 子 !<%end if%></td>
  </tr>
<%
    else
%>
  <tr class=buinput> 
    <td height="15" width="30"></td>
    <td height="15" width="301"> 
      <div align="center">文 章 标 题</div>
    </td>
    <td height="15" width="100"> 
      <div align="center">发言人</div>
    </td>
<%if method="hits" then%>
    <td height="15" width="33"> 
      <div align="center">人气</div>
    </td>
<%else%>
    <td height="15" width="33"> 
      <div align="center">回复</div>
    </td>
<%end if%>
    <td height="15" width="74"> 
      <div align="center">发表日期</div>
    </td>
    <td height="15" width="74"> 
      <div align="center">更新日期</div>
    </td>
  </tr>
<%
    reco.absolutepage=pageno	'将指针移至指定页的第一条记录
    loopno=pmcount
    do while not reco.eof and loopno>0
    id=reco("id")
    title=trim(reco("title"))
    username=trim(reco("username"))
    usermail=trim(reco("usermail"))
    reply=reco("reply")
    wdate=month(reco("wdate")) & "/" & day(reco("wdate"))
    ldate=month(reco("ldate")) & "/" & day(reco("ldate"))
    faceimg="<img src='images/"&trim(reco("faceimg"))&".gif'>"
    if usermail<>"" then
        userlink="<a href='mailto:" &usermail & "' title='给 " &username& " 发封妹儿'>" &username& "</a>"
    else
        userlink=username
    end if
    loopno=loopno-1
%>
  <tr class=tr> 
    <td height="15" width="30" align='center'><%=faceimg%></td>
    <td height="15" width="301"><a href='show.asp?id=<%=id%>'><%=title%></a>
    <%if bid=0 then%>[ 版面:<font color="red"><%=reco("bid")%></font> ]<%end if%></td>
    <td height="15" width="100" align='center' valign='min'><%=userlink%></td>
    <%if method="hits" then%>
    <td height="15" width="33" align='center' valign='min'><%=reco("hits")%>次</td>
    <%else%>
    <td height="15" width="33" align='center' valign='min'><%=reply%>篇</td>
    <%end if%>
    <td height="15" width="74" align='center' valign='min'><%=wdate%></td>
    <td height="15" width="74" align='center' valign='min'><%=ldate%></td>
  </tr>
<%
    reco.movenext
    loop
	end if
%>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align='center' height='15'>
	<form method="post" action="topic.asp" name="find"><input type='text' class=buinput maxlength="30" size="20" name='findstr' value='查找的内容'>
        <input type='hidden' name='bid' value=<%=bid%>>
        <input type="submit" value=" 查找 " name='find' class=buinput>
    </form>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2" background="images/bg1.gIf" bgcolor="#7C96B8" class=buinput>
  <tr> 
    <td height="15" colspan="2" width="375"><font color=#336699>版面:<%=session("bname")%></a></td>
    <td height="15" width="235"><font color=#336699>版主:<%=session("dbuser")%></a></td>
    <td height="15" width="100"><font color=#336699>论题:<%=reco.recordcount%> 篇</a></td>
  </tr>
  
</body>
</html><!--#include file="copyright.asp"-->
<%
set reco=nothing
set conn=nothing
%>

⌨️ 快捷键说明

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