www.gusucode.com > CC校友录贴吧 CCBar源码程序asp编程 > forum/forum_show.asp

    <%
'===================================================================
'= ASP FILENAME	: /forum/forum_show.asp
'= CREATED TIME : 2006-5-4
'= LAST MODIFIED: 2006-5-4
'= VERSION INFO : CCASP Framework Ver 2.0.1 ALL RIGHTS RESERVED BY www.cclinux.com
'= DESCRIPTION  : 浏览帖子
'= Change Log:
'===================================================================
%>

<!-- #include file = "../inc/customer/include_customer_action_view.asp" -->
<!-- #include file = "../inc/inc_ubb.asp" -->
<!-- #include file = "./class_html_form.asp" -->
<!-- #include file = "../main_func.asp" -->
<!-- #include file = "./forum_func.asp" -->
<!-- #include file = "./forum_inc.asp" -->
<!-- #include file = "./forum_reply_inc.asp" -->
<%
'========================================================
'==   Action参数设置
'========================================================
'== 页面名
Const CONST_PAGE_FILE	= "forum/forum_show.asp"

'== 页面标题/功能
Const CONST_PAGE_TITLE	= "浏览帖子"

'== 功能函数名字空间
Const CONST_ACTION_FUNC	= "ShowForumContentCtl"

'== 相对根目录路径 
GBL_strHomeURL			= "../"

'== 页面构造
Call ActionBuild()

'== 在模板中引用的标签变量
Dim TAG_strVerifyCode	'== 表单校验
Dim TAG_objDicUnit		'== 单列记录

'== 请求校验与过滤
Call ActionFilter(CONST_PAGE_FILE,CONST_ACTION_FUNC)

'== 页面析构
Call ActionOver()
%>

<%
'===================================================================
'= Function    : LoadPageTpl()
'= Time		   : Created At 2006-5-4
'= Description : 加载页面模块
'===================================================================
Function LoadPageTpl()
%>
	<!-- #include file = "../template_c/page_forum_cate_list.html.asp" --> 
<%
End Function

