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

📄 list.asp

📁 本程序蓝本为6kbbs 默认前台管理员的帐号是:woodcoal
💻 ASP
字号:
<!--#include file="up.asp"-->
<%
checklg()
dim sql,face1,pagesetup,count,totalpage,pagecount,ii,iii,href1,href2,href3,topicinfo,retopic,reinfo,gonggao,online,renum,repage,n,nn,hot,width,face,formatedatetime%>

<script language="JavaScript">
<!--
function Check() {
	var Name=document.form.topage.value;
	document.location="?bd=<%=bd%>&action=<%=action%>&topage=" + Name;
}
//-->
</script>

<%
gonggao=checknum(request.Cookies(prefix&"1")("gonggao"))
online=checknum(request.Cookies(prefix&"1")("online"))

if isnull(lguserid) or lguserid="" then
	if conn.execute("select userid from online where ip='"&ip&"'").eof then
		sql="insert into online(ip,lasttime,onbd,nowon) values('"&ip&"',now(),"&bd&",'"&bdinfo(0)&"')"
	else
		sql="update online set userid=0,name='',lasttime=now(),pic=0,onbd="&bd&",nowon='"&bdinfo(0)&"' where ip='"&ip&"'"
	end if
else
	if conn.execute("select userid from online where userid="&lguserid&" or ip='"&ip&"'").eof then
		sql="insert into online(userid,name,ip,lasttime,pic,onbd,nowon) values("&lguserid&",'"&lgname&"','"&ip&"',now(),"&usertype&","&bd&",'"&bdinfo(0)&"')"
	else
		sql="update online set userid="&lguserid&",name='"&lgname&"',ip='"&ip&"',lasttime=now(),pic="&usertype&",onbd="&bd&",nowon='"&bdinfo(0)&"' where userid="&lguserid&" or ip='"&ip&"'"
	end if
end if

conn.execute(sql)
conn.execute("delete from online where now()-lasttime>"&onlinetime&"/24")

Dim BbsMessageStr
if gonggao=1 or gonggao="" then
	BbsMessageStr="<script language=""JavaScript"" src=""inc/menu.js""></script>" & VbCrLf
	
	dim papern,paper,papers
	papern=0

	BbsMessageStr=BbsMessageStr & "<script language=""JavaScript"">" & VbCrLf
	BbsMessageStr=BbsMessageStr & "	messages = new Array()" & VbCrLf
	
	set papers=conn.execute("select*from paper where bd="&bd&" order by id desc")
	if papers.eof then
		BbsMessageStr=BbsMessageStr & "	messages[0]=""&nbsp;当前没有公告""" & VbCrLf
	else
		do while not papers.eof
			paper=papers("paper")
			paper=split(paper,"|")
			BbsMessageStr=BbsMessageStr & "	messages[" & papern & "]=""&nbsp;<a href='#' onclick=openscript('paper.asp?id=" & papers("id") & "')><b>" & kbbs(lefttrue(paper(0),45)) & "[ " & paper(2) & " ]</b></a>""" & VbCrLf
			papern=papern+1
			papers.movenext
		loop
	end if
	set papers=nothing
	BbsMessageStr=BbsMessageStr & "</script>" & VbCrLf

	BbsMessageStr=BbsMessageStr & "<div id=""content""></div>" & VbCrLf
	BbsMessageStr=BbsMessageStr & "<script language=""JavaScript"">jspaper()</script>" & VbCrLf
end if%>


<div class="BBS_BoardList">
	<h1><img border="0" src="pic/gl.gif" align="absmiddle" />&nbsp;公告信息</h1>

	<div class="BBS_BoardHead" style="height:20px;"><%=BbsMessageStr%></div>

	<div class="BBS_BoardHead">
		<font face="Wingdings" color="#9ec750">v</font>&nbsp;本版帖数:<b><%=topicnum%></b>&nbsp;&nbsp;&nbsp;
		<font face="Wingdings" color="#9ec750">v</font>&nbsp;今日帖数:<font color="blue"><b><%=todaynum%></b></font>&nbsp;&nbsp;&nbsp;

	<%if online=1 or online="" then
		dim onbd1,onbd2
		onbd1=conn.execute("select count(userid) from online where onbd="&bd&"")(0)
		onbd2=conn.execute("select count(userid) from online where onbd="&bd&" and userid=0")(0)%>

	<script language="JavaScript">
	<!--
		var checktj;
		checktj=1;
		
		function tj0() {
			if(onlinetj.style.display=="") {
				onlinetj.style.display = "none";
			}else {
				onlinetj.style.display="";
				if (checktj==1) {
					tj.location="online.asp?onlinetj=bd&bd=<%=bd%>";
				}
				checktj=2;
			}
		}
	//-->
	</script>

		<font face="Wingdings" color="#9ec750">v</font>&nbsp;目前本版面总共有 <font color="#FF0000"><b><%=onbd1%></b></font> 人在线。其中有 <font color="#FF0000"><b><%=onbd1-onbd2%></b></font> 位会员,<b><%=onbd2%></b> 位游客。 [ <a onclick="tj0()">详细列表</a> ]
		<div id=onlinetj style="display:none"><iframe name="tj" marginwidth="3" marginheight="2" width="100%" border="0" frameborder="0" height="65"></iframe></div>
	<%end if%>
	</div>

	<h2 align="center">
	<%if usertype>3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|"))>0 then%>
		<font face="Wingdings" color="#ff0000">v</font>&nbsp;<a href="adminbd.asp?bd=<%=bd%>&action=gonggao">发布公告</a>&nbsp;&nbsp;&nbsp;
		<font face="Wingdings" color="#ff0000">v</font>&nbsp;<a href="adminbd.asp?bd=<%=bd%>&action=gonggaogl">公告管理</a>&nbsp;&nbsp;&nbsp;
		<%if bdtype=3 then%><font face="Wingdings" color="#ff0000">v</font>&nbsp;<a href="adminbd.asp?action=passuser&bd=<%=bd%>"> 认证用户</a>&nbsp;&nbsp;&nbsp;<%end if%>
		<font face="Wingdings" color="#ff0000">v</font>&nbsp;<a href="adminbd2.asp?action=recycle&bd=<%=bd%>">回 收 站</a>
	<%end if%>
	</h2>
</div>

<div><a href="say.asp?bd=<%=bd%>&topictype=1"><img border="0" src="images/skin/<%=sid%>/fabiao.gif" /></a>&nbsp;<a href="say.asp?bd=<%=bd%>&topictype=1&vote=1"><img border="0" src="images/skin/<%=sid%>/vote.gif" /></a></div>

<div align="right">

	<img border="0" src="images/skin/<%=sid%>/fle.gif" align="absmiddle" />&nbsp;
	<%if isnull(thisbdadmin) or thisbdadmin="" then
		response.write "本版面还没有版主"
	else
		response.write"本版版主:"
		dim thisadmin,adi
		adi=0
		thisadmin=split(kbbs(thisbdadmin),"|")
		do while thisadmin(adi)<>""
			response.write "<a href=userinfo.asp?username="&trim(thisadmin(adi))&" title=查看该版主的资料>"&thisadmin(adi)&"</a>&nbsp;&nbsp;"
			adi=adi+1
		loop
	end if%>

	&nbsp;&nbsp;&nbsp;<img border="0" src="images/skin/<%=sid%>/fle.gif" align="absmiddle" />&nbsp;<a href="?bd=<%=bd%>&action=good">本版精华</a>

</div>

<%=ttop%>
<table align="center" class="BBS_BoardList" cellpadding="0" cellspacing="1">
	<tr class="BBS_BoardTitle" align="center">
		<td width="5%">状态</td>
		<td width="5%">表情</td>
		<td>主题</td>
		<td width="11%">作者</td>
		<td width="10%">回复/人气</td>
		<td width="12%">最后更新时间</td>
		<td width="11%">最后回复</td>
	</tr>

<%dim action
action=request.querystring("action")

if action="good" then
	sql="select * from topic where bd="&bd&" and type=1 order by top desc,edittime desc"
else
	sql="select * from topic where (bd="&bd&" or top=2) and type<>3 order by top desc,edittime desc"
end if

set rs = server.createobject("adodb.recordset")
pagesetup=checknum(application(prefix&"topiclistpage"))
rs.Open sql,conn,1
TotalPage=0
Count=rs.recordcount
conn.execute("update bdinfo set topicnum="&count&" where id="&bd&" and followid<>0")
if not rs.eof then
	If Count/pagesetup > (Count\pagesetup) then
		TotalPage=(Count\pagesetup)+1
	else
		TotalPage=(Count\pagesetup)
	End If
	pagecount= 0
	rs.moveFirst
	if Request.QueryString("ToPage")<>"" and isnumeric(Request.QueryString("ToPage")) then PageCount = cint(Request.QueryString("ToPage"))
	if PageCount <=0 then PageCount = 1
	if PageCount > TotalPage then PageCount = TotalPage
	rs.move (PageCount-1) * pagesetup
	i=1
	do while not rs.eof
		topicinfo=split(rs("topicinfo"),"|")
		retopic=rs("retopic")
		if isnull(retopic) or retopic="" then
			reinfo="——"
			retopic="无人回复。|——|0"
			retopic=split(retopic,"|")
		else
			retopic=split(retopic,"|")
			reinfo="<a href=""userinfo.asp?userid="&retopic(2)&""">"&kbbs(retopic(1))&"</a>"
		end if
		renum=rs("renum")
		hot=checknum(application(prefix&"showbbspage"))
		if renum/hot>(renum\hot) then
			repage=(renum\hot)+1
		else
			repage=renum\hot
		end if
		width=35
		face=topicinfo(0)
		face1="folder"
		if rs("type")=1 then face1="jing"
		if rs("type")=2 then face1="lock"
		if repage>1 then face1="hot"
		if datediff("h",rs("edittime"),now())<3 then face1="new"
		if rs("top")=1 then face1="top"
		if rs("top")=2 then face1="alltop"
		if repage>1 then width=25
		response.write"<tr class=""BBS_BoardItem"" align=""center""><td width=""5%""><img border=""0"" src=""images/face/"&face1&".gif"" /></td><td width=""5%""><a href=""show.asp?bd="&rs("bd")&"&id="&rs("id")&"&totable="&rs("totable")&""" title=""单击从新窗口查看此贴!"" target=""_blank"">"&topicinfo(3)&"<img border=""0"" src=""images/face/"&face&".gif"" /></a></td><td style=""text-align: left;""><a href=""show.asp?bd="&rs("bd")&"&id="&rs("id")&"&totable="&rs("totable")&""" title=""最后回复:"&kbbs(retopic(0))&""">"&topicinfo(3)&" <font color="""&replacecolor(kbbs(topicinfo(1)))&""">"&lefttrue(kbbs(topicinfo(1)),width)&"</font></a>"
		if repage>1 then
			response.write"&nbsp; &nbsp;<font color="""&c1&""">[</font><b> "
			if repage<=4 then
				for n=1 to repage
					response.write"<a target=_self href=show.asp?id="&rs("id")&"&bd="&rs("bd")&"&totable="&rs("totable")&"&topage="&n&"><font color="&c1&">"&n&"</font></a> "
				next
			else
				for nn=1 to 3
					response.write"<a target=_self href=show.asp?id="&rs("id")&"&bd="&rs("bd")&"&totable="&rs("totable")&"&topage="&nn&"><font color="&c1&">"&nn&"</font></a> "
				next
				response.write"... <a target=_self href=show.asp?id="&rs("id")&"&bd="&rs("bd")&"&totable="&rs("totable")&"&topage="&repage&"><font color="&c1&">"&repage&"</font></a> "
			end if
			response.write" </b><font color="&c1&">]</font>"
		end if
		response.write"</td><td class=td align=center width=""11%"" ><a href=userinfo.asp?userid="&rs("userid")&">"&kbbs(topicinfo(2))&"</a></td><td class=td align=center width=""10%"">"&renum&"/"&rs("hits")&"</td><td class=td align=center width=""12%"" >"&formatdatetime(rs("edittime"),2)&"</td><td class=td align=center width=""11%"" >"&reinfo&"</td></tr>"
		i=i+1
		if i>pagesetup then exit do
		rs.movenext
	loop
end if
rs.Close
set rs=nothing
href1=" <a href=?topage=1&bd="&bd&"&action="&action&">"
response.write"<tr><td colspan=""7"" align=""center""><h2><form name=form method='POST' action=javascript:Check()><font color="&c3&"><img border='0' src='pic/fl.gif'> 本版面共有</font><font color=red> "&TotalPage&" </font><font color="&c3&">页,<font color=red> "&count&" </font>张帖子,每页有<font color=red> "&pagesetup&" </font> 张帖子 >> ["
ii=PageCount-5
iii=PageCount+5
if ii < 1 then
ii=1
end if
if iii > TotalPage then
iii=TotalPage
end if
if PageCount > 6 then
Response.Write ""&href1&"<font color=yellow>1</font></a> ... "
end if
for i=ii to iii
If i<>PageCount then
href2=" <a href=?topage="& i &"&bd="&bd&"&action="&action&">"
href3="<a href=?topage="&TotalPage&"&bd="&bd&"&action="&action&">"
Response.Write ""&href2&"<font color=yellow>" & i & "</font></a> "
else
Response.Write " <font color=red><b>"&i&"</b></font> "
end if
next
if TotalPage > PageCount+5 then
Response.Write " ... "&href3&"<font color=yellow>"&TotalPage&"</font></a>"
end if
response.write" ]</font></b>&nbsp;&nbsp;&nbsp;&nbsp;<font color="&c3&">页码:<input style=FONT-SIZE:9pt maxLength='6' size='6' name='topage' value='"&PageCount&"'><input style=FONT-SIZE:9pt value='GO!' type='submit'></font></form></h2></td></tr></tbody></table>"&tbottom&""
%>

<script language="javascript">
	function ckey() {
		var word=document.search.key.value;
		document.location="search.asp?action=search&bbs=<%=bd%>&key="+word;
	}
</script>

<div id="BBS_ICON">
<div>
	<img src="images/face/alltop.gif" border="0" align="absmiddle" />&nbsp;总置顶&nbsp;&nbsp;
	<img src="images/face/top.gif" border="0" align="absmiddle" />&nbsp;置顶&nbsp;&nbsp;
	<img src="images/face/jing.gif" border="0" align="absmiddle" />&nbsp;精华&nbsp;&nbsp;
	<img src="images/face/vote.gif" border="0" align="absmiddle" />&nbsp;投票&nbsp;&nbsp;
	<img src="images/face/folder.gif" border="0" align="absmiddle" />&nbsp;开放&nbsp;&nbsp;
	<img src="images/face/hot.gif" border="0" align="absmiddle" />&nbsp;热门&nbsp;&nbsp;
	<img src="images/face/lock.gif" border="0" align="absmiddle" />&nbsp;锁定
</div>
</div>

<%call down%>

⌨️ 快捷键说明

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