📄 showarticle.asp
字号:
<% if session("user")="" then
response.redirect "../err.asp"
end if%>
<!--#include file="connbbs.asp"-->
<!--#include file="../const.asp"-->
<!--#include file="process.asp"-->
<%
if request("bbsid")="" then
err=true
Errmsg=Errmsg+"<br>"+"<li>请指定论坛版面。"
elseif not isnumeric(request("bbsid")) then
err=true
Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"
else
bbsid=request("bbsid")
end if
if request("articleid")="" then
err=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isnumeric(request("articleid")) then
err=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
articleid=request("articleid")
end if%>
<!--#include file="code.asp"-->
<!--#include file="top.asp"-->
<%if err<>true then
set rs=server.createobject("ADODB.recordset")
sql="select * from bbslist where id="&trim(bbsid)&" order by id desc"
rs.open sql,conn,1,1
if not rs.bof and not rs.eof then
bbsname=rs("bbsname")
lock=rs("lock")
bbsadmin=rs("bbsadmin")
bbsimage=rs("bbsimage")
allowhtml=rs("allowhtml")
strflash=rs("strflash")
stricons=rs("stricons")
strIMGInPosts=rs("strIMGInPosts")
end if
rs.close%>
<table width=100% border=0 bgcolor=#ffffff class=bk cellspacing="0" cellpadding="0">
<tr><td align=left valign=middle class=xy width=300 bgcolor="#C4D0DF"> <img src="../image/jiao.gif"><a href="../main.asp">班级首页</a>>><a href="index.asp">班级论坛</a>><a href="main.asp?bbsid=<%=trim(request("bbsid"))%>"><%=bbsname%></a></td><td bgcolor="#C4D0DF" class=x> 管理员列表:<%if trim(bbsadmin)="" then%>
<font color="#FFCC00">就等你来当啊</font>
<%else
addminstr=bbsadmin
if instr(bbsadmin,"|"&session("user")&"|")>0 then
admin=true
end if
addminstr=right(addminstr,len(addminstr)-1)
do while instr(addminstr,"|")>0
bbsadmin=left(addminstr,instr(addminstr,"|")-1)
addminstr=right(addminstr,len(addminstr)-instr(addminstr,"|"))
response.write "  <a href='../userinfo.asp?user="&bbsadmin&"'>"&bbsadmin&"</a>  "
Loop
end if%></td></tr>
<tr height=30><td class=y>  <a href="newarticle.asp?bbsid=<%=request("bbsid")%>"><img src="image/postnew.gif" border=0></a> <img src="image/votenew.gif" border=0"> <a href="main.asp?bbsid=<%=request("bbsid")%>&best=1"><img src="image/jinghua1.gif" border=0></a></td><form action="main.asp" method="post"><td width="*" nowrap align="right"><input type=hidden name="forum_id" value="1"><select name="sdt"><option value="all" selected>查看所有的主题<option value="1">查看一天内的主题<option value="2">查看两天内的主题<option value="7">查看一星期内的主题<option value="15">查看半个月内的主题<option value="30">查看一个月内的主题<option value="60">查看两个月内的主题<option value="180">查看半年内的主题</select><input type="image" border="0" name="imageField" src="image/go.gif"></td></form></tr>
</table>
<%
Set rs1= Server.CreateObject("ADODB.Recordset")
if request("bbsid")="" then
response.write "请选择论坛分类"
else
sql1="select * from user,bbs where bbs.bbsid="&request("bbsid")&" and bbs.rootid="&request("articleid")&"and bbs.user=user.user order by bbs.id"
end if
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,1,3
if not rs1.eof then
totalcount=rs1.recordcount+1
maxpage=10
page=request("page")
if page="" or page<1 then
page=1
end if
if (totalcount mod maxpage)=0 then
pagecount=totalcount\maxpage
else
pagecount=totalcount\maxpage+1
end if
if page>pagecount then
page=pagecount
end if
end if
set rs2=server.createobject("ADODB.recordset")
sql2="select * from bbs,user where bbs.id="&trim(articleid)&"and bbs.bbsid="&trim(bbsid)&"and bbs.user=user.user order by bbs.id desc"
rs2.open sql2,conn,1,1
if not rs2.bof or not rs2.eof then
conn.execute "update bbs set hits=hits+1 where id="&articleid
%>
<%if rs2("sex")=cstr(lock) then%>
<table width=100% cellpadding="0" cellspacing="0" border="0" bgcolor=#ffffff class=xzy height=300><tr bgcolor=#ffffff><td align=center>对不起,你无权查看该贴子!请返回.</td></tr></table>
<%else%>
<% if page="" or page="1" then%>
<table width=100% cellpadding="0" cellspacing="0" border="0" bgcolor=#ffffff class=xzy>
<tr bgcolor=#7C96B8 align=center>
<td width=* class=x colspan=2 align=left width=100%> 贴子主题:<%=rs2("title")%>  <a href="reply.asp?bbsid=<%=bbsid%>&articleid=<%=articleid%>"><img src=image/reply.gif border=0></a>  <%if rs2("locktitle")=1 then%><font color=#ffffff>该贴已被锁定</font><%end if%></td></tr>
<tr width=100% bgcolor=#C4D0DF><td width=20% class=y valign=top><table width="100%" border="0" cellspacing="0" cellpadding="2" style="filter:glow(color=#798AB7,strength=2)"><tr><td>    <%=rs2("user")%></td></tr></table><br>
  <img src="../<%=rs2("userimage")%>"><br>  经验值:<%=rs2("usermoney")%><br>
  登陆次数:<%=rs2("logincount")%></td><td width=80%><br>  <a href="../userinfo.asp?user=<%=rs2("user")%>" target="_blank"><img src=image/userinfo.gif border=0></a> <a href="javascript:popwin3('email.asp?user=<%=rs2("user")%>')"><img src=image/email.gif border=0></a> <img src=image/oicq.gif alt="此网友的oicq为:<%=rs2("qq")%>"> <img src=image/replyyn.gif> <a href="reply.asp?bbsid=<%=bbsid%>&articleid=<%=articleid%>"><img src=image/replynow.gif border=0></a><br><hr width=98%><table width=98%><tr><td><%=ubbcode(rs2("contents"))%></td></tr></table>
