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

📄 showpost.asp

📁 他是一个asp+access的多用户留言板!
💻 ASP
字号:
<!-- #include file="密码验证.asp" --><%title="文章阅读"%>

<%
PostID = Request.QueryString("PostID")
  set rs = server.CreateObject("ADODB.Recordset")  
  rs.open "SELECT * FROM 文章标题 Where id="&PostID ,conn ,3,3
 if not rs.eof then''''''''''''''''''''''IF'''''''''''''''''''''''''''''''''''''''''''
  rs("查看")=rs("查看")+1
  Chakan=rs("查看")
  INNER=rs("内容")
  WriterID=rs("发送人")
  Writer=id2name(WriterID)
  Title=rs("文章标题")
  DateTime=rs("日期")
  classnum=rs("班级")
  ke=rs("客人")
  ip=rs("ip")
  rs.update
  rs.close    
 set rs=nothing
   
 if NOIPUserTit="管理员" or NOIPUserID=WriterID and NOIPUserID>0 then editable=true  else editable=false
 if NOIPUserTit="管理员" or NOIPUserTit="班长" or NOIPUserID=WriterID  and NOIPUserID>0 then delable=true else delable=false

%>
<!-- #include file="head.asp" -->
<%valigntop()%>
<table class="a2" height="21" cellSpacing="1" width="97%" align="center" border="0" id="table1">
	<tr class="a1">
		<td width="100%" colSpan="4" height="9">
		<table cellSpacing="0" width="100%" border="0" id="table2" height="25">
			<tr class="a1">
				<td><b>主题</b>:<%=Title%></td>
				<td align="right">
				
 				已有<%=Chakan%>人次阅读此帖
				&nbsp; 
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<table class="a2" style="TABLE-LAYOUT: fixed" cellSpacing="1" cellPadding="5" width="97%" align="center" border="0" id="table3">
	<tr class="a3">
		<td vAlign="top" align="middle" width="156" height="100%">
		<table width="90%" border="0" id="table4">
			<tr>
				<%if Writer = "客人" then Response.Write  ke & "(客人)" else Response.Write Writer %>
				
				
				
				</b></font><br>
 </td>
				<td vAlign="top" align="right">

				</td>
			</tr>
		</table><%
		 set rs1 = server.CreateObject("ADODB.Recordset")  
         rs1.open "SELECT * FROM NOIP选手 WHERE id=" & WriterID ,conn ,3,1
         if rs1.EOF or rs1.BOF then
         %>
         <img src="image/head/1.gif" onload="javascript:if(this.width&gt;120)this.width=120;if(this.height&gt;120)this.height=120;">
		<br>
		<br>
		<img src="image/MemberCode.gif">
		<table width="90%" border="0" id="table5">
			<tr>
				<td><br>
			
				等&nbsp;&nbsp;级:客人<br>
				学&nbsp;&nbsp;分:0<br>
				发贴数:-<br>
         <%       
    
         else
         %>
		<img src="image/head/<%=rs1("头像")%>.gif" onload="javascript:if(this.width&gt;120)this.width=120;if(this.height&gt;120)this.height=120;">
		<br>
		<br>
		<img src="image/MemberCode.gif">
		<table width="90%" border="0" id="table5">
			<tr>
				<td><br>
			
				等&nbsp;&nbsp;级:<%=rs1("头衔")%><br>
				学&nbsp;&nbsp;分:<%=rs1("学分")%><br>
				发贴数:<%=rs1("文章数")%><br>
<%
 Email=rs1("电子邮件")
 end if
rs1.close
set rs1=nothing
 %> 
				</td>
			</tr>
		</table>
		</td>
		<td>
		<table height="97%" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table6">
			<tr>
				<td colSpan="2">
				<a class="CommonImageTextButton" title="查看<%=Writer%>的个人资料" style="background-image: url('image/ShowPost/contact.gif')" href="Profile.asp?User=<%=WriterID%>">
				信息</a>
				<a class="CommonImageTextButton" title="发送短讯息给<%=Writer%>" style="cursor: hand; background-image: url('image/ShowPost/message.gif')" onclick="javascript:window.open('SendMSG.asp?replay=<%=Writer%>&NOIPmsgtitle=关于您的文章《<%=Title%>》','a','menubar=no,toolbar=no,location=no,directories=no,height=280,width=500,status=no,scrollbars=no')">
				短讯</a>
				<a class="CommonImageTextButton" title="发送电邮给 <%=Writer%>" style="background-image: url('image/ShowPost/mail.gif')" href="Mailto:<%=Email%>">
				邮箱</a>
				<a class="CommonImageTextButton" title="回复帖子" style="background-image: url('image/ShowPost/NewPost.gif')" href="#huifu" onclick=javascript:document.forms("NEWreply").Subject.value="Re:<%=title%>">
				回复</a> </td>
				<td align="right">第 <font color="red"><b>0</b></font> 楼 </td>
			</tr>
			<tr vAlign="top">
				<td colSpan="3"><hr width="100%" color="#777777" SIZE="1"></td>
			</tr>
			<tr vAlign="top">
				<td style="WORD-BREAK: break-all" colSpan="3" height="100%"><b>
				<%=Title%></b><br>
				<br>
				<%=INNER%></td>
			</tr>
			<tr vAlign="top">
				<td align="right" colSpan="3"> </td>
			</tr>
			<tr vAlign="top">
				<td colSpan="3"><hr width="100%" color="#777777" SIZE="1"></td>
			</tr>
			<tr vAlign="top">
				<td>
				<%if editable then%>
				<a class="CommonImageTextButton" title="编辑帖子" style="background-image: url('image/ShowPost/edit.gif')" href="EditPost.asp?postid=<%=postid%>&class=<%=classnum%>">
				编辑</a>
				<%end if%>
				<%if delable then%>
				<a class="CommonImageTextButton" title="删除帖子" style="background-image: url('image/ShowPost/del.gif')" href="#" onclick="vbscript:if msgbox('您真的要删除这个帖子么?',vbyesno)=vbyes then self.location='EditPost.asp?postid=<%=postid%>&del=delit&class=<%=classnum%>'")">
				删除</a>
				<%end if%>
				
				</td>
				<td vAlign="bottom">
				<img src="image/ShowPost/Posttime.gif"> 
				发表时间:<%=DateTime%> </td>
				<td vAlign="bottom" align="right">
				<img src="image/ShowPost/ip.gif"> IP: 
				<%if NOIPUSERTIT="管理员" then %>
				<%=ip%>
				<%else%>
				<a href="#">
				已记录</a> 
				<% end if %>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<%

  set rs = server.CreateObject("ADODB.Recordset")  
  rs.open "SELECT * FROM 文章回复 Where 文章="&PostID ,conn ,3,1
''''''''''''''''''''''
  shownum=15  
totalrecord=rs.recordcount     
rs.pagesize=shownum
maxpage=rs.pagecount     
     if request.querystring("page")<> "" then requestpage=clng(request.querystring("page"))     
     
if requestpage="" or requestpage=0 then     
   requestpage=1     
end if     
    resquestpage=maxpage     
if resquestpage>maxpage then     
end if     
     
if not requestpage=1 then     
rs.move (requestpage-1)*rs.pagesize     
end if     


'''''''''''''''''''''''''''''''''''''''''''''''
for i=1 to rs.pagesize and not rs.bof
  INNER=rs("回复内容")
  WriterID=rs("回复人")
  Writer=id2name(WriterID)
  Title=rs("回复标题")
  DateTime=rs("日期")
  stair=rs("楼层")
  ke=rs("客人")
  ip=rs("ip")
   if NOIPUserTit="管理员" or NOIPUserID=WriterID and NOIPUserID>0 then editable=true else editable=false
   if NOIPUserTit="管理员" or NOIPUserTit="班长" or NOIPUserID=WriterID and NOIPUserID>0 then delable=true else delable=false

 





%>
<table class="a2" style="TABLE-LAYOUT: fixed" cellSpacing="1" cellPadding="5" width="97%" align="center" border="0" id="table3">
	<tr class="a3">
		<td vAlign="top" align="middle" width="156" height="100%">
		<table width="90%" border="0" id="table4">
			<tr>
				<td><font style="FONT-SIZE: 10pt"><b>
				
				 
				<%if Writer = "客人" then Response.Write  ke & "(客人)" else Response.Write Writer %>
				
				
				
				</b></font><br>
 </td>
				<td vAlign="top" align="right">

				</td>
			</tr>
		</table><%
		 set rs1 = server.CreateObject("ADODB.Recordset")  
         rs1.open "SELECT * FROM NOIP选手 WHERE id=" & WriterID ,conn ,3,1
         if rs1.EOF or rs1.BOF then
         %>
         <img src="image/head/1.gif" onload="javascript:if(this.width&gt;120)this.width=120;if(this.height&gt;120)this.height=120;">
		<br>
		<br>
		<img src="image/MemberCode.gif">
		<table width="90%" border="0" id="table5">
			<tr>
				<td><br>
			
				等&nbsp;&nbsp;级:客人<br>
				学&nbsp;&nbsp;分:0<br>
				发贴数:-<br>
         <%       
    
         else
         %>
		<img src="image/head/<%=rs1("头像")%>.gif" onload="javascript:if(this.width&gt;120)this.width=120;if(this.height&gt;120)this.height=120;">
		<br>
		<br>
		<img src="image/MemberCode.gif">
		<table width="90%" border="0" id="table5">
			<tr>
				<td><br>
			
				等&nbsp;&nbsp;级:<%=rs1("头衔")%><br>
				学&nbsp;&nbsp;分:<%=rs1("学分")%><br>
				发贴数:<%=rs1("文章数")%><br>
<%
 Email=rs1("电子邮件")
 end if
rs1.close
set rs1=nothing
 %> 
				</td>
			</tr>
		</table>
		</td>
		<td>
		<table height="97%" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table6">
			<tr>
				<td colSpan="2">
				<a class="CommonImageTextButton" title="查看<%=Writer%>的个人资料" style="background-image: url('image/ShowPost/contact.gif')" href="Profile.asp?User=<%=WriterID%>">
				信息</a>
				<a class="CommonImageTextButton" title="发送短讯息给<%=Writer%>" style="cursor: hand; background-image: url('image/ShowPost/message.gif')" onclick="javascript:window.open('SendMSG.asp?replay=<%=Writer%>&NOIPmsgtitle=关于您的文章《<%=Title%>》','a','menubar=no,toolbar=no,location=no,directories=no,height=280,width=500,status=no,scrollbars=no')">
				短讯</a>
				<a class="CommonImageTextButton" title="发送电邮给 <%=Writer%>" style="background-image: url('image/ShowPost/mail.gif')" href="Mailto:<%=Email%>">
				邮箱</a>
		

				<a class="CommonImageTextButton" title="回复帖子" style="background-image: url('image/ShowPost/NewPost.gif')" href="#huifu" onclick=javascript:document.forms("NEWreply").Subject.value="Re:<%=title%>">
				回复</a> </td>
				<td align="right">第 <font color="red"><b><%=stair%></b></font> 楼</td>
			</tr>
			<tr vAlign="top">
				<td colSpan="3"><hr width="100%" color="#777777" SIZE="1"></td>
			</tr>
			<tr vAlign="top">
				<td style="WORD-BREAK: break-all" colSpan="3" height="100%"><b>
				<%=Title%></b><br>
				<br>
				<%=INNER%></td>
			</tr>
			<tr vAlign="top">
				<td align="right" colSpan="3"> </td>
			</tr>
			<tr vAlign="top">
				<td colSpan="3"><hr width="100%" color="#777777" SIZE="1"></td>
			</tr>
			<tr vAlign="top">
				<td>
				<%if editable then%>
				<a class="CommonImageTextButton" title="编辑帖子" style="background-image: url('image/ShowPost/edit.gif')" href="EditPost.asp?replyid=<%=rs("id")%>&class=<%=classnum%>">
				编辑</a>
				<%end if%>				
				<%if delable then%>
				<a class="CommonImageTextButton" title="删除帖子" style="background-image: url('image/ShowPost/del.gif')" href="#" onclick="vbscript:if msgbox('您真的要删除这个帖子么?',vbyesno)=vbyes then self.location='EditPost.asp?replyid=<%=rs("id")%>&del=delreply&class=<%=classnum%>'")">
				删除</a>
				<%end if%>
				
				</td>
				<td vAlign="bottom">
				<img src="image/ShowPost/Posttime.gif"> 
				发表时间:<%=DateTime%> </td>
				<td vAlign="bottom" align="right">
				<img src="image/ShowPost/ip.gif"> IP: 
				<%if NOIPUSERTIT="管理员" then %>
				<%=ip%>
				<%else%>
				<a href="#">
				已记录</a> 
				<% end if %>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<%
	    rs.movenext    
if rs.eof then exit for    
next  
%><%valignbottom()%>
<p align="right">
<%
if rs.pagecount<>0 then

if requestpage-1 mod 10=0 then    
 p=(requestpage-1) \ 10    
else    
 p=(requestpage-1) \ 10    
end if    
if requestpage=1 then    
 response.write "<font face=webdings color=""#FF0000"">9</font>"    
else    
 Response.write "<a href=ShowPost.asp?PostID=" & PostID & "&page=1 title=首页><font face=webdings>9</font></a>"    
end if    
if p*10>0 then response.write "<a href=ShowPost.asp?PostID=" & PostID & "&page="& p*10 & " title=上十页><font face=webdings>7</font></a>"    
response.write "<b>"    
for ii=p*10+1 to P*10+10    
   if ii=requestpage then    
  response.write "<font color=""#FF0000"">"&ii&"</font> "    
 else    
  response.write "<a href=ShowPost.asp?PostID=" & PostID & "&page="&ii&">"&ii&"</a>   "    
 end if    
 if ii=maxpage then exit for    
next    
response.write "</b>"    
if ii<maxpage then response.write "<a href=ShowPost.asp?PostID=" & PostID & "&page="&ii&" title=下十页><font face=webdings>8</font></a>"    
if requestpage=maxpage then    
 response.write "<font face=webdings color=""#FF0000"">:</font>   "    
else    
 response.write "<a href=ShowPost.asp?PostID=" & PostID & "&page="&maxpage&" title=尾页><font face=webdings>:</font></a>"    
end if    
end if
response.write"    总共有"&maxpage&"页   共"&(totalrecord)&"条回复"   
  rs.close    
  set rs=nothing

end if%>
&nbsp;&nbsp;&nbsp;&nbsp;</p>
	<%valigntop()%>
<a name="huifu"></a>
<TABLE cellSpacing=1 cellPadding=6 width=97% border=0 class=a2 align=center id="table2">
<form method="POST" name="NEWreply" action="post.asp?NEWreply=1&POSTID=<%=postid%>">
<%if NOIPUserID = -1 then%>
<TR>

<TD class=a3 width="180"><B>昵称 </B> 

</TD>
<TD class=a3 height=13>
<INPUT maxLength=15 size=60 name=ke >   你可能还没有注册


</TD></TR>

<%end if%>
<TR>

<TD class=a3 width="180"><B>快速回复 </B> 

</TD>
<TD class=a3 height=13>
<INPUT maxLength=50 size=60 name=Subject value="Re:<%=title%>">

<%if UserPopedomPass=1 then %>
<SELECT name=color onchange="title_color(this.options[this.selectedIndex].value)">
<option value="">颜色</option>
<option style=background-color:Black;color:Black value=Black>黑色</option>
<option style=background-color:green;color:green value=green>绿色</option>
<option style=background-color:red;color:red value=red>红色</option>
<option style=background-color:blue;color:blue value=blue>蓝色</option>
<option style=background-color:Navy;color:Navy value=Navy>深蓝</option>
<option style=background-color:Teal;color:Teal value=Teal>青色</option>
<option style=background-color:Purple;color:Purple value=Purple>紫色</option>
<option style=background-color:Fuchsia;color:Fuchsia value=Fuchsia>紫红</option>
<option style=background-color:Gray;color:Gray value=Gray>灰色</option>
<option style=background-color:Olive;color:Olive value=Olive>橄榄</option>
</SELECT>
<%end if%>
</TD></TR>


<TR>
<TD vAlign=top class=a3>
<TABLE cellSpacing=0 cellPadding=0 align=Left border=0 width=100% height="100%" id="table2">

<TR>
<TD vAlign=top align=Left width=100% class=a3><BR><B>文章内容</B><BR>
(<a href="javascript:CheckLength();">查看内容长度</a>)<BR>
<BR><span id=UpFile></span>


</TD></TR>

<TR><TD valign="bottom">


<input name="content" type="hidden">

</TD></TR>

</TABLE></TD>

<TD class=a3 height=250>

<SCRIPT src="inc/Post.js"></SCRIPT>

</TD></TR>

<TR>
<TD align=middle class=a3 colSpan=2 height=27>
<INPUT type=button value=发表回复 name=EditSubmit onclick=javascript:fabiao()>&nbsp; <INPUT type=reset value=" 重 置 " id=reset1 name=reset1></TD></TR>
<%valignbottom()%>

</TABLE>
</FORM>
</td>

</table>

<SCRIPT language=vbscript>
'for each a in 
function fabiao()
setMode "EDIT"
document.forms("NEWreply").content.value=document.frames("HtmlEditor").document.body.innerHTML
document.forms("NEWreply").submit()
end function
'next


</SCRIPT>


<!-- #include file="foot.asp" -->

⌨️ 快捷键说明

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