'===================================================================
'= Function    : ShowForumContentCtl()
'= Time		   : Created At 2006-5-4
'= Input       :
'= Description : 浏览帖子
'===================================================================
Function ShowForumContentCtl()

	Dim i
	Dim clsTable			'== the object of table
	Dim strHtmlCode,strTmp,strNowTitle,strTitle,strInTitle,intStatus,intSubject,strStatus,strAfterTitle
	Dim GetRSId,ForumId,intForbid

	If Not ServerDataCheck(arrForumContentDataChk) Then
		Exit Function
	End If

	'== 取得表单值
	GetRSId = Trim(Request.QueryString("TopicsId"))
	ForumId = Trim(Request.QueryString("ForumId"))

	'== 贴吧导航条
	Call ShowForumMenu()

	'== 是否是版主才能访问的贴吧栏目
	Call CheckMasterForum(ForumId)

	'== 更新点击数
	Call RecordCounter("CLASS_TOPICS","TOPICS_HITS",1," AND TOPICS_ID=" & GetRSId)

	'== get this topic content
	GBL_objPubDB.Clear()
	GBL_objPubDB.SQLType = "SELECT"
	GBL_objPubDB.AllSQL = "SELECT T.TOPICS_ID,T.TOPICS_TITLE,T.TOPICS_FACE,T.TOPICS_SUBJECT,T.TOPICS_GOOD,T.TOPICS_REPLY_FORBID,T.TOPICS_HITS,T.TOPICS_OWNER_ID,T.TOPICS_REPLIES,T.TOPICS_CONTENT,T.TOPICS_DATE,T.TOPICS_STATUS,U.USER_INFO,U.USER_REALNAME,U.USER_ID,U.USER_INFO,U.USER_QQ,U.USER_LAST_TIME,U.USER_NOW_FACE,U.USER_LEVEL,U.USER_FACE_SELECT,U.USER_AUTHEN,U.USER_CLASS,U.USER_ACCOUNT FROM CLASS_TOPICS T,CLASS_USER U WHERE U.USER_ID=T.TOPICS_OWNER_ID AND T.TOPICS_ID=" & GetRSId
	If Not GBL_objPubDB.SQLRSExecute() Then
		Exit Function
	End If

	If Not ResultExecute(GBL_objPubDB.intRSNum,"该贴吧主题","ES_DB_NO") Then

		intForbid = GBL_objPubDB.objPubRS("TOPICS_REPLY_FORBID")
		strTitle = GBL_objPubDB.objPubRS("TOPICS_TITLE")
		strInTitle = GBL_objPubDB.objPubRS("TOPICS_TITLE")
		intStatus = GBL_objPubDB.objPubRS("TOPICS_STATUS")
		intSubject = GBL_objPubDB.objPubRS("TOPICS_SUBJECT")
		strNowTitle = ""
		If intStatus = 0 Then
			strStatus = "<font color=red>将该贴置顶</font>"
			intStatus = 9
			strNowTitle = ""
		Else
			strStatus = "<font color=red>解除该贴置顶</font>"
			intStatus = 0
			strNowTitle = "<font color=red>[置顶贴]</font>"
		End If

		If GBL_objPubDB.objPubRS("TOPICS_STATUS") = 10 Then
			strNowTitle = "<font color=red>[公共贴]</font>"
		End If

		If intSubject > 0 Then
			If Not IsEmpty(DEF_FormSubject(ForumId)) Then
				If IsArray(DEF_FormSubject(ForumId)) Then 
					arrNowSub = DEF_FormSubject(ForumId)
					If Not IsEmpty(arrNowSub(intSubject-1)) Then
						strAfterTitle = "--[" & arrNowSub(intSubject-1) & "]"
					End If
				End If
			End If
		Else
			strAfterTitle = ""
		End If

		If GBL_objPubDB.objPubRS("TOPICS_GOOD") = 1 Then
			strNowTitle = strNowTitle & "<font color=red>[精华]</font>"
		End If

		%>
		<script>
			window.document.title = window.document.title + "----" + "<%=GBL_objPubDB.objPubRS("TOPICS_TITLE")%>";
		</script>
		<table width="100%" border="0" cellspacing="1" cellpadding="5"  align="center" style="word-break:break-all;" class="TBone">
			<tr class="TBHead" style="text-align:left">
				<td colspan="2" >
				<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
					<tr width="100%">
						<td width="90%" align="left">
				<%
						strHtmlCode = "&nbsp;&nbsp;<b><img src=""" & GBL_strHomeURL & "images/smile/" & GBL_objPubDB.objPubRS("TOPICS_FACE") & """ border=""0"" align=""absmiddle""> " &  strNowTitle & GBL_objPubDB.objPubRS("TOPICS_TITLE") & strAfterTitle & "</b>"
						Response.Write strHtmlCode
						
				%>
						</td>
						<td width="*" align=right><a href="javascript:OpwCollection(1,<%=GBL_objPubDB.objPubRS("TOPICS_ID")%>,'<%=GBL_objPubDB.objPubRS("TOPICS_TITLE")%>');"><img src=<%=GBL_strHomeURL%>images/user/collect.GIF border=0 title='加为收藏' align="absmiddle" width="16" height="16"></a>&nbsp;
						</td>
					</tr>
				</table>
				</td>
			</tr>
			<tr style="word-break:break-all" valign="top">
				<td class="TBBG1" width="23%" style="line-height:15pt;">
				<%
					'== user info show
					strHtmlCode = ""
					If GBL_objPubDB.objPubRS("USER_FACE_SELECT") = "QQ秀" Then
						strHtmlCode = "&nbsp;&nbsp;&nbsp;&nbsp;<a href='" & MakeQQShow(GBL_objPubDB.objPubRS("USER_QQ")) & "'  target=_blank><img src='" & MakeQQShow(GBL_objPubDB.objPubRS("USER_QQ")) & "'  onload='javascript:DrawImage(this," & "112" & "," & "181" & ",1);' title='点击查看原图' border=0></a>"
					Else
						strHtmlCode = "&nbsp;&nbsp;&nbsp;&nbsp;" & MakeImg( GBL_objPubDB.objPubRS("USER_NOW_FACE")& " onload='javascript:DrawImage(this," & GBL_strUserFaceWidth & "," & GBL_strUserFaceHeight & ",1);'","") 
					End If

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;姓名:" & "<span  onclick=window.open('" & GBL_strHomeURL & "address/address_userinfo_pop.asp?intUserId=" & GBL_objPubDB.objPubRS("TOPICS_OWNER_ID") & "','','left=5,top=5,width=450,height=410,scrollbars=yes,status=yes'); style='cursor:hand;'>" & GBL_objPubDB.objPubRS("USER_REALNAME") & "</span>"

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;<img src=" & GBL_strHomeURL & "images/lvstar/level" & ConvertLevel(GBL_objPubDB.objPubRS("USER_LEVEL")) & ".gif align=absmiddle width=110 height=11>"

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;班级:" & GBL_objPubDB.objPubRS("USER_CLASS")

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;积分:" & GBL_objPubDB.objPubRS("USER_LEVEL")
					
					strTmp = FormatDateTime(GBL_objPubDB.objPubRS("USER_LAST_TIME"),vbShortDate)
					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;最近:" & Right(strTmp,Len(strTmp)-2)

					Dim str
					str = GetConfig(Trim(Application(GBL_strCookieURL & "FORUM_MASTER")),"Forum" & ForumId)
					If Instr(str,Trim(GBL_objPubDB.objPubRS("USER_ACCOUNT"))) > 0 Then
						strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>身份:本版版主</font>" 
					End If

					Response.Write strHtmlCode
				%>
				</td>
				<td class="TBBG1" valign="top" >
					<table width="98%" border="0" cellspacing="0" cellpadding="0" >
						<tr width="100%" >
							<td width="70%">
							<%
		'== topics content show
		strHtmlCode = ""
		strTmp = ""
		'== edit or del this topics
		If IsNumeric(GBL_intUserId) Then
			If Cint(GBL_intUserId) = Cint(GBL_objPubDB.objPubRS("TOPICS_OWNER_ID")) Then

				strTmp = MakeImg(GBL_strImgDir & "ico/forum_edit.gif","修改帖子内容")
				strHtmlCode = "&nbsp;&nbsp;" & MakeLink("forum/forum_add_topics.asp?pstActFlag=FORUM_EDIT_MODE&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId,strTmp,"编辑")
				strTmp = ""
				strTmp = MakeImg(GBL_strImgDir & "ico/forum_del.gif","删除该贴")
				strHtmlCode = strHtmlCode & "&nbsp;" & MakeLinkClew("forum/forum_del.asp?action=DelTopics&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId,strTmp,"删除","onclick=""return confirm('确定删除该帖子及其所有回复?')""")

			End If
		End If
	
		strTmp = ""
		strTmp = MakeImg(GBL_strImgDir & "ico/User_info.gif style='cursor:hand;' onclick=window.open('" & GBL_strHomeURL & "address/address_userinfo_pop.asp?intUserId=" & GBL_objPubDB.objPubRS("TOPICS_OWNER_ID") & "','','left=5,top=5,width=450,height=410,scrollbars=yes,status=yes');" ,"查看用户信息")
		strHtmlCode = strHtmlCode & "&nbsp;" & strTmp

		strTmp = MakeImg(GBL_strImgDir & "ico/forum_quote.gif","回复该贴")
		strTmp =  MakeLink("forum/forum_add_reply.asp?TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&pstTitle=" & GBL_objPubDB.objPubRS("TOPICS_TITLE") & "&ForumId=" & ForumId,strTmp,"回复该贴")
		strHtmlCode = strHtmlCode & "&nbsp;" & strTmp

		strTmp = ""
		strTmp = MakeImg(GBL_strImgDir & "ico/User_sms.gif","给" & GBL_objPubDB.objPubRS("USER_REALNAME") & "发站内短信")
		strTmp = "<a href='" & GBL_strHomeURL & "sms/sms_add_form.asp?action=FormNewSms&pstReTitle=你好&pstReSenderId=" & GBL_objPubDB.objPubRS("USER_ID") & "&pstReSender=" & GBL_objPubDB.objPubRS("USER_REALNAME") & "' title='给其发站内短信' target=_blank>" & strTmp & "</a>"
		strHtmlCode = strHtmlCode & "&nbsp;" & strTmp
		
		strHtmlCode = "&nbsp;&nbsp;发表:" & GBL_objPubDB.objPubRS("TOPICS_DATE") & " 人气:" & GBL_objPubDB.objPubRS("TOPICS_HITS") & " 回复:" & GBL_objPubDB.objPubRS("TOPICS_REPLIES") & strHtmlCode 
		Response.Write strHtmlCode

		
		'== for administrator operation
		Dim strSelect,str2,strClew2,str7,strClew7,strAll,str3,strClew3,str4,strClew4,strForbid,str5,strClew5,str8,strClew8,str6,strClew6,strGood,intMaxPerPage,intCurPage,intTotalPut
		strSelect = ""
		If GBL_strUserAuthen = 1 Or GetMaster(ForumId) Then

			str2 = GBL_strHomeURL & "forum/forum_status.asp?action=MdyTopicsStatus&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&pstStatus=" & intStatus
			strClew2 = "确定该帖子置顶或解除置顶?"

			'== for all top
			If GBL_strUserAuthen = 1 Then
				If GBL_objPubDB.objPubRS("TOPICS_STATUS") <> 10 Then
					str7 = GBL_strHomeURL & "forum/forum_status.asp?action=MdyTopicsStatus&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ACT_MODE=ACT_ALLTOP&ForumId=" & ForumId & "&pstAllTop=10"
					strClew7 = "确定该帖子置顶于所有版面?"
					strAll = "置顶于所有版面"
				ElseIf GBL_objPubDB.objPubRS("TOPICS_STATUS") = 10 Then
					str7 = GBL_strHomeURL & "forum/forum_status.asp?action=MdyTopicsStatus&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ACT_MODE=ACT_ALLTOP&ForumId=" & ForumId & "&pstAllTop=0"
					strClew7 = "确定该帖子解除置顶于所有版面?"
					strAll = "解除置顶于所有版面"
				End If
				
			End If

			str3 = GBL_strHomeURL & "forum/forum_add_topics.asp?action=FormAddTopics&pstActFlag=FORUM_EDIT_MODE&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId
			strClew3 = "确认修改本帖子?"

			If GBL_objPubDB.objPubRS("TOPICS_REPLY_FORBID") = 0 Then
				str4 = GBL_strHomeURL & "forum/forum_status.asp?action=MdyTopicsStatus&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&pstForbid=1&ACT_MODE=ACT_FORBID"  
				strClew4 = "确定该帖子禁止回复?"
				strForbid = "设为禁止回复"
			Else
				str4 = GBL_strHomeURL & "forum/forum_status.asp?action=MdyTopicsStatus&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&pstForbid=0&ACT_MODE=ACT_FORBID"
				strClew4 = "确定该帖子打开回复?" 
				strForbid = "打开帖子回复"
			End If

			str5 = GBL_strHomeURL & "forum/forum_move.asp?action=FormTopicsMove&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&pstTitle=" & GBL_objPubDB.objPubRS("TOPICS_TITLE")
			strClew5 = "确定移动该帖子到别的贴吧?"

			str8 = GBL_strHomeURL & "forum/forum_move.asp?action=FormTopicsMove&ACT_MODE=ACT_SUJECT_MODE&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&pstTitle=" & GBL_objPubDB.objPubRS("TOPICS_TITLE")
			strClew8 = "确定把该贴放入专题?"

			If GBL_objPubDB.objPubRS("TOPICS_GOOD") = 1 Then
				str6 = GBL_strHomeURL & "forum/forum_good.asp?action=SetTopicsGood&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&ACT_MODE=ACT_UN_GOOD"
				strClew6 = "确定将该帖解除精华?"
				strGood = "解除精华状态"
			Else
				str6 = GBL_strHomeURL & "forum/forum_good.asp?action=SetTopicsGood&TopicsId=" & GBL_objPubDB.objPubRS("TOPICS_ID") & "&ForumId=" & ForumId & "&ACT_MODE=ACT_SET_GOOD" 
				strClew6 = "确定将该帖设为精华?"
				strGood = "将本贴设为精华"
			End If

			%>
			<script language=javascript>
			function MasterSelect(selValue)
			{
				switch (selValue)
				{
					case	'1' :
						if (!confirm("确定删除该帖子及其所有回复?"))
							return false;
						else
							document.location.href = '<%=GBL_strHomeURL%>forum/forum_del.asp?action=DelTopics&TopicsId=<%=GBL_objPubDB.objPubRS("TOPICS_ID")%>&ForumId=<%=ForumId%>';
							return true;
					case	'2' :
						if (!confirm("<%=strClew2%>"))
							return false;
						else
							document.location.href = '<%=str2%>';
							return true;
					case	'3' :
						if (!confirm("<%=strClew3%>"))
							return false;
						else
							document.location.href = '<%=str3%>';
							return true;
					case	'4' :
						if (!confirm("<%=strClew4%>"))
							return false;
						else
							document.location.href = '<%=str4%>';
							return true;
					case	'5' :
						if (!confirm("<%=strClew5%>"))
							return false;
						else
							document.location.href = '<%=str5%>';
							return true;
					case	'6' :
						if (!confirm("<%=strClew6%>"))
							return false;
						else
							document.location.href = '<%=str6%>';
							return true;
					case	'7' :
						if (!confirm("<%=strClew7%>"))
							return false;
						else
							document.location.href = '<%=str7%>';
							return true;
					case	'8' :
						if (!confirm("<%=strClew8%>"))
							return false;
						else
							document.location.href = '<%=str8%>';
							return true;
							
				}
				return true;
			}
			</script>
			<%
			strSelect = "<select name=selMasterMgr onChange=MasterSelect(this.options[this.selectedIndex].value);>"
			strSelect = strSelect & "<option>版主管理</option>"
			strSelect = strSelect & "<option value='1'>删除该贴</option>"
			strSelect = strSelect & "<option value='2'>" & strStatus & "</option>"
			If GBL_strUserAuthen = 1 Then
				strSelect = strSelect & "<option value='7'>" & strAll & "</option>"
			End If
			strSelect = strSelect & "<option value='3'>修改该贴内容</option>"
			strSelect = strSelect & "<option value='4'>" & strForbid & "</option>"
			strSelect = strSelect & "<option value='5'>移动该贴</option>"
			strSelect = strSelect & "<option value='6'>" & strGood & "</option>"
			'strSelect = strSelect & "<option value='8'>添加到专题</option>"
			strSelect = strSelect & "</select>"

		End If
							%>
							</td>
							<td width="*" align="right"><%=strSelect%><font color="#999999"><b>楼主</b></font></td>
						</tr>
						<tr width="100%">
							<td width="100%" style="line-height:15pt;" colspan="2">
							<%
								Response.Write "<br>&nbsp;&nbsp;" & UbbCode(GBL_objPubDB.objPubRS("TOPICS_CONTENT"))
								If GBL_objPubDB.objPubRS("TOPICS_REPLY_FORBID") = 1 Then
									Response.Write "<b>该贴已被设置为禁止回复</b>"
								End If
							%>
							</td>
						</tr>
						<%
						'== user sign show
						strHtmlCode = ""
						If Trim(GBL_objPubDB.objPubRS("USER_INFO")) <> "" And Trim(GBL_objPubDB.objPubRS("USER_INFO")) <> CONST_DIVIDER Then
							Dim arrTmp : arrTmp = Split(GBL_objPubDB.objPubRS("USER_INFO"),CONST_DIVIDER)
							If Isarray(arrTmp) Then
								strTmp = UbbCode(arrTmp(0))
								strHtmlCode = "<img src=" & GBL_strHomeURL & "images/ico/" & "forum_sign.gif width=350><br>" & strTmp
								%>
								<tr width=100%>
									<td width=100% style="line-height:15pt;" colspan=2>
										<%=strHtmlCode%>
									</td>
								</tr>
								<%
							End If
						End If
						%>
					</table>
				</td>
			</tr>
			 
			<%

		'== reply
		'== get this topic content
		GBL_objPubDB.Clear()
		GBL_objPubDB.SQLType = "SELECT"
		GBL_objPubDB.AllSQL = "SELECT R.REPLY_ID,R.REPLY_CONTENT,R.REPLY_TITLE,R.REPLY_FACE,R.REPLY_OWNER_ID,R.REPLY_FORUM_ID,R.REPLY_TOPICS_ID,R.REPLY_DATE,U.USER_LEVEL,U.USER_LAST_TIME,U.USER_REALNAME,U.USER_INFO,U.USER_NOW_FACE,U.USER_AUTHEN,U.USER_FACE_SELECT,U.USER_QQ,U.USER_CLASS,U.USER_ID,U.USER_ACCOUNT FROM CLASS_REPLY R,CLASS_USER U WHERE R.REPLY_OWNER_ID=U.USER_ID AND R.REPLY_TOPICS_ID=" & GetRSId & " ORDER BY R.REPLY_DATE ASC"
		GBL_objPubDB.SQLRSExecute()

		'== get now page 
		intMaxPerPage = 10 
		If Not IsEmpty(Request("intPageNow")) Then
			intCurPage = Cint(Request("intPageNow"))
		Else
			intCurPage = 1
		End If
		If intCurPage < 1 then
			intCurPage = 1
		End If

		Call ResultExecute(GBL_objPubDB.intErrNum,"get topics content","ES_ERR")
		If GBL_objPubDB.intRSNum > 0 Then
				
			'== make now page
			intTotalPut =  GBL_objPubDB.intRSNum

			If (intCurPage - 1) * intMaxPerPage > intTotalPut Then
				If (intTotalPut Mod intMaxPerPage) = 0 Then
					intCurPage = intTotalPut \ intMaxPerPage
				Else
					intCurPage = intTotalPut \ intMaxPerPage + 1
				End If
			End if

			If intCurPage = 1 Then
				Call ShowContentRe(GBL_objPubDB.objPubRS,intCurPage,intMaxPerPage,ForumId)
			Else
				If (intCurPage - 1) * intMaxPerPage < intTotalPut Then
					GBL_objPubDB.objPubRS.Move  (intCurPage - 1) * intMaxPerPage
					Dim BookMark
					BookMark = GBL_objPubDB.objPubRS.BookMark
					Call ShowContentRe(GBL_objPubDB.objPubRS,intCurPage,intMaxPerPage,ForumId)
				Else
					intCurPage = 1
					Call ShowContentRe(GBL_objPubDB.objPubRS,intCurPage,intMaxPerPage,ForumId)
				End If

			End If


		End If
			%>
		</table>
		<%
		Dim strFileName
		'== by page
		If GBL_objPubDB.intRSNum > 0 Then
			strFileName = "forum_show.asp?TopicsId=" & GetRSId & "&ForumId=" & ForumId
			Call ShowPage(intTotalPut,intMaxPerPage,intCurPage,strFileName)
		End If

		Call ForumIcoShow()

		If intForbid <> 1 Then
			%>
			<table width="100%" >
			<tr width="100%" >
				<td align="left">
				<input type="checkbox" onclick="OpenReply()" id="chkreply" name="chkreply"><font color="red">回复该贴(划勾则可以直接回复该贴)</font>
				</td></tr>
			<tr width="100%" style="display:none" id="tabopen" name="tabopen">
				<td width="100%">
				<%
				Call FormAddReply()
				%>
				</td></tr></table>
			<%
		End If

	End If '== intRSNum