<br><hr width=98%>
<table width=98%><tr><td colspan=2>
<% if rs2("signflag")=1 and rs2("addinfo")<>"" then
response.write ""&ubbcode(rs2("addinfo"))&""
else
response.write "---------------------------------"
end if%><br></td></tr><tr><td>  <% if session("user")=rs2("user") or admin=true then%><a href="edit.asp?bbsid=<%=bbsid%>&articleid=<%=articleid%>" target="_blank"><img src=image/edit.gif border=0></a>  <%end if%>    </td><td>发表时间:<%=formatdatetime(rs2("lasttime"),vblongdate)%></td></tr></table></td></tr>
</table><% end if%>
<%if not rs1.bof and not rs1.eof then
if Page=1 then
rs1.movefirst
showContent
showpage totalcount,maxpage,"showarticle.asp"
elseif (page-1)*maxpage<totalcount then
rs1.move (page-1)*maxpage-1
showContent
showpage totalcount,maxpage,"showarticle.asp"
else
page=1
showContent
showpage totalcount,maxpage,"showarticle.asp"
end if
rs1.close
set rs1=nothing
sub showContent
dim i
if page="" or page=1 then
i=1
else
i=0
end if
%>
<%do while not rs1.eof
%>
<table width=100% cellpadding=0 cellspacing=0 border="0" bgcolor=#ffffff class=xzy>
<% if (i mod 2)=0 then
response.write "<tr bgcolor=#C4D0DF>"
else
response.write "<tr bgcolor=#ffffff>"
end if%>
<td width=20% class=y valign=top><table width="100%" border="0" cellspacing="0" cellpadding="2" style="filter:glow(color=#798AB7,strength=2)"><tr><td>    <%=rs1("user")%></td></tr></table><br>
  <img src="../<%=rs1("userimage")%>"><br>  经验值:<%=rs1("usermoney")%><br>
  登陆次数:<%=rs1("logincount")%></td><td width=80%><br>  <a href="../userinfo.asp?user=<%=rs1("user")%>"><img src=image/userinfo.gif border=0></a> <a href="javascript:popwin3('email.asp?user=<%=rs1("user")%>')"><img src=image/email.gif border=0></a> <img src=image/oicq.gif alt="此网友的oicq为:<%=rs1("qq")%>"> <img src=image/replyyn.gif> <a href="reply.asp?bbsid=<%=bbsid%>&articleid=<%=articleid%>"><img src=image/replynow.gif border=0></a><br><hr width=98%><table width=98%><tr><td><%=ubbcode(rs1("contents"))%></td></tr></table>
<br><hr width=98%>
<table width=98%><tr><td colspan=2>
<% if rs1("signflag")=1 and rs1("addinfo")<>"" then
response.write ""&ubbcode(rs1("addinfo"))&""
else
response.write "---------------------------------"
end if%><br></td></tr><tr><td>  <% if session("user")=rs1("user") or admin=true then%><img src=image/edit.gif>  <a href="javascript:openwin('del.asp?articleid=<%=rs1("id")%>&bbsid=<%=bbsid%>',300,200)"><img src=image/del.gif border=0></a><%end if%>    </td><td>发表时间:<%=formatdatetime(rs1("lasttime"),vblongdate)%></td></tr></table></td></tr>
</tr>
<%
i=i+1
if i>=maxpage then exit do
rs1.movenext
loop
%></table>
<% end sub%>
<%else%>
 
<% end if%>
<%
function showpage(totalcount,maxpage,filename)
dim n
if totalcount mod maxpage=0 then
n= totalcount \ maxpage
else
n= totalcount \ maxpage+1
end if
response.write "<table class=xzy width=100%' bgcolor=#fffff><form method=Post action="&filename&"?bbsid="&request("bbsid")&"&articleid="&articleid&"><tr><td>"
response.write "<p align='right'> "
if Page<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&bbsid="&request("bbsid")&"&"&"articleid="&articleid&">首页</a> "
response.write "<a href="&filename&"?page="&Page-1&"&bbsid="&request("bbsid")&"&"&"articleid="&articleid&">上一页</a> "
end if
if n-page<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(Page+1)&"&bbsid="&request("bbsid")&"&"&"articleid="&articleid&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&bbsid="&request("bbsid")&"&"&"articleid="&articleid&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&Page&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalcount&"</b> 条记录<b> "&maxpage&"</b>条记录/页</font> "
response.write " <font color='#000080'>转到:</font><input type='text' name='page' value="&page&" size='2' class=buttonface>"
response.write "</td><td valign=bottom><input type='image' src='../image/alumni_search.gif'></td></form></tr></table>"
end function
end if
%>
<%else%>
<table width=100% cellpadding="0" cellspacing="0" border="0" bgcolor=#ffffff class=bk height=300><tr bgcolor=#ffffff><td align=center>对不起,找不到该贴子!请返回.</td></tr></table>
<%end if
end if
conn.close
set conn=nothing
%>
<!--#include file="../end.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -