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

📄 inc_pub_func.asp

📁 1] 校友多种方式注册认证[直接注册,答问注册,认证注册] 2] 校友论坛 小巧而实用的论坛,支持UBB标签,快速回复,帖子搜索,灵活的将帖子置顶,设置精华 3] 校友相册 相片上传[方便上传
💻 ASP
📖 第 1 页 / 共 5 页
字号:
<%
'===================================================================
'= ASP FILENAME	: /inc/pub_func.asp
'= CREATED TIME : AUG,6,2003
'= LAST MODIFIED: AUG,6,2003
'= VERSION INFO : CCASP Framework Ver 2.0.1 ALL RIGHTS RESERVED BY www.cclinux.com
'= DESCRIPTION  : 通用主体函数库
'= Change Log:
'===================================================================
%>
<!-- #include  file="../inc/inc_debug.asp" -->
<%
'=============== FUNCTION BODY BEGIN ===============================
'===================================================================
'= Sub          : SiteHead(strPageName) 
'= Time		    : Created At 9,11,2003
'= Input        : 
'= Output       : 
'= Called by    : All pages in this website
'= Calls        : 
'= Description  : All page's <head>
'===================================================================
Sub SiteHead(strPageName)

	Const CONST_PAGE_STYLE = ",,>> , <<,::    ,    ::,^-^,^-^,::::::,::::::"
	Dim strPageStyle,intStyle
	Dim strHtmlCode

	'== Style of page's IE title
	strPageStyle = split(CONST_PAGE_STYLE,",")
	intTitleStyle = GBL_intTitleStyle
	Response.Write strHtmlCode
	strHtmlCode = ""
%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<meta http-equiv="Content-Language" content="zh-cn">
	<meta name="description" content="<% =GBL_strSiteName %>">
	<meta name="keywords" content="校友网,校友活动,同学录,校友录,校友,学子,游子,<% =GBL_strClassName %>,<% =CONST_WEB_VER %>">
	<title>
		<% 
		=strPageStyle(intTitleStyle*2-2) & GBL_strSiteName & " -- " & strPageName & strPageStyle(intTitleStyle*2-1) 
		%>
	</title>
	<link rel="stylesheet" type="text/css" href="<% =GBL_strHomeUrl %>style/<% =GBL_strStyle %>/style.css" >
	<style>
	</style>
</head>
<%
	Call HeadSpecialStyle(strPageName)

End Sub
'================ End of Sub SiteHead() ============================
'===================================================================
'= Sub          : HeadSpecialStyle(strPageName) 
'= Time		    : Created At 10,10,2003
'= Input        : 
'= Output       : 
'= Called by    : All pages in this website
'= Calls        : 
'= Description  : Some page's <head> special style
'===================================================================
Sub HeadSpecialStyle(strPageName)
%>
	<!-- 提示窗口 层定义 -->
	<div id='divClew' style='Z-INDEX: 2; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; '></div>
<%
End Sub
'================= End of Sub HeadSpecialStyle() ===================
'===================================================================
'= Sub          : SiteBottom(strPageName) 
'= Time		    : Created At 10,11,2003
'= Input        : 
'= Output       : 
'= Called by    : All pages in this website
'= Calls        : 
'= Description  : All page's bottom infomation(such as copyright)
'===================================================================
Sub SiteBottom(strPageName)

	Dim strShowView

	strShowView = "从" & FormatDateTime (GBL_strHomeViewBegin,1) & "起已有" & GBL_intHomeViewCount & "人次访问过本页"
	If GBL_strUserAuthen = 1 Then
		strShowView = strShowView & ",昨日:" & GBL_intHomeLastViewCount & ",今日:" & GBL_intHomeTodayViewCount
	End If
	%>
	<center>
	<br>
	<a href="#" onClick="window.external.addFavorite('<%=GBL_strSiteHome%>','<%=GBL_strSiteName%>')" title="将<%=GBL_strSiteName%>添加到收藏夹">加入收藏</a> | 关于本站 |
	<a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<%=GBL_strSiteHome%>');" title="将设置<%=GBL_strSiteName%>为浏览器首页">设为首页</a> | <a  href="mailto:<%=GBL_strAdminEmail%>" title="给<%=GBL_strSiteName%>的管理员发邮件">与我联系</a>
	 | <a href="<% =GBL_strHomeURL%>admin/index.asp" title="管理员专用">管理入口</a>
	<br>
	Copyright <font size=2>&copy;</font> 2002-<%=year(date)%>&nbsp;<% =GBL_strClassName %> 版权所有
	<a href="http://www.cclinux.com" target=_blank><% =CONST_WEB_VER %></font></a>
	<%
	'== 04/02
	If  CONST_PAGE_FILE = "/index1.asp" Then
		Response.Write "<br>" & strShowView 
	End If
	
	%>
	<br>
	<%
		GBL_PageExeTime = FormatNumber(cCur(Timer - GBL_PageExeTime),3,True)
		Response.Write "&nbsp;Server:" & GBL_PageExeTime*1000 & "Ms"

		If CTL_DB_NUM Then
			Response.Write "&nbsp;&nbsp;DB:" & GBL_intDBNum
		End If
	%>
	<script language=javascript>
	// end flag of web finished
	EndFlag = 1;
	</script>
	 </center>
	<%

	'== debug for db 
	Call ShowDBDebug(clsPubDB)

End Sub

'====================================================================
'= Sub	        : ShowFuncSwitch(strPageName) 
'= Time		    : Created At 9,13,2003
'= Input        : 
'= Output       : 
'= Called by    : PageMainStyle(strPageName),HomeMainStyle(strPageName)
'= Calls        : None
'= Description  : 根据不同的页面请求来确定网页栏目显示和数据处理的分拣主函数
'====================================================================
Sub ShowFuncSwitch(strPageName,intFlag)

	'== intFlag : 0-MainColumn 1-Title 2-SmallColumn 3-Obligate
	Dim strFuncName
	Dim arrTmp
	Dim intTop,intBg,intBottom
	Dim strTop,strBg,strBottom
	Dim strMenu,strFunc

	If strPageName = "/err.asp" Then
		Call ShowFuncSingle("ShowErr")
		Exit Sub
	End If

	If strPageName = "/succ.asp" Then
		Call ShowFuncSingle("ShowSucc")
		Exit Sub
	End If

	strFuncName = Trim(Request("action"))
	'== web page trans
	strFunc = strFuncName

	If CONST_TRANS_SHOW = 0 Then

		clsPubDB.Clear()
		clsPubDB.TableName = "CLASS_TRANS"
		clsPubDB.SQLType = "SELECT"
		clsPubDB.AddField "TRANS_FUNC_MENU",""
		clsPubDB.Where = "TRANS_NAME='" & strFuncName & "' AND TRANS_TYPE=1 AND TRANS_STYLE='" & GBL_strStyle & "'"
		clsPubDB.SQLRSExecute()
		Call ResultExecute(clsPubDB.intErrNum,"show func","ES_ERR")
		If clsPubDB.intRSNum = 0 Then
			Call ResultExecute(10,"show func","ES_ERR")
			Exit Sub
		End If

		strMenu = clsPubDB.objPubRS("TRANS_FUNC_MENU")

	Else
		
		strMenu = GBL_strDefMenu

	End If

	If strMenu <> "" Then
		arrTmp = Split(strMenu,"|")
		For i = LBound(arrTmp) To UBound(arrTmp)
			Call ShowFuncOne(arrTmp(i))
			Response.Write "<br>"
		Next
	End If

	Call ShowFuncOne(strFunc)

End Sub
'================ End of Sub ShowFunctionSwitch() ===================
'====================================================================
'= Sub	        : ShowFuncOne(strFuncName) 
'= Time		    : Created At 9,13,2003
'= Input        : 发交易请求名(strPageName)
'= Output       : 
'= Called by    : 
'= Calls        : None
'= Description  : 根据不同的页面请求来确定网页栏目显示和数据处理的分拣主函数
'= Up History   : 2004/04/29 去掉本函数功能 提高速度
'====================================================================
Sub ShowFuncOne(strFuncName)

	Execute strFuncName & "()"
		
End Sub
'============== End of Func ShowFuncOne(strFuncName) ===============

Sub ActionView(Action)
	Execute Action & "()"
End Sub
'===================================================================
'= Function    : ExecFuncSwitch(strPageName)
'= Time		   : Created At SEP,2,2003
'= Input       : The page file name

'= Called by   : All index.asp
'= Calls       : 
'= Description : Data execute(no display)
'===================================================================
Sub ExecFuncSwitch(strPageName)
	Dim strGetPost

	strGetPost = Trim(Request.QueryString("action"))

	'== check page submit from .
	If Not CheckPageSubmit Then
		Call ResultExecute(E_USER_PUB,"禁止从站点外部提交数据","ES_ERR")
		Exit Sub
	End If
	Execute strGetPost & "()"
End Sub
'============== End of Function BoardExeFunction() ==================
'====================================================================
'= Function     : CheckPageSubmit()
'= Time		    : Created At Apr,18,2003
'= Input        : None
'= Output       : None
'= Called by    : 
'= Calls        : Server Functions
'= Return       : true or false
'= Description  : 防止外部页面数据提交
'====================================================================
Function CheckPageSubmit()
	
	Dim strPrePage,strLocalSvr

	strPrePage = Cstr(Request.ServerVariables("HTTP_REFERER"))
	strLocalSvr = Cstr(Request.ServerVariables("SERVER_NAME"))
	If Mid(strPrePage,8,Len(strLocalSvr)) <> strLocalSvr And strPrePage <> "" Then
		CheckPageSubmit = FALSE
	Else
		CheckPageSubmit = TRUE
	End If

End Function
'================== End of Func CheckPageSubmit() ===================
'===================================================================
'= Function    : CheckPostExist(strInPost)
'= Time		   : Created At Apr,04,2004
'= Input       : The page file name

'= Called by   : 
'= Calls       : 
'= Description : check the post is or not exist
'===================================================================
Sub CheckPostExist(strInPost)
	
	Dim	arrTmp,strGetPagePost
	Dim i

	strGetPagePost = Trim(Request.QueryString("action"))

	If strGetPagePost = "" Then
		Call ResultExecute(E_USER_PUB,"错误的页面栏目请求:<br>NULL","ES_ERR")
		Exit Sub
	End If

	arrTmp = Split(strInPost,",")
	For i = LBound(arrTmp) To UBound(arrTmp)
		If strGetPagePost = arrTmp(i) Then
			Exit Sub
		End If
	Next

	Call ResultExecute(E_USER_PUB,"错误的页面栏目请求:<br>" & strGetPagePost,"ES_ERR")

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

'= Called by   : All main page
'= Calls       : 
'= Description : 用户请求校验与分拣
'===================================================================
Sub ActionFilter(strPageName,Action)

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

	strGetDesc = "该功能"
	
	'== 更新在线用户情况
	Call GetNowOnline ()

	'== Get transation request
	strGetPost = 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)

⌨️ 快捷键说明

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