bbslist.asp

来自「1. 硬件环境:MS WINDOWS NT PACK 4 OR LATER /W」· ASP 代码 · 共 261 行

ASP
261
字号
<!-- #include file="setup.asp" -->
<% 
Call Top
Call table()

Menu=Server.HTMLEncode(Trim(Request.QueryString("Menu")))
BbsID=Trim(Request.QueryString("BbsID"))
Page=Trim(Request.QueryString("page"))
key=Request.QueryString("key")
Guangbo=Split(conn.execute("Select FunctionInfo from Functions where FunctionID=19")(0),"|")

if Page = "" Then Page=1
if Menu="" or len(Menu)>10 Then Error 1,"非法登陆!\n您的IP已被记录",""
if IsNumEric(BbsID)=False and IsNumEric(Page)=False Then Error 1,"非法登陆!\n您的IP以被记录",""

Select Case Menu
	Case "Search"
	validate "Login.asp",0
		if IsNumEric(key)= True Then
			if BbsID="" Then
			Sql="Select Top 100 UserName,UserID,BbsID,ShowID,Icon,Title,AllPost,Content,LastTime,Restore,GoodTop,TopTopic,LockTopic From Forum Where DelThis=False and UserID="&key&" Order by LastTime Desc"
			Else
			if IsNumEric(BbsID)=False Then Error 1,"参数非法传递!\n您的IP已被记录!",""
			Sql="Select Top 100 UserName,UserID,BbsID,ShowID,Icon,Title,AllPost,Content,LastTime,Restore,GoodTop,TopTopic,LockTopic From Forum Where DelThis=False and UserID="&key&" and BbsID="&BbsID&" Order by LastTime Desc"
			End if
		Else
		Error 1,"参数非法传递!\n您的IP已被记录!",""
		End if
	Case "List"
		Sql="Select UserName,UserID,BbsID,ShowID,Icon,Title,AllPost,Content,LastTime,Restore,GoodTop,TopTopic,LockTopic From Forum where DelThis=False and BbsID="&BbsID&" Order by TopTopic Desc,LastTime Desc"
	Case "GoodTopic"
		Sql="Select UserName,UserID,BbsID,ShowID,Icon,Title,AllPost,Content,LastTime,Restore,GoodTop,TopTopic,LockTopic From Forum where DelThis=False and GoodTop=True and BbsID="&BbsID&" Order by LastTime Desc"
	Case "Bbspass"
	pass=Trim(Request.QueryString("pass"))
		if pass=Trim(conn.execute("Select BbsPsd from BbsInfo where BbsId="&BbsID)(0)) Then
			Session("BbsPass")=pass
			Response.Redirect "?Menu=List&BbsID="&BbsID
		Else
			Error 2,"密码不正确!\n请返回重新输入!",""
		End If
	Case Else
	Error 1,"非法登陆!\n您的IP地址已被记录!",""
End Select

if Menu <> "Search" Then
	BbsMan=Split(conn.execute("Select BbsMan from BbsInfo where BbsId="&BbsID)(0),",")
	BbsPsd=Trim(conn.execute("Select BbsPsd from BbsInfo where BbsId="&BbsID)(0))
	if (conn.execute("Select BbsShow from BbsInfo where BbsId="&BbsID)(0)=True or BbsPsd <> "") and (BbsPsd <> Session("BbsPass") or Session("BbsPass") ="") Then%>
		<script language=javascript>var id=prompt("此论坛为管理专用论坛,请输入通行密码!","");if(id){window.location.href='?menu=Bbspass&Bbsid=<%=BbsId%>&pass='+id+'';}</script>
		<%Response.End()
	End if
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open Sql,conn,1
rs.pagesize=20
page=Cint(page)
if Page < 1 Then Page=1
if Page > rs.pagecount then Page=rs.pagecount
num=rs.recordcount
maxpage=rs.pagecount
%>

