📄 topic.asp
字号:
<a href="deltopic.asp?topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=Forum_title%>"><img src="images/del.gif" alt="删除主题" border=0>删除</a>
<a href="post.asp?forum_id=<%=forum_id%>&method=reply&type=quotetopic&forum_title=<%=server.URLEncode(forum_title)%>&topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&M=<%=Request.QueryString("M")%>"><img src="images/quote.gif" alt='引用回复' border=0>引用</a>
<%
Response.Write "<hr noshade size=1 class='sft'><br><br>" & ubb2html(formatStr(rs("T_Message")), true, true)
if rs("T_VoteTime")>0 then
user_array = split(rs("T_VoteUser"), "|")
i = 0
vote=true
do until i>ubound(user_array)
if user_array(i)= Request.Cookies("User")("Name") then vote=false
i = i+1
loop
voteitem_array = split(rs("T_VoteItem"), "|")
if vote=false then
%><br><br><table align=center bgcolor=<%=CellColor2%> border="0" width="100%" cellspacing="5" cellpadding="3" class="sft">
<%
votenum_array = split(rs("T_VoteNumber"), "|")
i=0
do until i>ubound(voteitem_array)
Response.Write "<tr><td bgcolor=" &CellColor2 &">"
Response.Write voteitem_array(i) & "(" & votenum_array(i) & "票)</td></tr>"
i=i+1
loop
Response.Write "<tr><td>*您已投过票或尚未登录</td></tr>"
Response.Write "</td></tr></table>"
else
Response.Write "<form action='topic.asp?vote=yes&forum_id=" & forum_id & "&forum_title=" & forum_title & "&topic_id=" & topic_id & "&topic_title=" & topic_title & "' method='post' name='PostVote'>"
i=0
%><table align=center bgcolor=<%=CellColor2%> border="0" width="100%" cellspacing="1" cellpadding="3" class="sft">
<%do until i>ubound(voteitem_array)
Response.Write "<tr><td><input name='voteid' type='radio' value='" & i & "'>" & voteitem_array(i) &"</td></tr>"
i=i+1
loop%>
<tr><td>*请选择一个项目,然后点击投票按钮</td></tr><tr><td><input name='Submit' type='submit' value='投 票' class="btn"></td></tr>
<input name="read" type="hidden" value="<%=Request.QueryString("read") %>">
<%Response.Write "</td></tr></table></form>"
end if
end if
Response.Write "<br><br>____________________<br>"
Response.Write ubb2html(formatStr(rs("T_Sig")),false,false)
Response.Write "<br><p align=right>第1篇</p></td></tr>"
End If
set rs = nothing
End Sub
%>
<!--#INCLUDE FILE="top.asp" -->
<%
Function ChkAdmin(strName, StrPasswd)
strSql ="SELECT Member_id, M_Name, M_Password from Members where M_Name = '" & strName & "' and M_Password = '" & StrPasswd &"'"
set rs_chk = my_conn.Execute (StrSql)
if rs_chk.BOF or rs_chk.EOF then
ChkAdmin = 0
else
strsql = "SELECT Admin.Admin_Name, Admin.Forum_ID from Admin"
set rsAdmin = my_conn.Execute (strsql)
if not(rsAdmin.eof or rsAdmin.bof) then
do until rsAdmin.eof
if rsAdmin("Admin_Name")=strName then ChkAdmin=1
rsAdmin.movenext
loop
end if
end if
strsql = "select SFAdmin_Name, SFAdmin_Password from SFAdmin"
set rs_chk = my_conn.Execute (strSQL)
if strName=rs_chk("SFAdmin_Name") and strpasswd=rs_chk("SFAdmin_Password") then ChkAdmin =1
rs_chk.close
set rs_chk = nothing
set rsAdmin = nothing
End Function
strsql = "select F_AdminOnly from forum where Forum_ID = " & Request.QueryString("forum_id")
set rs = my_conn.Execute (strsql)
if rs("F_AdminOnly") then
if cint(ChkAdmin(Request.Cookies("User")("Name"), Request.Cookies("User")("Pword"))) <> 1 then
%>
<table align="center" bgcolor=<%=TableColor%> border="0" width=500 cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=HeadColor%> align="center" class="sfh">抱歉,您无权进入本版块</td></tr>
<tr><td bgcolor=<%=CellColor1%> align="center"><br>只有版主和管理员才可以有权进入本版块!<br>如果您是版主或管理员,请<a href="login.asp">登录论坛</a>后再进入本版块</td></tr>
</table>
<%
Response.End
end if
end if
%>
<table border=0 width=<%=TableWidth%> align=center class="sft">
<tr><td align=left>
<a href="index.asp">论坛首页</a> >
<a href="forum.asp?forum_id=<%=Forum_id%>&forum_title=<%=server.Urlencode(forum_title)%>"><%=forum_title%></a> > <%=topic_title%></td></tr>
<tr><td align=right>
<%
strsql= "select t_status from topics where topic_id = " & topic_id
set rs = my_conn.Execute (strsql)
if rs("t_status") then %>
<a href="post.asp?forum_id=<%=forum_id%>&method=Topic&forum_title=<%=server.Urlencode(forum_title)%>" title="发布一个新的主题"><img src="images/newthread.gif" border=0></img></a>
<a href="post.asp?forum_id=<%=forum_id%>&method=Topic&type=vote&forum_title=<%=server.Urlencode(forum_title)%>" title="发布一个新的投票项目"><img src="images/newvote.gif" border=0></img></a>
<a href="post.asp?forum_id=<%=forum_id%>&method=reply&forum_title=<%=server.URLEncode(forum_title)%>&topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&M=<%=Request.QueryString("M")%>" title="回复当前主题"><img src="images\newreply.gif" border=0></img></a>
<%
Else
Response.Write "主题已被关闭"
End if
%>
</td></tr></table>
<table align=center bgcolor=<%=TableColor%> border="0" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft" style='TABLE-LAYOUT: fixed'>
<tr><td align="center" bgcolor="<%=HeadColor%>" class="sfh" width="150">作者<br><img width=150 height=1 border=0></td>
<td bgcolor="<% =HeadColor %>" class="sfh"> <%=Topic_title%></td></tr>
<%
if Request.QueryString("read")="yes" then
strSql = "select T_Read From topics where topic_id = " & topic_id
set rs = my_conn.Execute (strSql)
strSql = "update topics set t_read = "& rs("T_Read")+1 & " where topic_id = " & topic_id
my_conn.Execute (strSql)
end if
TotalPages = 1
if page = 1 then Call GetFirst
strSql ="SELECT Members.M_Name, Members.M_Country, Members.M_Email, Members.M_Homepage, Members.M_Face, Members.M_OtherFace, Members.M_OtherFace_Width, Members.M_OtherFace_Height, Members.M_Title, Members.M_Posts, Members.M_Sig, Members.M_ICQ, Members.M_Msn,Reply.Reply_ID, Reply.R_Sig, Reply.R_Posted_By, Reply.Topic_ID, Reply.R_Message, Reply.R_Posted "
strSql = strSQl & "FROM Members INNER JOIN Reply ON Members.Member_id = Reply.R_Posted_By "
strSql = strSQl & "where topic_id = " & topic_id & " order by reply.R_Posted"
set rs = Server.CreateObject("ADODB.Recordset")
rs.cachesize=15
rs.open strSQL, my_conn, 3
c = 0
RowCount= 1
If rs.Eof or rs.Bof then
Response.Write ""
Else
rs.movefirst
rs.PageSize = TopicRow
PageSize = rs.PageSize
TotalPages=rs.PageCount
if page>TotalPages then page=TotalPages
rs.AbsolutePage=page
'if page=1 then RowCount= 1
do until rs.Eof or RowCount > PageSize
if c = 0 then
CColor = CellColor2
else
CColor = CellColor1
End if
Response.Write "<tr>"
Response.Write "<td bgcolor='" & CColor & "' valign=top><table border=0 width=100% cellspacing=0 cellpadding=3 class=sft style='filter:glow(color=" & HeadColor & ",strength=1)'><tr><td>" & rs("M_name") & "</td></tr></table>"&"头衔:"
if rs("M_Title")="/" then
Response.Write CreateTitle(rs("M_Posts"))
else
Response.Write rs("M_Title")
end if
Response.Write "<br>来自:"&rs("M_Country")&"<br>发帖:"&rs("M_Posts")&"<br><img src='"
if RTrim(rs("M_OtherFace"))<>"" then
Response.Write rs("M_OtherFace") & "' width='" & rs("M_OtherFace_Width") &"' height='" & rs("M_OtherFace_Height")
else
Response.Write rs("M_Face")
end if
Response.Write "'></img></td>"
Response.Write "<td bgcolor='" & CColor & "' valign='top'>发表于: " & rs("R_Posted")
Response.Write " <a href=""Javascript:openWindow('viewuser.asp?name=" & rs("m_name") & "')""><img src='images/profile.gif' alt='查看作者档案' border=0>资料</a>"
Response.Write " <a href='mailto:" & rs("M_Email") & "'><img src='images/email.gif' alt='给作者发电子邮件' border=0>邮件</a>"
Response.Write " <a href=""Javascript:openWindow('" & rs("m_homepage") & "')""><img src='images/homepage.gif' alt='访问作者主页' border=0>主页</a>"
%> <a href="Javascript:openWindow('viewip.asp?reply_id=<%=Rs("reply_id")%>')"><img src="images/ip.gif" alt='查看IP地址' border=0>IP</a><%
if rs("M_ICQ") <> "0" then
%> <a href="Javascript:openWindow('http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs("M_ICQ")%>')"><img src="images/qq.gif" alt="QQ号码:<%=rs("M_ICQ")%>" border=0>QQ</a><%
end if
if rs("M_MSN") <> "0" then
%> <img src="images/msn.gif" border=0 alt="MSN号码:<%=rs("M_Msn")%>">MSN</a><%
end if
Response.Write " <a href='post.asp?method=edit&reply_id=" & Rs("Reply_ID") & "&auth=" & server.URLEncode(rs("R_posted_by")) & "&forum_title=" & server.URLEncode(Request.QueryString("forum_title")) & "&topic_title=" & server.Urlencode(topic_title) & "&forum_id=" & forum_id & "&topic_id=" & topic_id &"'><img src='images/edit.gif' alt='编辑修改' border=0>编辑</a>"
%>
<a href="delreply.asp?reply_id=<%=Rs("reply_id")%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=Forum_title%>"><img src="images/del.gif" alt="删除回复" border=0>删除</a>
<a href="post.asp?forum_id=<%=forum_id%>&reply_id=<%=Rs("reply_id")%>&method=reply&type=quotereply&forum_title=<%=server.URLEncode(forum_title)%>&topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&M=<%=Request.QueryString("M")%>"><img src="images/quote.gif" alt="引用回复" border=0>引用</a>
<%Response.Write "<hr noshade size=1 class='sft'><br><br>" & ubb2html(formatStr(rs("R_Message")), true, true)
Response.Write"<br><br>____________________<br>"
Response.Write ubb2html(formatStr(rs("R_Sig")),false,false)
Response.Write "<br><p align=right>第"&((page-1)*TopicRow+RowCount+1)&"篇</p></td></tr>"
rs.MoveNext
c = c + 1
if c >= 2 then c = 0
RowCount = RowCount +1
loop
End If
%></table>
<br>
<table align="center" border="0" width=<%=TableWidth%> cellspacing="0" cellpadding="0" class="sft">
<tr><td align="left" width="50%">
<SCRIPT LANGUAGE="JavaScript">
function goforum(strgoforum) {
location.replace('forum.asp?'+strgoforum)
}
</SCRIPT><select onChange=goforum(this.options[this.selectedIndex].value) name=forumid class="box">
<option value="" selected>论坛快捷跳转</option>
<%
StrSql = "SELECT Forum_ID, F_Name from forum"
set rs = my_conn.Execute(strsql)
if rs.EOF or rs.BOF then
Response.Write "错误!无任何论坛!"
Else
do until rs.EOF
Response.Write "<option value='forum_id=" & rs("Forum_ID") & "&forum_title=" & rs("F_Name") &"'>" & "→" &rs("F_Name") & "</option>"
rs.MoveNext
loop
Response.Write "</select>"
End If
%>
</select>
</td><td width="50%">
<%
Response.Write "共" & TotalPages & "页<b>"
beginpage=1
endpage=Totalpages
if TotalPages>=5 then
if page>=3 then
beginpage=page-2
if page<=(TotalPages-2) then
endpage=page+2
else
endpage=TotalPages
beginpage=TotalPages-4
end if
else
beginpage=1
endpage=5
end if
end if
if beginpage>1 then response.write " <a href='topic.asp?page=1&forum_id="&forum_id&"&forum_title="&forum_title&"&topic_id="&topic_id&"&topic_title="&topic_title&"'><<</a>"
for i=beginpage to endpage
if i=page then
response.write " <font color=#cc0066>"&i&"</font>"
else
response.write " <a href='topic.asp?page="&i&"&forum_id="&forum_id&"&forum_title="&forum_title&"&topic_id="&topic_id&"&topic_title="&topic_title&"' title='第" & i &"页'>"&i&"</a>"
end if
next
if endpage<TotalPages then response.write " <a href='topic.asp?page="&TotalPages&"&forum_id="&forum_id&"&forum_title="&forum_title&"&topic_id="&topic_id&"&topic_title="&topic_title&"'>>></a>"
%>
</b></td></tr></table>
<%
strmethod_type = "reply"
%>
<!--#INCLUDE FILE="quickpost.asp" -->
<br>
<table border=0 width=<%=TableWidth%> align=center class="sft"><tr><td align="right">
主题管理: <a href="closetopic.asp?topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=forum_title%>">关闭/取消</a>
| <a href="deltopic.asp?topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=forum_title%>">删除</a>
| <a href="copytopic.asp?topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=forum_title%>">复制</a>
| <a href="copytopic.asp?type=move&topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=forum_title%>">移动</a>
| <a href="toptopic.asp?topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=forum_title%>">置顶/取消</a>
| <a href="goodtopic.asp?topic_id=<%=topic_id%>&topic_title=<%=server.URLEncode(topic_title)%>&forum_id=<%=Forum_id%>&forum_title=<%=forum_title%>">精华/取消</a>
</td></tr></table>
<!--#INCLUDE FILE="copyright.asp" -->
</body></html>
<!--#INCLUDE FILE="online.asp" -->
<%
my_conn.Close
set my_conn = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -