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

📄 showbbs.asp

📁 完美政府版,正版网站解决方案
💻 ASP
字号:
<!--#include file="up.asp"--><!--#include file="inc/grade.asp"--><!--#include file="inc/ubbcode.asp"--><!--#include file="inc/page.asp"-->
<%
dim hostname
hostname=Request.ServerVariables("SERVER_NAME")

checklg()
dim sql,pagesetup,whichl,sexinfo,svote,voten,voteb,n,vtype,votealln,vwidth,voteduser,outtime,canvote,userntype,nowon,userstate,edittopictype

dim content,topicuserid,userinfo,usern
if idtype=3 then
	tl=" 错 误 信 息"
	mes="<b>对不起,你不能查看该帖子,可能存在以下问题:</b><br>·该帖子不存在。<br>·该帖子已经被删除。<br>·该帖子被移动到别的版面。"
	call sendinfo(tl,mes)
	call down
	response.end
end if

dim glmenu
if usertype>3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|"))>0 then

	if usertype=4 or usertype=5 then
		if idtop=2 then
			glmenu=glmenu&"<a href=adminbd.asp?action=delalltop&bd="&bd&"&id="&id&">取消总置顶</a><br>"
		else
			glmenu=glmenu&"<a href=adminbd.asp?action=alltop&bd="&bd&"&id="&id&">总置顶</a><br>"
		end if
	end if

	if idtop<>2 then
		if idtop=1 then
			glmenu=glmenu&"<a href=adminbd.asp?action=deltop&bd="&bd&"&id="&id&"&totable="&totable&">取消置顶</a><br>"
		else
			glmenu=glmenu&"<a href=adminbd.asp?action=top&bd="&bd&"&id="&id&"&totable="&totable&">置顶</a><br>"
		end if
	end if

	if idtype=1 then
		glmenu=glmenu&"<a href=adminbd.asp?action=delgood&bd="&bd&"&id="&id&"&totable="&totable&">取消精华</a><br>"
	else
		glmenu=glmenu&"<a href=adminbd.asp?action=good&bd="&bd&"&id="&id&"&totable="&totable&">精华</a><br>"
	end if

	if idtype=2 then
		glmenu=glmenu&"<a href=adminbd.asp?action=dellock&bd="&bd&"&id="&id&"&totable="&totable&">解锁</a><br>"
	else
		glmenu=glmenu&"<a href=adminbd.asp?action=lock&bd="&bd&"&id="&id&"&totable="&totable&">锁定</a><br>"
	end if

	glmenu=glmenu&"<a href=adminbd.asp?action=delbbs&bd="&bd&"&id="&id&"&totable="&totable&">删除</a><br><a href=adminbd.asp?action=move&bd="&bd&"&id="&id&"&totable="&totable&">移动</a><br><a href=adminbd.asp?action=update&bd="&bd&"&id="&id&"&totable="&totable&">提升</a><br></td></tr></table><br>"

end if


nowon=bdinfo(0)&"→浏览帖子:&#13;&#10;"&replace(replace(idtopic(1),"'","’"),"&","&amp;")
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&",'"&nowon&"')"
	else
		sql="update online set userid=0,lasttime=now(),pic=0,onbd="&bd&",nowon='"&nowon&"' 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&",'"&nowon&"')"
	else
		sql="update online set userid="&lguserid&",name='"&lgname&"',lasttime=now(),pic="&usertype&",onbd="&bd&",nowon='"&nowon&"' where userid="&lguserid&" or ip='"&ip&"'"
	end if
end if
conn.execute(sql)
conn.execute("delete*from online where now()-lasttime>"&onlinetime&"/24")




if idtopic(0)="vote" then
	set svote=conn.execute("select*from vote where id="&id&"")
	voten=svote("votenum")
	voten=split(voten,"|")
	voteb=svote("content")
	voteb=split(voteb,"|")
	voteduser=svote("voteduser")
	if isnull(voteduser) or voteduser="" then voteduser="|0"
	voteduser=split(voteduser,"|")
	outtime=svote("outtime")
	n=ubound(voten)
	votealln=0
	for i=1 to n
		votealln=int(votealln)+int(voten(i))
	next
	if votealln=0 then votealln=1

%>
<div class=showbbsvote>
<table width=100% align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
    <form method="POST" action="cookies.asp?action=vote&id=<%=id%>">
<tr>
      <td width="100%">
      
      <table class=showbbsvotetitle border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
        <tr>
          <td width="25%">投票选项:</td>
          <td  width="75%" >
&nbsp;过期时间:<%=outtime%>&nbsp;&nbsp;&nbsp;
<%
canvote=true
if outtime<now()+timeset/24 then
response.write"[ 该投票截止时间已到。]"
canvote=false
else%>
<%for i=1 to ubound(voteduser)
if isnull(lguserid) or lguserid="" then response.write"[ 你没有登陆,不能投票。]":canvote=false:exit for
if int(voteduser(i))=lguserid then response.write"[ 你已经投票了。]":canvote=false:exit for
next
end if
%><%if canvote=true then%><input type="submit" value="    投    票    " name="B1"><%end if%></td>
        </tr>
      </table>
      
      </td>
    </tr>
    <tr>
      <td width="100%">
		<table border="0" cellpadding="0" style='border-collapse: collapse; WORD-BREAK: break-all' width="100%" >
<%
for i=1 to n
vwidth=voten(i)/votealln*80
%><tr>
          <td width="60%"><p style="line-height: 120%; margin: 2; "><%if svote("type")=1 then%><input type="radio" value="<%=i%>" name="votenum" size="20"><%else%><input type="checkbox" name="votenum_<%=i%>" value="1"><%end if%>&nbsp;<%=checktitle(voteb(i))%></p></td>
          <td width="40%"> <img src="images/voteline.gif" border="0" width="<%=vwidth%>%" height=10> <b><%=voten(i)%></b> 票</td>
        </tr><%next%>
      </table></td>
    </tr></form>
  </table>
</div>
<br>

<%
set svote=nothing
end if


'_____________________________________________________________________________________________________________________________________________

dim wzcount,wzrep,wzpagecount,wzpage,pagestr,urlstr
urlstr="bd="&bd&"&id="&id&"&totable="&totable

sql="select * from bbs"&totable&" where (id="&id&" or bid="&id&") and bd="&bd&" and type<>3 order by bbsid"
set rs = server.createobject("adodb.recordset")
pagesetup=checknum(application(prefix&"showbbspage"))
wzrep=pagesetup

rs.Open sql,conn,1
		if rs.eof or rs.bof then
			response.write"<div class=norecord>暂无记录</div>"
		else
		
			wzcount=rs.recordcount
			conn.execute("update topic set renum="&wzcount-1&",hits=hits+1 where id="&id&"")
			
			wzpagecount = abs(int(-abs(wzcount/wzrep)))
			
			wzpage = clng(request.querystring("page"))
			if len(wzpage) = 0 or wzpage = 0 then wzpage = 1
			rs.absoluteposition=rs.absoluteposition+((abs(wzpage)-1)*wzrep)
			pagestr="每页<font color=red>"&wzrep&"</font>条 共<font color=red>"&wzpagecount&"</font>页 ["&pagination(wzpagecount,urlstr)&"]&nbsp;"

			response.write"<div class=sbbstopstrbutton><div class=sbbspagestr>"&pagestr&"</div>"
			response.write"<div class=newtopicbutton><a href=addtopic.asp?bd="&bd&"&topictype=1><img border=0 src="&styleid&"/fabiao.gif></a>&nbsp; <a href=addtopic.asp?bd="&bd&"&topictype=1&vote=1><img border=0 src="&styleid&"/vote.gif></a>":if idtype=2 and (usertype<3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|")=0)) then:else:response.write"&nbsp; <a href=addtopic.asp?bd="&bd&"&topictype=2&bid="&id&"&totable="&totable&"><img border=0 src="&styleid&"/huifu.gif></a>":end if:response.write"</div></div>"
			response.write"<div class=sbbstop><div class=sbbstop1>"&checktitle(idtopic(1))&"</div><div class=sbbstop2>"&idhits+1&" 位读者, "&idrenum&" 张回帖</div></div>"


			
			for i = 0 to wzrep-1
				if rs.eof then exit for
				whichl=rs.absoluteposition
				content=rs("content")
				content=split(content,"|")
				topicuserid=rs("userid")

'_____________________________帖子开始______________________
response.write"<div class=sbbs>"
'sbbsuser 块__________________________________________

response.write"<div class=sbbsuser>"
set usern=conn.execute("select top 1 userinfo,mark,grade,alltopicnum,del,type from [user] where userid="&topicuserid&"")
userntype=usern("type")
	userinfo=usern("userinfo")
	userinfo=split(userinfo,"|")


		if usern("del")=true then
			userstate="该用户已被删除"
		else
			userstate="该用户处于正常状态"
		end if
		
		if checktitle(userinfo(4))=1 then
			sexinfo="帅哥"
		elseif checktitle(userinfo(4))=2 then 
			sexinfo="靓女"
		end if
		
		response.write"<div class=sbbsname><a href=userinfo.asp?userid="&topicuserid&" title='"&userstate&"'><span class=sbbsnamecolor>"&checktitle(content(2))&"</span></a></div>"&_
		"<div class=sbbspic><a title='"&sexinfo&"'><img src="&checktitle(userinfo(5))&" width="&checktitle(userinfo(6))&" height="&checktitle(userinfo(7))&" border=0></a><br><br><img src=images/grade/"&usern("grade")&".gif border=0></div>"&_
		"<div class=sbbsinfo>积分:"&usern("mark")&"<br>等级:"&gradename(usern("grade"))&"<br>帖数:"&usern("alltopicnum")&"<br>注册:"&userinfo(9):if userinfo(10)<>"" then response.write"<br>头衔:"&checktitle(userinfo(10)):end if
		
			response.write"<br>IP&nbsp;&nbsp;&nbsp;:"
			
			if usertype>=3 then 
				response.write rs("ip")
			else
				response.write"保密"
			end if
		
			response.write"<br>状态:"
			
			if conn.execute("select top 1 userid from online where userid="&topicuserid&" and showyn=true").eof then
				response.write"<span class=offline>离 线</span>"
			else
				response.write"<span class=online>在 线</span>"
			end if

		response.write"</div>"
		

set usern=nothing

response.write"</div>"

'______________________________________________________________________

'sbbsbody 块____________________________________________________________

response.write"<div class=sbbsbody>"
	response.write"<div class=sbbsguide>"
	
		response.write"<div class=sbbsguide1>发表时间:<span class=sbbstime>"&checktitle(content(5))&"</span> <a href=userinfo.asp?userid="&topicuserid&" title='查看作者信息'>信息</a> <a href=sms.asp?action=write&toname="&checktitle(content(2))&" title='给作者留言'>留言</a> "
		
		if userinfo(1)<>"" then
			response.write"<a title='访问作者主页' target=_blank href='"&checktitle(userinfo(1))&"'>主页</a> "
		end if
		if rs("bid")=0 then
			edittopictype=1
		else
			edittopictype=2
		end if
		response.write"<a href=edit.asp?bbsid="&rs("bbsid")&"&topictype="&edittopictype&"&bd="&bd&"&totable="&totable&">编辑</a> <a href=addtopic.asp?topictype=2&bd="&bd&"&quoteid="&rs("bbsid")&"&bid="&id&"&totable="&totable&">引用</a>"
		
		if usertype>3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|"))>0 then
			if rs("bid")=0 then
				response.write " <script>var glmenu='"&glmenu&"';</script><a href=# onmouseover=ShowMenu(glmenu,100,event)>管理</a>"
			else
				response.write" <a href=adminbd.asp?action=delrebbs&id="&rs("bid")&"&bd="&bd&"&bbsid="&rs("bbsid")&">删除</a>"
			end if
		end if
		response.write"</div>"
		response.write"<div class=sbbsguide2><a name="&whichl&" title='复制帖子链接到剪贴板' style='cursor:pointer' onclick=""copyurl('http://"&hostname&""&url&"?bd="&bd&"&id="&id&"&totable="&totable&"&page="&wzpage&"#"&whichl&"', '已经复制到剪贴板')"" title='点击复制本帖地址' class=buildno>#"&whichl&"</a> <a href='#"&whichl-1&"'><font face='Webdings' size=3>5</font></a> <a href='#"&whichl+1&"'><font face='Webdings' size=3>6</font></a></div>"
	
	response.write"</div>"
	
	response.write"<div class=sbbscontentall><img border=0 src=images/face/"&content(0)&".gif> <b>"&checktitle(content(1))&"</b><br>":if userntype=2 or userntype=3 then:response.write"<hr size=1>该用户帖子已被管理员屏蔽,请和管理员联系。<hr size=1>":else:response.write "<div class=sbbscontent>"&ubb(content(4))&"</div>":end if:response.write"</div>"

	if checktitle(rs("edittime"))<>content(5) then response.write"<div class=sbbsedit>该帖子在 "&rs("edittime")&" 编辑过</div>":else:response.write"<div class=sbbsedit></div>":end if
	
	if userinfo(8)<>"" then
	response.write"<div class=sbbssign>"&ubb(userinfo(8))&"</div>"
	else
	response.write"<div class=sbbsnosign></div>"
	end if
	
	response.write"<div class=sbbsad><script language=Javascript src=inc/ads.js></script></div>"
response.write"</div>"
	

response.write"</div>"

'_________帖子结束________________________________________________				
				rs.movenext
			next
			
			response.write"<div class=sbbspagestr>"&pagestr&"</div>"
	end if
rs.Close
set rs=nothing

dim postto
postto="savetopic.asp?bd="&bd&"&bid="&id&"&topictype=2&totable="&totable&""

if not(isnull(lguserid) or lguserid="") then
if idtype=2 and (usertype<3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|")=0)) then
else
%>
<SCRIPT>
function preview()
{
document.form1.topic.value=document.topic.topic.value;
document.form1.content.value=document.topic.content.value;
var popupWin = window.open('paper.asp?action=preview', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes');
document.form1.submit()
}

function presskey(eventobject)
{
var eve=eventobject||window.event
   if(eve.ctrlKey && eve.keyCode==13){document.topic.submit();}else{return false}
}

    </SCRIPT>

<form name="topic" method="POST" action="<%=postto%>">
<div class=quickRe>
	<div class=quickReTitle>
快捷回复	
	</div>
	<div class=quickReBody>
	
		<div class=quickReBodyLeft>·支持UBB代码:√<br>·支持HTML代码:√<br>·支持特殊贴代码:√<br>·<%if idtype=2 and (usertype<3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|")=0)) then:else:response.write"&nbsp; <a href=addtopic.asp?bd="&bd&"&topictype=2&bid="&id&"&totable="&totable&">&gt;&gt;使用高级回复</a>":end if%></div>
		<div class=quickReBodyRight><input type=hidden name=topic size=80 maxlength=59 value="回复帖子:<%=checkform(idtopic(1))%>">
			<textarea rows="10" name="content" cols="85" onkeydown="presskey(event)"></textarea><div class=quickReButton><input class=submit type=submit value=OK_!发表 name=B1>&nbsp;&nbsp;&nbsp; <input class=submit type=button value="预  览!" onclick=preview()>&nbsp;&nbsp;&nbsp; <input class=submit type=reset value=NO_!重写 name=B2>&nbsp; [ 按 Ctrl+Enter 直接发送 ]</div></div>

	</div>

</div></form>

<form name=form1 action=paper.asp?action=preview method=post target=showgg>
<input type=hidden name=topic value=><input type=hidden name=content value=>
</form>
<%
end if
end if%><%call down%>

⌨️ 快捷键说明

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