End Function

'====================================================================
'= Function         : OpenReply()
'= Description : open reply forum
'====================================================================
%>
<script>
function OpenReply()
{
	if (chkreply.checked)
		tabopen.style.display="";
	else
		tabopen.style.display="none";
}
</script>
<%
'====================================================================
'= Function    : ShowContentRe(ByRef clsReTab,objRSCont,intMaxPerPage)
'= Time		   : Created At Jan,31,2004
'= Input       :
'= Description : Show per topics reply
'====================================================================
Function ShowContentRe(objRSCont,intCurPage,intMaxPerPage,intForumId)
	Dim k,str,strHtmlMgr,strSelect1
	Dim strTmp,strHtmlCode
	Dim strTdClass1,strTdClass2,strTdClass,arrTmp

	k = 0
	Do While Not objRSCont.Eof

		k = k + 1

		If (k Mod 2) = 0 Then
			strTdClass = "TBBG1"
		Else
			strTdClass = "TBBG9"
		End If

		'== reply left
%>
	<tr style='word-break:break-all' valign=top>
				<td class=<%=strTdClass%> style="line-height:15pt;">
				<%
					'== user info show
					strHtmlCode = ""
					If objRSCont("USER_FACE_SELECT") = "QQ秀" Then
						strHtmlCode = "&nbsp;&nbsp;&nbsp;&nbsp;<a href='" & MakeQQShow(objRSCont("USER_QQ")) & "'  target=_blank><img src='" & MakeQQShow(objRSCont("USER_QQ")) & "'  onload='javascript:DrawImage(this," & "112" & "," & "181" & ",1);' title='点击查看原图' border=0></a>"
					Else
						strHtmlCode = "&nbsp;&nbsp;&nbsp;&nbsp;" & MakeImg( objRSCont("USER_NOW_FACE")& " onload='javascript:DrawImage(this," & GBL_strUserFaceWidth & "," & GBL_strUserFaceHeight & ",1);'","") 
					End If

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;姓名:" & "<span  onclick=window.open('" & GBL_strHomeURL & "address/address_userinfo_pop.asp?intUserId=" & objRSCont("REPLY_OWNER_ID") & "','','left=5,top=5,width=450,height=410,scrollbars=yes,status=yes'); style='cursor:hand;'>" & objRSCont("USER_REALNAME") & "</span>"

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;<img src=" & GBL_strHomeURL & "images/lvstar/level" & ConvertLevel(objRSCont("USER_LEVEL")) & ".gif align=absmiddle width=110 height=11>"

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;班级:" & objRSCont("USER_CLASS")

					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;积分:" & objRSCont("USER_LEVEL")
					
					strTmp = FormatDateTime(objRSCont("USER_LAST_TIME"),vbShortDate)
					strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;最近:" & Right(strTmp,Len(strTmp)-2)

					If GBL_objPubDB.objPubRS("USER_AUTHEN") = 1 Then
						If GBL_objPubDB.objPubRS("USER_ACCOUNT") = GBL_strDefaultAdminAccount Then
							strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>网站身份:管理员</font>" 
						Else
							strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>网站身份:副管理员</font>" 
						End If
					End If

					str = GetConfig(Trim(Application(GBL_strCookieURL & "FORUM_MASTER")),"Forum" & intForumId)
					If Instr(str,Trim(objRSCont("USER_ACCOUNT"))) > 0 Then
						strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>身份:本版版主</font>" 
					End If

					Response.Write strHtmlCode
				%>
				</td>
				<td class=<%=strTdClass%> valign=top >
					<table width=98% border=0 cellspacing=0 cellpadding=0 >
						<tr width=100% >
							<td width=70%>
							<%
		'== topics content show
		strHtmlCode = ""
		strTmp = ""
		'== edit or del this topics
		strHtmlMgr = ""
		If IsNumeric(GBL_intUserId) Then
			If Cint(GBL_intUserId) = Cint(objRSCont("REPLY_OWNER_ID")) Then

				strTmp = MakeImg(GBL_strImgDir & "ico/forum_edit.gif","修改回复贴内容")
				strHtmlMgr = "&nbsp;&nbsp;" & MakeLink("forum/forum_add_reply.asp?pstActFlag=FORUM_EDIT_MODE&ReplyId=" & objRSCont("REPLY_ID") & "&TopicsId=" & objRSCont("REPLY_TOPICS_ID") & "&ForumId=" & objRSCont("REPLY_FORUM_ID"),strTmp,"修改")
				strTmp = ""
				strTmp = MakeImg(GBL_strImgDir & "ico/forum_del.gif","删除该回复贴")
				strHtmlMgr = strHtmlMgr & "&nbsp;" & MakeLinkClew("forum/forum_del.asp?action=DelReply&ReplyId=" & objRSCont("REPLY_ID") & "&TopicsId=" & objRSCont("REPLY_TOPICS_ID") & "&ForumId=" & objRSCont("REPLY_FORUM_ID"),strTmp,"删除","onclick=""return confirm('确定删除该回复?')""")

			End If
		Else
			strHtmlMgr = ""
		End If
		
		strTmp = ""
		strTmp = MakeImg(GBL_strImgDir & "ico/User_info.gif style='cursor:hand;' onclick=window.open('" & GBL_strHomeURL & "address/address_userinfo_pop.asp?pstUserId=" & objRSCont("REPLY_OWNER_ID") & "','','left=5,top=5,width=450,height=410,scrollbars=yes,status=yes');" ,"查看用户信息")
		strHtmlCode = "发表:" & objRSCont("REPLY_DATE") & "&nbsp;" & strHtmlMgr & "&nbsp;" & strTmp

		strTmp = MakeImg(GBL_strImgDir & "ico/forum_quote.gif","引用回复该贴")
		strTmp =  MakeLink("forum/forum_add_reply.asp?ACT_MODE=ACT_REPLY_QUOTE&TopicsId=" & objRSCont("REPLY_TOPICS_ID") & "&pstTitle=" & objRSCont("REPLY_TITLE") & "&ForumId=" & objRSCont("REPLY_FORUM_ID") & "&ReplyId=" & objRSCont("REPLY_ID"),strTmp,"引用回复该贴")
		strHtmlCode = strHtmlCode & "&nbsp;" & strTmp

		strTmp = MakeImg(GBL_strImgDir & "ico/User_sms.gif","给" & objRSCont("USER_REALNAME") & "发站内短信")
		strTmp = "<a href='" & GBL_strHomeURL & "sms/sms_add_form.asp?action=FormNewSms&pstReTitle=你好&pstReSenderId=" & objRSCont("USER_ID") & "&pstReSender=" & objRSCont("USER_REALNAME") & "' title='给其发站内短信' target=_blank>" & strTmp & "</a>"
		strHtmlCode = strHtmlCode & "&nbsp;" & strTmp 

		strHtmlCode = strHtmlCode & "<br>&nbsp;&nbsp;" & "<img src='" & GBL_strHomeURL & "images/smile/" & objRSCont("REPLY_FACE") & "' border=0 align=absmiddle> " & "<b>" & objRSCont("REPLY_TITLE") & "</b>"
		
		Response.Write strHtmlCode

		'== for administrator
		If GBL_strUserAuthen = 1 Or GetMaster(objRSCont("REPLY_FORUM_ID")) Then
		
			%>
			<script language=javascript>
			function MasterSelect1<%=k%>(selValue)
			{
				switch (selValue)
				{
					case	'1' :
						if (!confirm("确定删除该回复?"))
							return false;
						else
							document.location.href = '<%=GBL_strHomeURL%>forum/forum_del.asp?action=DelReply&ReplyId=<%=objRSCont("REPLY_ID") & "&TopicsId=" & objRSCont("REPLY_TOPICS_ID") & "&ForumId=" & objRSCont("REPLY_FORUM_ID")%>';
							return true;
					case	'2' :
						if (!confirm("确定修改该回复?"))
							return false;
						else
							document.location.href = '<%=GBL_strHomeURL%>forum/forum_add_reply.asp?pstActFlag=FORUM_EDIT_MODE&ReplyId=<%=objRSCont("REPLY_ID") & "&TopicsId=" & objRSCont("REPLY_TOPICS_ID") & "&ForumId=" & objRSCont("REPLY_FORUM_ID")%>';
							return true;
				}
				return true;
			}
			</script>
			<%
			strSelect1 = "<select name=selMasterMgr" & k & " onChange=MasterSelect1" & k & "(this.options[this.selectedIndex].value);>"
			strSelect1 = strSelect1 & "<option>版主管理</option>"
			strSelect1 = strSelect1 & "<option value='1'>删除回复</option>"
			strSelect1 = strSelect1 & "<option value='2'>修改回复</option>"
			strSelect1 = strSelect1 & "</select>"
		End If
		%>
							</td>
							<td width="*" align=right><%=strSelect1%><font color=#999999><b>第<%=(intCurPage-1)*intMaxPerPage + k%>楼</b></font></td>
						</tr>
						<tr width=100%>
							<td width=100% style="line-height:15pt;" colspan=2>
							<%
								Response.Write "<br>&nbsp;&nbsp;" & UbbCode(objRSCont("REPLY_CONTENT"))
							%>
							</td>
						</tr>
						<%
						'== user sign show
						strHtmlCode = ""
						If Trim(objRSCont("USER_INFO")) <> "" And Trim(objRSCont("USER_INFO")) <> CONST_DIVIDER Then
							arrTmp = Split(objRSCont("USER_INFO"),CONST_DIVIDER)
							If Isarray(arrTmp) Then
								strTmp = UbbCode(arrTmp(0))
								strHtmlCode = "<img src=" & GBL_strHomeURL  & "images/ico/forum_sign.gif width=350><br>" & strTmp
								%>
								<tr width=100% >
									<td width=100% style="line-height:15pt;" colspan=2>
										<%=strHtmlCode%>
									</td>
								</tr>
								<%
							End If
						End If
						%>
					</table>
				</td>
			</tr>
			<!--
			<tr width=100%>
				<td height=1 background='<%=GBL_strHomeURL & GBL_strImgDir%>ShowBoard_line.gif' colspan=2></td>
			</tr>
			-->