<br>
	<style type="text/css">
	<!--	TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}-->
	<!--
	.unnamed1  {
		border-top-width: 1px;
		border-right-width: 1px;
		border-bottom-width: 1px;
		border-left-width: 1px;
		border-top-style: none;
		border-right-style: none;
		border-bottom-style: solid;
		border-left-style: solid;
		border-top-color: #a4b6d7;
		border-right-color: #a4b6d7;
		border-bottom-color: #a4b6d7;
		border-left-color: #a4b6d7;
	}
	.a1 {
		border-top-width: 1px;
		border-right-width: 1px;
		border-bottom-width: 1px;
		border-left-width: 1px;
		border-top-style: none;
		border-right-style: solid;
		border-bottom-style: solid;
		border-left-style: solid;
		border-top-color: #a4b6d7;
		border-right-color: #a4b6d7;
		border-bottom-color: #a4b6d7;
		border-left-color: #a4b6d7;
	}
	-->
	</style>

	<script>
	function loadThreadFollow(ino){
		var targetImg =eval("followImg" + ino);
		var targetDiv =eval("follow" + ino);
			if (targetDiv.style.display!='block'){
				targetDiv.style.display="block";
				targetImg.src="images/minus.gif";
				if (targetImg.loaded=="no"){document.frames["hiddenframe"].location.replace("loading.asp?id="+ino+"");}
			}else{
				targetDiv.style.display="none";
				targetImg.src="images/plus.gif";
			}
	}
	
	function MM_jumpMenu(targ,selObj,restore){ //v3.0
	if(selObj.options[selObj.selectedIndex].value!=""){
	  eval(targ+".location='"+"ShowUserInfo.asp?UsId="+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}
	}
	
	function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}
	var i=0;
	function formCheck(){i++;if (i>1) {document.form.submit1.disabled = true;}return true;}
	function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){i++;if (i>1) {alert('帖子正在发出,请耐心等待!');return false;}this.document.form.submit();}}
	function runEx(){
	if (event.srcElement.parentElement.children[0].value.length<1) {alert("请输入代码后按调试代码");return true;}
	var winEx = window.open('', '', 'resizable,scrollbars');winEx.document.write(unescape(event.srcElement.parentElement.children[0].value));
	}
	function openwindows(){
	var winEx = window.open('', '', 'resizable,scrollbars');winEx.document.write('<title><%=GuangBo(0)%></title><body background=images/background1.gif><%=GuangBo(1)%>');
	}
	</script>
	<iframe HEIGHT="0" WIDTH="0" NAME="hiddenframe"></iframe>

	<a href=AddnewTop.asp?menu=Addnew&BbsID=<%= BbsID %>><img src=images/postnew.gif border="0"></a>
  	<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
	<tr><td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none"> 
	<b>&nbsp;■ </b> 您现在的位置:<%=Community%>  → <% If Menu = "Search" Then 
	Response.write "你发表的所有文章"
	Else%>
	<a href=?Menu=List&BbsID=<%= BbsID %>><%= conn.execute("Select BbsName from BbsInfo where BbsId="&BbsID)(0) %> </a>
	<% End If %>

	</td>
	</tr></table>
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="100%" >
	<table  cellSpacing="0" cellPadding="0" width=100% align="center" border="0">
  	<tr> 
    <td align="left" width="13%"><img src="images/announce.gif">&nbsp;公告: </td>
    <td align="left" width="40%"><marquee onmouseover="this.stop()" onmouseout="this.start()" width="300" scrollAmount="3"><a href="#" onclick="javascript:openwindows()"><%= GuangBo(0) %></a></marquee></td>
	<form name="form1"><td align="right" width="47%"><img src="images/jt.gif"> 论题数:<%= num %> <img src="images/jt.gif"> <a href=?Menu=GoodTopic&BbsId=<%= BbsId %>>论坛精华</a> <img src="images/team.gif"> 
	<% If Menu <> "Search" Then %>
	<select name="menu1" onChange="MM_jumpMenu('parent.main',this,0)">
	<option selected>论坛版主</option>
	<%For i=0 to Ubound(BbsMan)
	Response.Write "<option value="&BbsMan(i)&">"&conn.execute("Select UserName_2 from UserInfo where UserID="&BbsMan(i))(0)&"</option>"
	next%>
	</select>
<% End If %>


    </td></form>
 	</tr>
	</table>
	</TD>
	</TR></TABLE>
  	<table borderColor="#a4b6d7" background=images/title_sub.gif  cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
	<tr>
	<td width="4%" > </td>
    <td align="middle" height="24"  width="45%"><font color="#000000"><font color="#000000"> 主题</font></font></td>
    <td align="middle" width="13%" height="24"><font color="#000000"><font color="#000000">作者</font></font></td>
    <td align="middle" width="9%" height="24"><font color="#000000">字/[回]</font></td>
    <td width="27%" height="24"> <center><font color="#000000">最后回复</font></a></font></center></td>
	</TR></TABLE>
