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

📄 forum_func.asp

📁 1] 校友多种方式注册认证[直接注册,答问注册,认证注册] 2] 校友论坛 小巧而实用的论坛,支持UBB标签,快速回复,帖子搜索,灵活的将帖子置顶,设置精华 3] 校友相册 相片上传[方便上传
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'===================================================================
'= ASP FILENAME	: /forum/forum_func.asp
'= CREATED TIME : Mar,15,2004
'= LAST MODIFIED: Mar,15,2004
'= VERSION INFO : CCASP Framework Ver 2.0.1 ALL RIGHTS RESERVED BY www.cclinux.com
'= DESCRIPTION  : forum public functions and not by style
'= Change Log:
'===================================================================
%>
<%
'==  查看帖子内容数据校验设置
Dim arrForumContentDataChk(1)
arrForumContentDataChk(0) = Array("DT_ID"	,"TopicsId"	,"该帖子"	,0	,20)
arrForumContentDataChk(1) = Array("DT_ID"	,"ForumId"	,"该帖子所属栏目"	,0	,20)

'===================================================================
'= Function    : GetMaster(intForumId)
'= Time		   : Created At Jun,11,2004
'= Input       : 
'= Table	   : Qurey CLASS_FORUM,CLASS_USER
'= Description : get user master of forum
'===================================================================
Function GetMaster(intForumId)

	Dim strTmp,i

	strTmp =  Trim(GetConfig(Application(GBL_strCookieURL & "FORUM_MASTER"),"Forum" & intForumId))

	If strTmp <> "" Then
		strTmp = Split(strTmp,"|")
		For i = Lbound(strTmp) To Ubound(strTmp)
			If Trim(strTmp(i)) = GBL_strUserAccount Then
				GetMaster = True
				Exit Function
			End If
		Next
	End If

	GetMaster = False

End Function

'===================================================================
'= Function    : ForumMenu(intFlag,strClew)
'= Time		   : Created At Mar,15,2004
'= Input       : intFlag	: now page mode
'= Table	   : Qurey CLASS_FORUM,
'= Description : Show form now menu
'===================================================================
Function ForumMenu(intFlag,strClew)
	Dim strPutMenu
	Dim strHtmlCode
	Dim arrTmp,strTmp,ForumId

	strPutMenu = ""
	strHtmlCode = ""
	strTmp = ""

	ForumId = Trim(Request("ForumId"))
	If Len(ForumId) = 0 Or Not IsNumeric(ForumId) Then
		ForumId = 0
	End If

	GBL_objPubDB.Clear()
	GBL_objPubDB.AllSQL = "SELECT FORUM_NAME FROM CLASS_FORUM WHERE FORUM_ID=" & ForumId
	GBL_objPubDB.SQLRSExecute()
	Call ResultExecute(GBL_objPubDB.intErrNum,"mdy topics forbid","ES_ERR")
	If GBL_objPubDB.intRSNum > 0 Then
		Dim strForumTitle : strForumTitle = GBL_objPubDB.objPubRS("FORUM_NAME")
	End If

	'arrTmp = Trim(GetConfig(Application(GBL_strCookieURL & "FORUM_CATE"),"Forum" & ForumId))
	'If arrTmp <> ""  Then
	'	arrTmp = Split(arrTmp,"|")
	'	If Not IsArray(arrTmp) Then
	'		ForumMenu = ""
	'		Exit Function
	'	End If
	'Else
	'	ForumMenu = ""
	'	Exit Function
	'End If

	strPutMenu = "&nbsp;<img src='" & GBL_strHomeURL & "images/jt.gif' border=0 align=absmiddle>&nbsp;<a href='" & GBL_strHomeURL & "index.asp'>首页</a> &gt;&gt;<a href='" & GBL_strHomeURL & "forum/forum_cate.asp' > 校友论坛</a> &gt;&gt; "
	strPutMenu = strPutMenu & "<a href='" & GBL_strHomeURL & "forum/forum_list.asp?ForumId=" & ForumId & "'>" & strForumTitle & "</a>"

	If Trim(strClew) <> "" Then
		strPutMenu = strPutMenu & " &gt;&gt; " & strClew
	End If
	
	Select Case intFlag
		Case 1	: 
			strPutMenu = strPutMenu & "<br>" & strHtmlCode
		Case 2	:
			strPutMenu = strPutMenu & ""
		Case 3	:
			strPutMenu= strPutMenu & " &gt;&gt; 修改帖子"
	End Select 

	ForumMenu = strPutMenu

End Function
'===================================================================
'= Sub         : CheckMasterForum(GetRSId)
'= Time		   : Created At Jan,29,2004
'= Table	   : Qurey CLASS_FORUM,
'= Description : 是否是版主才能访问的论坛栏目
'===================================================================
Function CheckMasterForum(GetRSId)
	Dim strForumAccess,arrForumAccess,k
	If Trim(Request("VIEW_MODE")) = "ADMIN_ONLY"  And Session(GBL_strCookieURL & "SEN_strIsMaster") = "0" And Not AdminCheck() Then
		GetRSId = -1
	End If
	If GetRSId = -1 Then
		Call ResultExecute(E_USER_PUB,"您没有浏览该管理员和版主版面的权限","ES_ERR")
		Exit Function
	Else
		strForumAccess = Trim(Application(GBL_strCookieURL & "FORUM_ACCESS"))
		arrForumAccess = Split(strForumAccess,"|")
		For k = Lbound(arrForumAccess) To Ubound(arrForumAccess)
			intNowForumAccess = Cint(arrForumAccess(k))
			If Cint(GetRSId) = intNowForumAccess  And Session(GBL_strCookieURL & "SEN_strIsMaster") = "0" And Not AdminCheck() Then
				Call ResultExecute(E_USER_PUB,"您没有浏览该管理员和版主版面的权限","ES_ERR")
				Exit Function
			End If
		Next
	End If

End Function
'===================================================================
'= Sub         : FormAddReply()
'= Time		   : Created At Jan,31,2004
'= Input       : None
'= Description : Add new forum reply
'===================================================================
Sub FormAddReply()

	Dim clsForm			'== Class of form
	Dim strHtmlCode
	Dim strActFlag
	Dim intErrId
	Dim strAddInfo
	Dim strTitle		'== the topic title
	Dim GetRSId,GetRSId1
	Dim strContent,strFace

	strContent = ""
	strFace = "14.gif"
	strTitle = ""

	strActFlag = Trim(Request.QueryString("pstActFlag"))
	If strActFlag <> "" And strActFlag <> "FORUM_EDIT_MODE" Then
		Call ResultExecute(E_USER_PUB,"贴子编辑模式不正确","ES_ERR")
		Exit Sub
	End If

	Dim ForumId : ForumId = Trim(Request.QueryString("ForumId"))
	strAddInfo = "论坛栏目"
	intErrId = DataCheck("DT_ID",ForumId,strAddInfo,"ES_ERR")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	'== check title
	'strTitle = Trim(Request.QueryString("pstTitle"))
	Call CheckMasterForum(ForumId)

	'== edit mode 
	If strActFlag = "FORUM_EDIT_MODE" Then

		GetRSId1 = Trim(Request.QueryString("ReplyId"))
		strAddInfo = "该要编辑的帖子回复"
		intErrId = DataCheck("DT_ID",GetRSId1,strAddInfo,"")
		Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

		GBL_objPubDB.Clear()
		GBL_objPubDB.TableName = "CLASS_REPLY"
		GBL_objPubDB.SQLType = "SELECT"
		If GBL_strUserAuthen = 1 Or GetMaster(ForumId) Then
			GBL_objPubDB.Where = "REPLY_ID=" & GetRSId1
		Else
			GBL_objPubDB.Where = "REPLY_ID=" & GetRSId1 & " AND REPLY_OWNER_ID=" & GBL_intUserId
		End If
		GBL_objPubDB.AddField "REPLY_CONTENT,REPLY_FACE,REPLY_TITLE",""
		GBL_objPubDB.SQLRSExecute()
		Call ResultExecute(GBL_objPubDB.intErrNum,"get edit reply content","ES_ERR")
		If GBL_objPubDB.intRSNum = 0 Then
			Call ResultExecute(E_USER_PUB,"该要编辑帖子不存在或已删除","ES_ERR")
			Exit Sub
		End If
		strContent = GBL_objPubDB.objPubRS("REPLY_CONTENT")
		strFace = GBL_objPubDB.objPubRS("REPLY_FACE")
		strTitle = GBL_objPubDB.objPubRS("REPLY_TITLE")

	End If

	'== quote reply
	If Trim(Request.QueryString("ACT_MODE")) = "ACT_REPLY_QUOTE" Then
	
		ReplyId = Trim(Request.QueryString("ReplyId"))
		strAddInfo = "引用贴"
		intErrId = DataCheck("DT_ID",ReplyId,strAddInfo,"ES_ERR")
		Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

		GBL_objPubDB.Clear()
		GBL_objPubDB.AllSQL = "SELECT REPLY_CONTENT,USER_REALNAME FROM CLASS_REPLY,CLASS_USER WHERE USER_ID=REPLY_OWNER_ID AND REPLY_ID=" & ReplyId
		GBL_objPubDB.SQLRSExecute()
		Call ResultExecute(GBL_objPubDB.intErrNum,"quote reply","ES_ERR")

		If GBL_objPubDB.intRSNum > 0 Then
			strContent = "[QUOTE]引用" & GBL_objPubDB.objPubRS("USER_REALNAME") & "发表的内容:<br>" & GBL_objPubDB.objPubRS("REPLY_CONTENT") & "[/QUOTE]"
		End If
		
	End If

	'== check id
	GetRSId = Trim(Request.QueryString("TopicsId"))
	strAddInfo = "该需回复帖子"
	intErrId = DataCheck("DT_ID",GetRSId,strAddInfo,"")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	'== get title
	Dim strInTitle
	If CONST_PAGE_FILE = "forum/forum_show.asp" Then
		strTitle = strInTitle
	Else
		If strActFlag <> "FORUM_EDIT_MODE" Then
			GBL_objPubDB.Clear()
			GBL_objPubDB.AllSQL = "SELECT TOPICS_TITLE  FROM CLASS_TOPICS WHERE TOPICS_ID=" & GetRSId
			GBL_objPubDB.SQLRSExecute()
			Call ResultExecute(GBL_objPubDB.intErrNum,"get add reply title","ES_ERR")
			If GBL_objPubDB.intRSNum = 0 Then
				Call ResultExecute(E_USER_PUB,"该要回复的帖子不存在或已删除","ES_ERR")
				Exit Sub
			End If
			strTitle = GBL_objPubDB.objPubRS("TOPICS_TITLE")
		End If
	End If

	'== check topics status
	If CONST_PAGE_FILE = "forum/forum_show.asp" Then
	Else
		GBL_objPubDB.Clear()
		GBL_objPubDB.AllSQL = "SELECT TOPICS_REPLY_FORBID FROM CLASS_TOPICS WHERE TOPICS_ID=" & GetRSId
		GBL_objPubDB.SQLRSExecute()
		Call ResultExecute(GBL_objPubDB.intErrNum,"get before reply topics ","ES_ERR")
		If GBL_objPubDB.intRSNum <= 0 Then
			Call ResultExecute(E_USER_PUB,"该帖子不存在","ES_ERR")
			Exit Sub
		ElseIf GBL_objPubDB.objPubRS("TOPICS_REPLY_FORBID") = 1 Then
			Call ResultExecute(E_USER_PUB,"该帖子已被设置为禁止回复","ES_ERR")
			Exit Sub 
		End If
	End If

	Set clsForm = New classFormOld
	If strActFlag = "FORUM_EDIT_MODE" Then

⌨️ 快捷键说明

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