📄 showpost.asp
字号:
<!-- #include file="Setup.asp" -->
<!-- #include file="wolib/function.asp" -->
<script language="JavaScript">
<!--
window.onload=fiximage;
function fiximage() {
var max=400;
imgs = document.getElementsByTagName('img');
for(i=0;i<imgs.length;i++) {
w=imgs.width;h=imgs.height;
if(w>max) { imgs.width=max;imgs.height=h/(w/max);}
}
}
-->
</script>
<%
ForumID=RequestInt("ForumID")
ThreadID=RequestInt("ThreadID")
if Request("ViewMode")<>"" then ResponseCookies "ViewMode",Request("ViewMode"),"9999"
if RequestCookies("ViewMode")="" then ResponseCookies "ViewMode",SiteConfig("ViewMode"),"9999"
ViewMode=RequestCookies("ViewMode")
HtmlTop
if Request("menu")="Next" then
sql="select top 1 * from [Wo_Threads] where ThreadID > "&ThreadID&" and ForumID="&ForumID&" and IsApproved=1 and IsDel=0 order by ThreadID"
elseif Request("menu")="Previous" then
sql="select top 1 * from [Wo_Threads] where ThreadID < "&ThreadID&" and ForumID="&ForumID&" and IsApproved=1 and IsDel=0 order by ThreadID Desc"
else
sql="select * from [Wo_Threads] where ThreadID="&ThreadID&""
end if
Rs.Open SQL,Conn,1
if Rs.eof or Rs.bof then error"<li>系统不存在该帖子的资料"
Topic=ReplaceText(Rs("Topic"),"<[^>]*>","")
Tags=Rs("Tags")
TotalReplies=Rs("TotalReplies")
TotalViews=Rs("TotalViews")
IsVote=Rs("IsVote")
IsGood=Rs("IsGood")
ThreadTop=Rs("ThreadTop")
IsLocked=Rs("IsLocked")
IsApproved=Rs("IsApproved")
IsDel=Rs("IsDel")
PostsTableName=Rs("PostsTableName")
Category=Rs("Category")
ThreadID=Rs("ThreadID")
ForumID=Rs("ForumID")
ThreadStatus=Rs("ThreadStatus")
UserName=Rs("PostAuthor")
lastname=Rs("lastname")
lasttime=Rs("lasttime")
Rs.close
if Conn.Execute("select UserAccountStatus from [Wo_Users] where UserName='"&UserName&"'")(0)=3 then error("该窝友所发帖子已被系统屏蔽!")
sql="select * from [Wo_Forums] where ForumID="&ForumID&""
Set Rs=Conn.Execute(sql)
ForumName=Rs("ForumName")
Moderated=Rs("Moderated")
ParentID=Rs("ParentID")
GroupID=Rs("GroupID")
ForumUrl=Rs("ForumUrl")
IsActive=Rs("IsActive")
Rs.Close
%>
<!-- #include file="Utility/ForumPermissions.asp" --><%
if ForumUrl<>"" then response.redirect ForumUrl
if IsActive=0 and PermissionManage=0 then error"<li>该版块已经关闭!"
if PermissionRead=0 then error"<li>您没有<a href=ShowForumPermissions.asp?ForumID="&ForumID&">权限</a>阅读帖子"
if IsDel=1 and PermissionManage=0 then error"<li>该主题在回收站中!"
if IsApproved=0 and PermissionManage=0 then error"<li>该主题正在审核中!"
Conn.execute("update [Wo_Threads] set TotalViews=TotalViews+1,LastViewedDate="&SqlNowString&" where ThreadID="&ThreadID&"")
%>
<script type="text/javascript" src="Utility/PopupMenu.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<title><%=Topic%> - <%=SiteConfig("SiteName")%> </title>
<table width="900" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div id="CommonBreadCrumbArea">
<div style="float:left"><%ClubTree%> → <%ForumTree(ParentID)%><%=ForumTreeList%><a href="ShowForum.asp?ForumID=<%=ForumID%>"><%=ForumName%></a> → <a href="?ThreadID=<%=ThreadID%>"><%=Topic%></a></div>
<div style="float:right">
</div>
</div>
</td>
</tr>
</table>
<table width="80%" height="8" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<%
'''''''投票''''''''
if IsVote=1 then
%>
<table width="99%" cellpadding="0" cellspacing="1" id="CommonListArea">
<tr id="CommonListTitle3">
<td width="40%" align="center">选项</td>
<td width="10%" align="center">票数</td>
<td width="50%" align="center" colspan="2">百分比</td>
</tr>
<form action="PostVote.asp?ThreadID=<%=ThreadID%>" method="Post">
<%
sql="select * from [Wo_Votes] where ThreadID="&ThreadID&""
Set Rs=Conn.Execute(sql)
if Rs("IsMultiplePoll")=1 then
multiplicity="checkbox"
else
multiplicity="radio"
end if
allticket=0
Result=split(Rs("Result"),"|")
for i = 0 to ubound(Result)
if not Result(i)="" then allticket=Result(i)+allticket
next
Vote=split(Rs("Items"),"|")
for i = 0 to ubound(Vote)
if not Vote(i)="" then
if allticket=0 then
Voteresult=0
Votepercent=0
else
Voteresult=result(i)/allticket*100
Votepercent=formatnumber(result(i)/allticket*100)
if Votepercent=0 then Votepercent="0.00"
end if
%>
<tr id="CommonListCell">
<td width="40%">
<input type="<%=multiplicity%>" value="<%=i%>" name="PostVote" id="PostVote<%=i%>"><label for="PostVote<%=i%>"><%=Vote(i)%></label></td>
<td width="10%" align="center"><%=Result(i)%></td>
<td width="40%">
<div class="percent">
<div style="width:<%=Voteresult%>%">
</div>
</div>
</td>
<td width="10%" align="center"><%=Votepercent%>%</td>
</tr>
<%
end if
next
%>
<tr id="CommonListCell">
<td align="center"><%
if PermissionVote=0 then
response.write "您没有权限投票"
elseif instr("|"&Rs("BallotUserList")&"|","|"&CookieUserName&"|")>0 then
response.write "您已经投过票了"
elseif instr("|"&Rs("BallotIPList")&"|","|"&Request.ServerVariables("REMOTE_ADDR")&"|")>0 then
response.write "此IP已经投过票了"
elseif Rs("Expiry")< now() then
response.write "投票已过期"
else
response.write "<INPUT type=submit value='投 票'>"
end if
%> </td>
<td align="center">总票数:<%=allticket%></td>
<td colspan="2" align="center">截止投票时间:<%=Rs("Expiry")%></td>
</tr>
</form>
</table>
<%
Rs.Close
end if
'''''''投票 END''''''''
TotalCount=TotalReplies+1
PageSetup=SiteConfig("PostsPerPage") '设定每页的显示数量
TotalPage=Abs(Int(TotalCount/PageSetup*(-1))) '总页数
PageCount = RequestInt("PageIndex") '获取当前页
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if Request("SortOrder")="1" then
SqlSortOrder="Desc"
else
SqlSortOrder=""
end if
sql="select * from [Wo_Posts"&PostsTableName&"] where ThreadID="&ThreadID&" order by PostID "&SqlSortOrder&""
if PageCount<11 then
Set Rs=Conn.Execute(sql)
else
rs.Open sql,Conn,1
end if
If Rs.Eof then Conn.execute("Delete from [Wo_Threads] where ThreadID="&ThreadID&"")
if TotalPage>1 then RS.Move (PageCount-1) * pagesetup
i=0
Do While Not Rs.EOF and i<PageSetup
if i=0 then PostID=Rs("PostID")
i=i+1
if ViewMode=0 then
ShowPostSimple
else
ShowPost
end if
Rs.MoveNext
loop
Rs.Close
act=topic
%>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><%ShowPage()%></td>
<td align="right"><a href="#">返回页首↑</a> </td>
</tr>
</table>
<%if IsLocked=0 and PermissionReply=1 then%>
<a name="QuickReply"></a>
<form name="form" method="POST" action="AddPost.asp" onsubmit="return CheckForm(this);">
<input type="hidden" value="<%=ThreadID%>" name="ThreadID">
<input type="hidden" value="<%=PostID%>" name="PostID">
<input name="Body" type="hidden">
<table width="99%" cellpadding="0" cellspacing="1" id="CommonListArea">
<tr id="CommonListTitle3">
<td colspan="2"> <b>快速回复</b></td>
</tr>
<tr id="CommonListCell">
<td valign="top" height="50%" width="180">
<br>
<b>文章内容</b><br>
(<a href="javascript:CheckLength();">查看内容长度</a>)<br>
<br>
<input id="DisableYBBCode" name="DisableYBBCode" type="checkbox" value="1"><label for="DisableYBBCode">
禁用YBB代码</label>
</td>
<td height="200">
<SCRIPT type="text/javascript" src="Editor/Post.js"></SCRIPT>
</td>
</tr>
<tr id="CommonListCell">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -