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

📄 inc_pub_func.asp

📁 1] 校友多种方式注册认证[直接注册,答问注册,认证注册] 2] 校友论坛 小巧而实用的论坛,支持UBB标签,快速回复,帖子搜索,灵活的将帖子置顶,设置精华 3] 校友相册 相片上传[方便上传
💻 ASP
📖 第 1 页 / 共 5 页
字号:
	'== Do function of this trans
	If intGetType = 0 Then

		'== Update view counter
		'Call ViewCount(strPageName)
		Call ExecFuncSwitch(strPageName)

	ElseIf intGetType = 1 Then

		'== Update view counter
		Call ViewCount(strPageName)

		'== Wide content execute
		If Left(CONST_PAGE_FILE, 6) = "forum/" Then
			Call PageMainStyleForum(strPageName)
		ElseIf CONST_PAGE_FILE = "meet/meet_detail.asp" Then
			Call PageMainStyleMeet(strPageName)
		Else
			Response.Write "sss"
			Call PageMainStyle(strPageName)
		End If

	Else

		Call ResultExecute(10,strGetPost,"ES_ERR")

	End If

End Sub
'============== End of Sub ExecOrShowSwitch() ======================
'====================================================================
'= Sub         : ExecOrShowSwitch(strPageName,strShowFunc,strShowDataFunc,strExecFunc)
'= Time		   : Created At SEP,2,2003
'= Input       : 

'= Called by   : All main page
'= Calls       : 
'= Description : Show or execute switch function
'===================================================================
Sub ExecOrShowSwitch(strPageName,strTCodeType)

	Dim strGetPost
	Dim intGetAuthen,intGetType,intGetStatus,strGetDesc
	Dim strTmp,strTmp1

	strGetDesc = "该功能"
	
	'== Get now online guest and user
	Call GetNowOnline ()

	'== Get transation request
	strGetPost = Trim(Request.QueryString("action"))
	If strGetPost = "" Then
		Call ResultExecute(10,"","ES_ERR")
		Exit Sub
	End If

	'== check user access
	If CTL_USER_ACCESS Then
		If GBL_strUserAccess <> "" And IsNumeric(GBL_strUserAccess) Then
				GBL_strUserAccess = Cint(GBL_strUserAccess)
				If GBL_strUserAccess = 0 And Left(strGetPost,8) = "FormSave" Then
					Call ResultExecute(E_USER_PUB,"对不起,您没有提交权限","ES_ERR")
					Exit Sub
				End If
		End If
	End If

	'== Get this trans code authen,status,type
	If CONST_TRANS_CTL = 0 Then

		clsPubDB.Clear()
		clsPubDB.TableName = "CLASS_TRANS"
		clsPubDB.SQLType = "SELECT"
		clsPubDB.AddField "TRANS_STATUS,TRANS_AUTHEN,TRANS_TYPE,TRANS_DESC",""
		clsPubDB.Where = "TRANS_CODE_TYPE='" & strTCodeType & "' AND TRANS_NAME='" & strGetPost & "' AND TRANS_STYLE='" & GBL_strStyle & "'"
		clsPubDB.SQLRSExecute()
		Call ResultExecute(clsPubDB.intErrNum,"get trans","ES_ERR")
		If clsPubDB.intRSNum = 0 Then
			Call ResultExecute(10,"Now Trans:" & strGetPost,"ES_ERR")
			Exit Sub
		End If
		intGetAuthen = clsPubDB.objPubRS("TRANS_AUTHEN")
		intGetStatus = clsPubDB.objPubRS("TRANS_STATUS")
		intGetType = clsPubDB.objPubRS("TRANS_TYPE")
		strGetDesc = clsPubDB.objPubRS("TRANS_DESC")

	Else

		strTmp = GetConfig(Application(GBL_strCookieURL & "APP_TRANS"),strGetPost)
		If strTmp = "" Then
			Call ResultExecute(E_USER_PUB,"错误的页面栏目请求","ES_ERR")
			Exit Sub
		End If
		'== divider 0x1e
		strTmp1 = Split(strTmp,CONST_DIVIDER2)
		intGetAuthen = Cint(strTmp1(0))
		intGetStatus = Cint(strTmp1(1))
		intGetType = Cint(strTmp1(2))

	End If

	
	'== Check this trans open status
	If intGetStatus = 1 Then
		Call ResultExecute(16,strGetDesc,"ES_ERR")
		Exit Sub
	End If

	'== Check this trans auThen status
	Call AuThenCheck(intGetAuthen)

	'== Do function of this trans
	If intGetType = 0 Then

		'== Update view counter
		'Call ViewCount(strPageName)
		Call ExecFuncSwitch(strPageName)

	ElseIf intGetType = 1 Then

		'== Update view counter
		Call ViewCount(strPageName)

		'== Wide content execute
		If Left(CONST_PAGE_FILE, 6) = "forum/" Then
			Call PageMainStyleForum(strPageName)
		ElseIf CONST_PAGE_FILE = "meet/meet_detail.asp" Then
			Call PageMainStyleMeet(strPageName)
		Else
			Call PageMainStyle(strPageName)
		End If

	Else

		Call ResultExecute(10,strGetPost,"ES_ERR")

	End If

End Sub
'============== End of Sub ExecOrShowSwitch() ======================
'===================================================================
'= Sub    : 						ShowPage(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName)
'= Time        : Created At May,17,2003
'= Input       : None

'= Called by   : ShowBoard(),etc
'= Calls       : None
'= Description : Form feed show 
'===================================================================
Sub ShowPage(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName)
	Dim n
	Dim strAddType		'== 附加传输值
	
	'== 是否有变量传递
	strAddType = Trim(Request.QueryString("pstAddType"))
	strAddType = ""

	If intToTalNumber Mod intMaxPerPage = 0 Then
		n = intToTalNumber \ intMaxPerPage
	Else
		n = intToTalNumber \ intMaxPerPage + 1
	End If
	Response.Write "<tr align=right><td><table><tr><td>"
	Response.Write "<form method='Post' action=" & strFileName & "  name='frmGo' id='frmGo' onsubmit='return CheckGoForm()'>"
	Response.Write "<p align=center>"
	If intCurrentPage < 2 Then
		Response.Write "首页 上一页 "
	Else
		Response.Write "<a href=" & strFileName & "&intPageNow=1" & strAddType & ">  首页</a>&nbsp;"
		Response.Write "<a href=" & strFileName & "&intPageNow=" & intCurrentPage - 1  & strAddType & ">上一页 </a>"
	End If
	If n - intCurrentPage < 1 Then
		Response.Write "下一页 尾页 "
	Else
		Response.Write "<a href=" & strFileName & "&intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
		Response.Write "下一页</a> <a href=" & strFileName & "&intPageNow=" & n   & strAddType & ">尾页 </a>"
	End If
	Response.Write "第<font color=red>" & intCurrentPage & "</font>/" & n & "页 "
	Response.Write "" & intTotalNumber & "条 " & intMaxPerPage & "条/页 "
	Response.Write " <input type='text' name='intPageNow' size=2 maxlength=4 value=" & intCurrentPage & " >"
	Response.Write " <input type='submit'  value='Go'  name='subGo' class='CSS_IPT_BTN_SMALL'></p></form>"
	Response.Write "</td></tr></table></td></tr>"

End Sub
'============== End of Sub ShowPage() ==============================
'===================================================================
'= Sub    : 						ShowPage2(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName,intShowFlag)
'= Time        : Created At May,17,2003
'= Input       : None

'= Called by   : ShowBoard(),etc
'= Calls       : None
'= Description : Form feed show 
'===================================================================
Sub ShowPage2(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName,intShowFlag)
	Dim n
	Dim strAddType		'== 附加传输值
	
	'== 是否有变量传递
	strAddType = Trim(Request.QueryString("pstAddType"))
	strAddType = ""

	If intToTalNumber Mod intMaxPerPage = 0 Then
		n = intToTalNumber \ intMaxPerPage
	Else
		n = intToTalNumber \ intMaxPerPage + 1
	End If
	Response.Write "<table width=100% ><tr align=center><td align=center>"
	Response.Write "<form  action=" & strFileName & "  name=frmGo2 id='frmGo2' >"
	Response.Write "<p align=center>"
	'Response.Write "共" & n & "页&nbsp;"
	If intCurrentPage < 2 Then
		Response.Write "上一页 "
	Else
		'Response.Write "<a href=" & strFileName & "&intPageNow=1" & strAddType & ">  首页</a>&nbsp;"
		Response.Write "<a href=" & strFileName & "&intPageNow=" & intCurrentPage - 1  & strAddType & ">上一页</a>&nbsp;"
	End If
	If n - intCurrentPage < 1 Then
		Response.Write "下一页&nbsp;"
	Else
		Response.Write "<a href=" & strFileName & "&intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
		Response.Write "下一页</a>&nbsp;"
		'Response.Write "<a href=" & strFileName & "&intPageNow=" & n   & strAddType & ">尾页 </a>"
	End If

	If intShowFlag = 1 Then
		Response.Write "<font color=red>" & intCurrentPage & "</font>/" & n & " "
	End If

	Response.Write "" & intTotalNumber & "条&nbsp;" & intMaxPerPage & "条/页&nbsp;"

	If intShowFlag <> 1 Then
		Response.Write "<select name=strPageSelect onchange=""document.location.href='" &  strFileName & "&intPageNow=" & "'+document.frmGo2.strPageSelect.options[document.frmGo2.strPageSelect.selectedIndex].value"">" & strAddType 

		For i = 1 To n
			If i = intCurrentPage Then
				Response.Write "<option value=" & i & " selected>第" & i & "页</option>"
			Else
				Response.Write "<option value=" & i & ">第" & i & "页</option>"
			End If
		Next
		Response.Write "</select>"
	End If

	Response.Write "</p></form>"
	Response.Write "</td></tr></table>"

End Sub
'============== End of Sub ShowPage2() ==============================
'===================================================================
'= Function    : AuThenCheck(intAuThen)
'= Time        : Created At Nov,12,2003
'= Input       : None

'= Called by   :
'= Calls       : 
'= Description : user check
'===================================================================
Function AuThenCheck(intAuThen)
	
	Dim intAuthenNow
	Dim strUser,strPwd

	strUser = Trim(Request.Cookies(GBL_strCookieURL)("user"))
	strPwd = Trim(Request.Cookies(GBL_strCookieURL)("pass"))
	
	If Not IsEmpty(Session(GBL_strCookieURL & "SEN_strUserAuThen")) Then
		If IsNumeric(Session(GBL_strCookieURL & "SEN_strUserAuThen")) Then
			intAuthenNow = Cint(Session(GBL_strCookieURL & "SEN_strUserAuThen"))
		Else
			intAuthenNow = -1
		End If
	Else
		intAuthenNow = -1
	End If
	
	'== open for all (include guest)
	If intAuThen = 9 Then

		If CONST_PAGE_FILE = "user/user_login_form.asp" Or CONST_PAGE_FILE = "user/user_announce.asp" Or CONST_PAGE_FILE = "user/user_reg_form.asp" Then
			Exit Function
		End If

		'== check cookie exsit
		If (Not IsEmpty(strUser)) And _
			(strUser <> "") And _
			Not IsEmpty(strPwd) And _
			(strPwd <> "") And _
			(IsEmpty(Session(GBL_strCookieURL & "SEN_UserId")) Or _
			Session(GBL_strCookieURL & "SEN_UserId") = "") _
		Then
			If CheckPass(strUser,strPwd,1) Then
				Set clsPubDB = Nothing
				Response.Redirect GBL_strHomeUrl & "user/user_info_show.asp?action=ShowUserAllInfo"
				Exit Function
			Else
				'== destory cookie
				Response.Cookies(GBL_strCookieURL)("user") = ""
				Response.Cookies(GBL_strCookieURL)("pass") = ""
				Response.Cookies(GBL_strCookieURL).Expires = Date - 1
				Set clsPubDB = Nothing
				Response.Redirect GBL_strHomeUrl & "user/user_login_form.asp?action=FormUserLogin"
				Exit Function
			End If
		Else
			Exit Function
		End If

	End If


	'== check the comm user
	If IsEmpty(Session(GBL_strCookieURL & "SEN_strUserRealName")) Or _
			IsEmpty(Session(GBL_strCookieURL & "SEN_UserId")) Or _
			IsEmpty(Session(GBL_strCookieURL & "SEN_strUserAccount")) Or _ 
			Session(GBL_strCookieURL & "SEN_strUserRealName") = "" Or _
			Session(GBL_strCookieURL & "SEN_UserId") = "" Or _
			Session(GBL_strCookieURL & "SEN_strUserAccount") = "" Then

			If CheckPass(strUser,strPwd,1) Then

				Set clsPubDB = Nothing
				Response.Redirect GBL_strHomeUrl & "user/user_info_show.asp?action=ShowUserAllInfo"
				Exit Function

			Else

				Set clsPubDB = Nothing
				Response.Redirect GBL_strHomeUrl & "user/user_login_form.asp?action=FormUserLogin"
				Exit Function
				
			End If

	End If

	'== check the administrator
	If intAuThen = 1 Then

		If intAuthenNow <> intAuThen Then 
			Call ResultExecute(18,"管理员权限","ES_ERR")
			Exit Function
		End If

	End If

End Function
'=============== End of Function AuThenCheck() ======================
'===================================================================
'= Function     : CheckPass(strUserName,strUserPassword,intFlag)
'= Time		    : Created At Jun,16,2004
'= Input        : intFlag : 0 -- error redirect
'=							1 -- no error redirect
'= Output       : 
'= Called by    : 
'= Calls        : 
'= Return       : 
'= Description  : check username and pwd by login and cookie
'===================================================================
Function CheckPass(strUserName,strUserPassword,intFlag)

	CheckPass = False

	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_USER"
	clsPubDB.SQLType = "SELECT"
	clsPubDB.Where = "USER_ACCOUNT='" & strUserName & "'"
	clsPubDB.AddField "USER_REALNAME,USER_ID,USER_IS_MASTER,USER_AUTHEN,USER_PASSWORD,USER_ACCOUNT",""
	clsPubDB.SQLRSExecute()
	Call ResultExecute(clsPubDB.intErrNum,"","ES_ERR")

⌨️ 快捷键说明

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