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

📄 show.asp

📁 类似于baidu的百度知道
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conndb.asp"-->
<!--#include file="inc/function.asp"-->
<%
id=Request.QueryString("id")
	If Request("CurPage") = "" or Request("CurPage") = 0 then
		CurPage = 1
			Else
		CurPage = CINT(Request("CurPage"))
	End If
Set rs1 = Server.CreateObject("ADODB.Recordset") 
rs1.Open "Select * From "&bbstable&" where IsCheck>0 and id="&id, conn,3,3 
'访问次数.根据session的值判断是否需要累加
	if session("refresh_"&id)="" then session("refresh")="0"
	if cLng(session("refresh_"&id)) <> cLng(id) then 
		rs1("hits")=rs1("hits")+1 
		rs1.update 
	  session("refresh_"&id)=id''--将session更新为当前的id号
	end if
		nowhits=rs1("hits") 
		title=rs1("title")
		recount=rs1("recount")
		istop=rs1("istop")
		isgood=rs1("isgood")
		username0=rs1("username")
		addtime=rs1("addtime")
		image=rs1("picurl")
		content=rs1("content")
		boardid=CInt(rs1("boardid"))
	rs1.close
set rs1=Nothing
		If ubound(split(username0,"."))<3 And instr(username0,".*")=0 And ((Dreamsun_Name<>"" And isuserinfo=0) Or isuserinfo=1) Then
		username="<a href=user.asp?Action=infoshow&username="&username0&">"&DropFuckWords(LCase(username0))&"</a>"
		Else
		username=DropFuckWords(LCase(username0))
		End If 

'吧的相关信息
If boardid<>"" And boardid<>0 Then
		isboardid="&boardid="&boardid
		'从缓存中读出吧的相关信息
		For kkkj=1 To Application(webname&"boardcount")
				'开始循环
				If boardid=Application(webname&"board_id"&kkkj) Then
					boardname=Application(webname&"board_name"&kkkj)
					boardadmin0=Application(webname&"board_admin"&kkkj)
					boardname=Application(webname&"board_name"&kkkj)
				End If
		Next
		If boardadmin0<>"" Then 
			boardadmin=" 版主:"&boardadmin0
		Else
			boardadmin=" 暂无版主"
		End if
		If Dreamsun_name<>"" And boardadmin0<>"" And isadmin<>9 Then 
			tdim0=split(boardadmin0,"|")
			for ti0=0 to ubound(tdim0)
				If Dreamsun_name=tdim0(ti0) Then isadmin=1 '斑竹是1,高官是9
			next
		End If

End If
'--Add by zidone 2006/12/30
boardadmin = Replace(boardadmin,"|"," ")
ggg=title&"-"&boardname&"-ID="&id
navdh=" <a href=index.asp?boardid="&boardid&">"&boardname&"</a> &gt;&gt; 浏览主题"
webtitle=title&"-"&bbsname
navright=boardadmin&"  吧主:"&sysManager
Call showpage()
Sub pagecontent()
%>
<div id="cp">
	<DIV id="cp-left">
			<a href="./#new"><img src="<%=indeximg%>/nav_post.gif" width="72" height="24" border="0"></a> <a href="index.asp?act=jinghua&<%=isboardid%>"><img src="<%=indeximg%>/nav_good.gif" width="52" height="24"border="0"></a> <a href="help.htm"><img src="<%=indeximg%>/nav_help.gif" width="72" height="24" border="0"></a>
	</DIV>
	<div id="cp-right"><% Call boardlist()%></div>
</div>
<DIV id="content">
<div id="content-left">
<!-- 主体模板左侧区域 start-->
<% if CurPage<=1 then  %>
<div class="tiebamain">
	<div class="tiebamain-title">
		<div style="WIDTH: 60%;FLOAT: left;">主 题: <%=DropFuckWords(title)%> </div>
		<div style="WIDTH: 30%;	FLOAT: right;text-align:right;">已阅:<%=nowhits%> / 回复:<%=recount%>(楼主)</div>
	</div>
	<div class="tiebamain-content cont"><%=DropFuckWords(ubbs(content))%></div>
		<%
		If ubound(split(username0,"."))<3 And instr(username0,".*")=0 Then Call sigline(username0)%>
	<div class="tiebamain-info list">
		<div style="WIDTH: 46%;FLOAT: left;">作者:<%=username%> (<%=addtime%>)</div>
		<div style="WIDTH: 52%;	FLOAT: right;text-align:right;"><%
		If isadmin="" And Dreamsun_name=username Then 
		response.write "<a href='edit.asp?tn=bbs&id="&id&"'>编辑</a>"
		End If 
		if isadmin<>"" Then
		response.write ("版主操作:")
		response.write "<a href='edit.asp?tn=bbs&id="&id&"'>编辑</a>"
		response.write (" | ")
		if istop=0 then
		response.write "<a href='tzsave.asp?cz=istop&id="&id&"'>设置顶</a>"
		else
		response.write "<a href='tzsave.asp?cz=istop&id="&id&"'>取置顶</a>"
		end if
		response.write (" | ")
		if isgood=0 then
		response.write "<a href='tzsave.asp?cz=isgood&id="&id&"'>设精华</a>"
		else
		response.write "<a href='tzsave.asp?cz=isgood&id="&id&"'>取精华</a>"
		end If
		response.write (" | ")
		response.write "<a href='tzsave.asp?cz=del&id="&id&"'>删除</a>"
		end if %>&nbsp; <a href="#re" onClick="ResetReplyTitle('楼主','<%=TitleLeft(title,20)%>');">回复此贴</a></div>
	</div>
</div>
<%
end if
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM "&rebbstable&" where IsCheck>0 and re="&id&" ORDER BY addtime ASC" 
rs.open sql,conn,1,1
If rs.eof and rs.bof Then
else
RS.PageSize=bbsnum'设置每页记录数           
Dim TotalPages              
TotalPages = RS.PageCount              
	If CurPage>RS.Pagecount Then               
	CurPage=RS.Pagecount              
	end if              
RS.AbsolutePage=CurPage
rs.CacheSize = RS.PageSize'设置最大记录数  
Dim Totalcount              
Totalcount =INT(RS.recordcount)              
StartPageNum=1              
do while StartPageNum+10<=CurPage              
	StartPageNum=StartPageNum+10              
	Loop              
EndPageNum=StartPageNum+9              
If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount
I=0
p=RS.PageSize*(Curpage-1)
p=p+1
do while (Not RS.Eof) and (I<RS.PageSize)              
reid=rs("id")
retitle=rs("title")
reusername0=rs("username")
recontent=rs("content")
readdtime=rs("addtime")
reimg=rs("picurl")
relou=rs("lou")
If ubound(split(reusername0,"."))<3 And instr(reusername0,".*")=0 And ((Dreamsun_Name<>"" And isuserinfo=0) Or isuserinfo=1) Then
reusername="<a href=user.asp?Action=infoshow&username="&reusername0&">"&DropFuckWords(LCase(reusername0))&"</a>"
Else
reusername=DropFuckWords(LCase(reusername0))
End If 
%>
<div class="tiebamain">
	<div class="tiebamain-title">
		<div style="WIDTH: 60%;FLOAT: left;"><%=DropFuckWords(retitle)%></div>
		<div style="WIDTH: 30%;	FLOAT: right;text-align:right;">第 <%=relou%> 楼</div>
	</div>
	<div class="tiebamain-content cont"><%=DropFuckWords(UBBs(recontent))%></div>
	<%If ubound(split(reusername0,"."))<3 And instr(reusername0,".*")=0 Then Call sigline(reusername0)%>
	<div class="tiebamain-info list">
		<div style="WIDTH: 46%;FLOAT: left;"><span class=tiebamain-span>作者:<%=reusername%> (<%=readdtime%>)</span></div>
		<div style="WIDTH: 50%;	FLOAT: right;text-align:right;"><span id=tiebamain-span><%
			If isadmin="" And Dreamsun_name=reusername Then 
			response.write "<a href='edit.asp?tn=rebbs&id="&reid&"'>编辑</a>"
			End If 
			if isadmin<>"" Then
			response.write "<a href='edit.asp?tn=rebbs&id="&reid&"'>编辑</a>"
			response.write (" | ")
			response.write "<a href='tzsave.asp?cz=redel&id="&reid&"'>删除</a>  |  "
			end if %>&nbsp; <a href="#re" onClick="ResetReplyTitle('<%=relou%>','<%=TitleLeft(Retitle,40)%>');">回复此贴</a></span></div>
	</div>
</div>
	  <%
I=I+1              
RS.MoveNext              
Loop
' 追梦阳光 专用页码简化版,取得显示页码
pagelist=viewpage(Totalcount,bbsnum,5,CurPage,"id="&id,"当前总数:","show.asp")
 '总记录,显示记录数,显示页数,当前页,传替参数,总数说明,当前页面名称