<%


		If k >= intMaxPerPage Then Exit Do
			objRSCont.MoveNext
		
	Loop

End Function


Function ShowForumMenu()
	Dim GetRSId,strAddInfo,intErrId,ForumId,strMaster,strHtmlCode,strTmp,strTitle
	GetRSId = Trim(Request.QueryString("TopicsId"))
	strAddInfo = "该文章"
	intErrId = DataCheck("DT_ID",GetRSId,strAddInfo,"")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	ForumId = Trim(Request.QueryString("ForumId"))
	strAddInfo = "该文章所属栏目"
	intErrId = DataCheck("DT_ID",ForumId,strAddInfo,"")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	'== master
	strMaster =  Replace(GetConfig(Application(GBL_strCookieURL & "FORUM_MASTER_NAME"),"Forum" & ForumId),"|",", ")
	If Trim(strMaster) <> "" Then
		strMaster = " 本版版主:" & strMaster
	Else
		strMaster = " 本版版主:暂无"
	End If

%>
	<table width=530 cellspacing=1 cellpadding=5  class="forum_nav_table">
			<tr>
				<td width=100% align=left colspan=2>
				<%
				If Trim(Request.QueryString("ACT_MODE")) = "ACT_TOPICS_GOOD" Then
						Response.Write ForumMenu(1,"<font color=red>精华区</font>") 
				Else
					Response.Write ForumMenu(1,"查看帖子")
				End If
				%>
				</td>
			</tr>
			<tr>
				<td width="50%" align=left>
				<%
					strHtmlCode = ""
					strTmp = MakeImg(GBL_strImgDir & "ico/forum_add.gif","")
					strHtmlCode = "&nbsp;"&  MakeLink("forum/forum_add_topics.asp?ForumId=" & ForumId,strTmp,"")
					strTmp = MakeImg(GBL_strImgDir & "ico/forum_rly.gif","")
					strHtmlCode = strHtmlCode & "&nbsp;" & MakeLink("forum/forum_add_reply.asp?TopicsId=" & GetRSId & "&pstTitle=" & strTitle & "&ForumId=" & ForumId, strTmp,"")
					Response.Write strHtmlCode
				%>
				</td>
				<td width="*" align=right>
				<%
					Response.Write "<font color=red>" & strMaster & "</font>&nbsp;&nbsp;&nbsp;"	
				%>
				</td>
			</tr>
		</table>
<%
End Function

%>