<% if Not Rs.Eof Then showonepage rs,Cint(Page)%>
	<table width="100%" border="0" cellspacing="4"><tr>
	<td><strong>本论坛共有 <font color="#CC3300"> <%= maxpage %> </font>页 [ <% Npage page,maxpage %>]</strong></td>
	<form ><td><div align="right">跳转到第 <input type="text" name="pagel" size="2" maxlength=3 value=<%=page%>> 页 <input name="go" type="button"  value="GO!" Onclick=javascript:location.href='?Menu=<%= Menu %>&BbsID=<%= BbsId %>&page='+form.pagel.value;>
	</div></td></form></tr></table>
	
	
	<center>
	<table cellSpacing="4" cellPadding="0" width="66%" border="0" style="border-collapse: collapse">
	<tr><td width="25%" height="34" noWrap><div align="center"><img alt src="images/f_norm.gif" border="0"> 普通主题 </div></td>
	<td noWrap width="25%"><div align="center"><img alt src="images/f_locked.gif" border="0"> 锁定主题</div></td>
	<td noWrap width="25%"><div align="center"><img src="images/topicgood.gif">  精华主题</div></td>
	<td noWrap width="25%"><div align="center"><img alt src="images/f_top.gif" border="0">  置顶主题</div></td>
	</tr>
	</table>
	</center>
<% 
Set Rs = Nothing
htmlend 

sub showonepage(rs,page)
	rs.absolutepage=page
	For ipage=1 to rs.pagesize
	rsToGbook rs
	rs.MoveNext
	if rs.EOF Then Exit For
	Next
end sub

sub RsToGbook(rs)
	If Rs("GoodTop")=True Then
		img= "topicgood"
	ElseIf Rs("TopTopic")>0 Then
		img= "f_top"
	ElseIf Rs("LockTopic")=True Then
		img= "f_locked"
	Else
		img= "f_new"
	End if%>
	<table cellSpacing="0" cellPadding="3" width="100%" border="0">
	<tr> 
    <td width="4%"  class=unnamed1><img src="images/<%= img %>.gif"></td>
    <td  width="45%"  class=unnamed1> <img loaded="no" src="images/plus.gif" id="followImg<%=rs("ShowID")%>" style="cursor:hand;" onclick="loadThreadFollow(<%=rs("ShowID")%>)"> 
    <a target="_blank" href=BbsShow.asp?Menu=Show&BbsId=<%=rs("ShowID")%>&Bbs=<%=Rs("BbsID")%>> <img src=images/brow/<%= Rs("Icon") %>.gif border=0></a> 
    <font color="#000000"><a href=BbsShow.asp?Menu=Show&BbsId=<%=rs("ShowID")%>&Bbs=<%=Rs("BbsID")%>><%= Rs("Title") %></a> &nbsp;<% NextPage rs("ShowID"),Rs("AllPost") %></font></div></td>
    <td align="middle" width="13%"  class=unnamed1><font color="#000000"><a href=ShowUserInfo.asp?UsId=<%=rs("UserID")%>><%= Rs("UserName") %></a></font></td>
    <td align="middle" width="9%"  class=unnamed1><font color="#000000"><%= Len(Rs("Content")) %>/<font color="#CC3300">[<%= Rs("AllPost") %>]</font></font></td>
    <td align="center" width="27%" height="24" class=a1> <font color="#000000"><%= Rs("LastTime") %> | <%= Rs("Restore") %></font></td>
	</TR>
	<tr style="display:none" id="follow<%=rs("ShowID")%>"> 
    <td colspan="5" id="followTd<%=rs("ShowID")%>"  class=a1>
		<div onclick="loadThreadFollow(<%=rs("ShowID")%>)">
		<table width="100%" cellpadding="0">
		<tr>
		<td width="100%">加载中,请稍等....</td>
		</tr>
		</table>
		</div>
	</td>
	</TR>
	</TABLE>
<%end sub

Sub NextPage(BbsI,AllPage)
	if AllPage > 15 Then
	a=1
	Response.write "[<img src=images/multipage.gif> "
	For i=1 to AllPage Step 15
	Response.write "<a href=BbsShow.asp?Menu=Show&BbsId="&BbsI&"&Bbs="&BbsID&"&page="&a&"><b>"&a&"</b></a> "
	a=a+1
	Next
	Response.write "]"
	End if
End Sub

Sub Npage(page,Allpage)
a=page-5
b=page+5
key=Request.QueryString("key")
if page > 6 Then Response.write "<a href=?Menu="&Menu&"&BbsID="&BbsID&"&key="&key&"&page=1>1</a> ...&nbsp;"
	For a=a to b
	if a > 0 and a <= Allpage  Then 
	Response.write "<a href=?Menu="&Menu&"&BbsID="&BbsID&"&key="&key&"&page="&a&">"&a&"</a>&nbsp;"
	End if
	Next
if Page < Allpage - 5 Then Response.write "... <a href=?Menu="&Menu&"&BbsID="&BbsID&"&key="&key&"&page="&Allpage&">"&Allpage&"</a>&nbsp;"
End Sub%>

⌨️ 快捷键说明

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