end if
rs.close
set rs=nothing
%>
<DIV class=tiebalist><%=pagelist%></DIV>
<!-- 主体模板左侧区域 end -->
</div>

</DIV>
<div id="write">
<BR>
<%If (Dreamsun_name="" And guestrev=1) Or Dreamsun_name<>"" Then %>
<form name="save" method="post" action="tzsave.asp?cz=addsave" onSubmit="return regcheck(this);" class=postform>
<input name="ycid" type="hidden" id="ycid" value="<%=id%>">
<DIV class="bo"><LABEL for=title><strong>标 题:</strong></LABEL><input name="title" type="text" id="title" size="50"  maxlength="50" value="<%response.write "回复:"&TitleLeft(title,40)%>"></DIV>
<DIV class="bo" style="padding-left: 80px;"><!--#include file="inc/ubb.asp" --></DIV><div id="clear"></div>
<DIV class="bo"><strong><a name="re"></a>回 复:</strong><textarea name="content" cols="60" rows="5" id="contents" title='Ctrl+Enter快速提交' onSelect="javascript: storeCaret(this);" onClick="javascript: storeCaret(this);" onKeyUp="javascript: storeCaret(this);"></textarea></DIV>
<DIV class="bo"><strong>作 者:</strong><%
if Dreamsun_name= "" then
response.write"您目前是匿名发表 <A href='user.asp'>登录</A> | <A href='user.asp?Action=reg'>注册</A>"
else
response.write Dreamsun_name&" | <A href='user.asp?Action=exit'>退出</A>"
end if
%> </DIV>
<%if Dreamsun_name="" then%>
<DIV class="bo"><strong>验证码:</strong><input name="zd_code" type="text" id="zd_code" size="4" maxlength="4" onKeyPress="if ((event.keyCode<48 || event.keyCode>57)) event.returnValue=false"> 
                <img src="inc/GetCode.asp?a=back" alt= "验证码,看不清楚?请点击刷新验证码" style="cursor : pointer;" onClick="this.src='inc/GetCode.asp?a=back'"></DIV>
<%end if%>


<DIV class="bo"><tr>
              <td align="right"><strong>传 图:</strong></td>
              <td align="left"><iframe name=ad frameborder=0 width=100% height=24 scrolling=no src="upload.asp"></iframe></td>
            </tr></DIV>
<DIV class="bo"><input type="submit" name="Submit" value="发表帖子">
      &nbsp;&nbsp;      <input type="reset" name="Submit" value="重新填写"> [Ctrl] + [Enter]直接提交帖子</DIV>
 </form> 
<%Else 
response.write "<BR><BR><CENTER>目前不允许游客回复,请 <A href='user.asp'>登录</A> <A href='user.asp?Action=reg'>注册</A> 发贴.</CENTER><BR><BR>"
End If 
%>
<script language="JavaScript"> 
<!-- 
document.onkeydown=function up(){ 
if(event.ctrlKey&&event.keyCode==13) 
document.save.submit(); 
} 
//--> 
function delete_confirm(e) {
 if (event.srcElement.outerText=="删除")
  event.returnValue=confirm("您确认执行该操作么?不可恢复!");
 }
 document.onclick=delete_confirm;

function regcheck(formct){
	if (formct.title.value=='' ){
		alert('标题不能为空,请填写');
		return false; 
	}
		if (formct.content.value=='' ){
		alert('内容不能为空,请填写');
		return false; 
	}
<%if Dreamsun_name="" then%>
		if (formct.zd_code.value=='' ){
		alert('验证码不能为空,请填写');
		return false; 
	}
<% end if%>
	formct.Submit.disabled=true;
}

function ResetReplyTitle(no, title) {
        if(no == null||no == ""){
          if(title == null || title == '')
            title_src = '<%=TitleLeft(title,40)%>';
          else
            title_src = title;
        }
        else{
          title_src = title;
          var s = title_src.indexOf(":");
          title_src = title_src.substring(s+1,title.length);
        }
        document.forms('save').title.value='回复 ' + no + ':' + title_src;
        return true;
}

      </script> 
</DIV>
<DIV>
<%
If iscallonline=1 Then Call Dreamsun_onliner()
End Sub %>
</DIV>

</body>
</html>


⌨️ 快捷键说明

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