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

📄 inc_pub_func.asp

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

	strGetAim = Trim(strAim)
	strGetNow = Trim(strNow)
	arrTmp = Split(Trim(strGetAim),CONST_DIVIDER)

	For i = LBound(arrTmp) To UBound(arrTmp)

		arrTmp2 = Split(arrTmp(i),"=")
		If arrTmp2(0) = strGetNow Then	

			strTmp = Replace(Trim(arrTmp(i)),strGetNow,"")
			strTmp = Replace(strTmp,"=","")
			GetConfig = Trim(strTmp)
			Exit Function

		End If

	Next

	GetConfig = ""
    
End Function
'===================================================================
'= Function    : LostConfigExec()
'= Time		   : Created At Nov,4,2003
'= Input       : strTitle  : the title of form or column
'= Output      : 
'= Return      : The html code as "XX title XX"
'= Calls	   : None
'= Called by   : All functions and subs
'= Description : Making decorate of title
'===================================================================
Sub LostConfigExec()
End Sub
'=============== End of Sub LostConfigExec() =======================
'===================================================================
'= Function    : UpdateLevel(intLevelNum)
'= Time		   : Created At Nov,10,2003
'= Input       : intLevelNum : to add this level 
'= Output      : 
'= Calls	   : None
'= Called by   : the add new record function
'= Table       : Upate CLASS_USER.LEVEL
'= Description : Get user now level
'===================================================================
Sub UpdateLevel(intLevelNum)
	
	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_USER"
	clsPubDB.SQLType = "UPDATE"
	clsPubDB.Where = "USER_ID=" & Session(GBL_strCookieURL & "SEN_UserId") & " AND USER_ACCOUNT='" & Session(GBL_strCookieURL & "SEN_strUserAccount") & "'"
	clsPubDB.AddSet "USER_LEVEL=USER_LEVEL+" & intLevelNum
	clsPubDB.SQLExecute()
	Call ResultExecute(clsPubDB.intErrNum,"Level:" &  intLevelNum,"ES_ERR")

End Sub
'=============== End of Sub UpdateLevel()===========================
'===================================================================
'= Function    : ConvertLevel(intLevelNum)
'= Time		   : Created At July,4,2004
'= Input       : 
'= Output      : 
'= Calls	   : None
'= Called by   : 
'= Description : user level
'===================================================================
Function ConvertLevel(intLevelNum)

	Dim intBase 

	intBase = 50

	ConvertLevel = 0
	
	DEF_UserLevelPoints = Array(0,12,25,50,80,150,250,400,700,1000,1500,2500,5000,8000,12000,20000,30000,40000,50000,60000,99999)

	For i = Lbound(DEF_UserLevelPoints) To Ubound(DEF_UserLevelPoints)
		If i = Ubound(DEF_UserLevelPoints) Then
			ConvertLevel = i
			Exit For
		End If
		If intLevelNum >= DEF_UserLevelPoints(i) And intLevelNum < DEF_UserLevelPoints(i+1) Then
			ConvertLevel = i
			Exit For
		End If
	Next

End Function
'============== End of Func ConvertLevel() =========================
'===================================================================
'= Function    : RecordCounter(strTableName,strField,intCounter,strWhere)
'= Time		   : Created At Nov,10,2003
'= Input       : strTableName : the table name of db
'=				 strField     : the field name to update
'=				 intCounter   : the update value
'=				 strWhere     : the update record's condition
'= Output      : 
'= Calls	   : None
'= Called by   : the add new record function
'= Table       : Upate CLASS_USER.LEVEL
'= Description : Get user now level
'===================================================================
Sub RecordCounter(strTableName,strField,intCounter,strWhere)
	
	clsPubDB.Clear()
	clsPubDB.TableName = strTableName
	clsPubDB.SQLType = "UPDATE"
	clsPubDB.AddSet strField & "=" & strField & "+" & intCounter
	clsPubDB.Where = strWhere
	clsPubDB.SQLExecute()
	Call ResultExecute(clsPubDB.intErrNum,strField & " update"&clsPubDB.ReturnSQL(),"ES_ERR")

End Sub
'=============== End of Sub RecordCounter() ========================
'===================================================================
'= Function    : RecordDel(strTableName,strIdField,RSId)
'= Time		   : Created At Nov,10,2003
'= Input       : strTableName : the table name of db
'=				 strIdField   : the Id field name to delete
'=				 RSId		  : the del record's Id condition
'= Output      : 
'= Calls	   : None
'= Called by   : the add new record function
'= Table       : Upate CLASS_USER.LEVEL
'= Description : Get user now level
'===================================================================
Sub RecordDel(strTableName,strIdField,ByRef RSId)

	Dim intErrId 
	Dim strAddInfo

	intErrId = 0
	
	strAddInfo = "所要删除" & strTableName & "的"
	intErrId = DataCheck("DT_ID",RSId,strAddInfo,"")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	clsPubDB.Clear()
	clsPubDB.TableName = strTableName
	clsPubDB.SQLType = "DELETE"
	clsPubDB.Where = strIdField & "=" & RSId
	clsPubDB.SQLExecute()
	Call ResultExecute(clsPubDB.intErrNum,"del record :" & strIdField,"ES_ERR")

End Sub 
'=============== End of Sub RecordDel() ============================
'===================================================================
'= Function    : MakeUserClew(UserId,objRSNow,intDBFlag)
'= Time		   : Created At Nov,10,2003
'= Input       : UserId		: user's id
'=				 objRSNow   : the record object
'=				 intDBFlag  : whether or not need open rs
'=								1 -- no open ,exist
'=								0 -- need to open
'= Output      : 
'= Calls	   : None
'= Called by   : 
'= Table       : Query CLASS_USER
'= Return	   : Return user's info clew
'= Description : User Info clew
'===================================================================
Function MakeUserClew(UserId,objRSNow,intDBFlag)

	Dim strHtmlCode
	Dim objRSUser
	Dim strUserAuThen
	
	If intDBFlag = 0 Then
		objRSUser = objRSNow
	Else
		clsPubDB.Clear()
		clsPubDB.TableName = "CLASS_USER"
		clsPubDB.SQLType = "SELECT"
		clsPubDB.AddField "*",""
		clsPubDB.Where = "USER_ID=" & UserId 
		clsPubDB.SQLRSExecute()
		Call ResultExecute(clsPubDB.intErrNum,"show user's clew","ES_ERR")

		If clsPubDB.intRSNum = 0 Then
			MakeUserClew = "目前找不到该用户的任何资料"
			Exit Function
		End If
		objRSUser = clsPubDB.objPubRS
	End If

	strHtmlCode = "<table><tr>"
	strHtmlCode = strHtmlCode & "<td width=100>"
	strHtmlCode = strHtmlCode & "[用户]:" & objRSUser("USER_REALNAME")
	strHtmlCode = strHtmlCode & "</td><td width=100>"
	strHtmlCode = strHtmlCode & "[帐号]:" & objRSUser("USER_ACCOUNT")
	strHtmlCode = strHtmlCode & "</td><tr><td colspan=2>"
	strHtmlCode = strHtmlCode & "[注册日期]:" & objRSUser("USER_ADD_DATE")
	strHtmlCode = strHtmlCode & "</td><tr><td colspan=2>"
	strHtmlCode = strHtmlCode & "[最后访问]:" & objRSUser("USER_LAST_TIME")
	strHtmlCode = strHtmlCode & "</td><tr><td>"
	strHtmlCode = strHtmlCode & "[访问]:" & objRSUser("USER_LOGIN_COUNT") & "次"
	strHtmlCode = strHtmlCode & "</td><td>"
	strHtmlCode = strHtmlCode & "[留言]:" & objRSUser("USER_BOARD") & "条"
	strHtmlCode = strHtmlCode & "</td><tr><td>"
	'== Get user auThen
	If objRSUser("USER_AUTHEN") = 0 Then
		strUserAuThen = "普通用户" 
	ElseIf objRSUser("USER_AUTHEN") = 1 And objRSUser("USER_ACCOUNT") = GBL_strAdminAccount Then
		strUserAuThen = "管理员"
	ElseIf objRSUser("USER_AUTHEN") = 1 Then
		strUserAuThen = "副管理员"
	ElseIf objRSUser("USER_AUTHEN") = 8 Then
		strUserAuThen = "尚未批准加入的成员"
	End If
	strHtmlCode = strHtmlCode & "[权限]:" & strUserAuThen
	strHtmlCode = strHtmlCode & "</td><td>"
	strHtmlCode = strHtmlCode & "</td><tr><td colspan=2>"
	strHtmlCode = strHtmlCode & "[签名图]:" & "<center><img src=" & GBL_strHomeURL & objRSUser("USER_NOW_FACE") & " onload=DrawImage(this," & GBL_strUserFaceWidth & "," & GBL_strUserFaceHeight & ")></center>"
	'strHtmlCode = strHtmlCode & "</td><tr><td>"
	strHtmlCode = strHtmlCode & "<td></tr></table>"

	MakeUserClew = strHtmlCode

End Function
'=============== End of Sub MakeUserClew() =========================
'===================================================================
'= Function    : TimeFormat(strTime,strFmt))
'= Time		   : Created At Nov,10,2003
'= Input       : strFmt	 : the format flag
'=				 strTime : the time string
'= Output      : 
'= Calls	   : None
'= Called by   : 
'= Table       : Query CLASS_USER
'= Return	   : Return user's info clew
'= Description : User Info clew
'===================================================================
Function TimeFormat(strTime,strFmt)
	
	Dim strTmp

	Select Case strFmt 
		Case "YYMMDD"	:
			strTmp = DateValue(strTime)
			strTmp = Right(strTmp,Len(strTmp) - 2)
		Case "YYMMDDHHMI" :
			strTmp = Right(strTime,Len(strTime) - 2)
			strTmp = Left(strTmp,Len(strTmp) - 3)
		Case Else
			strTmp = strTime
	End Select

	TimeFormat = strTmp

End Function
'=============== End of Function TimeFormat() ======================
'===================================================================
'= Function    : ViewCount(strTime,strFmt))
'= Time		   : Created At Nov,10,2003
'= Input       : strPageName : the count page name 
'= Output      : 
'= Calls	   : None
'= Called by   : 
'= Table       : Query CLASS_COUNT
'= Return	   : Return view
'===================================================================
Function ViewCount(strPageName)

	Dim strUserIp
	Dim intMonth,intDay,intTotal
	Dim intLastMonth,intLastDay

	'== 06/24  only count views at homepage
	If  CONST_PAGE_FILE <> "/index1.asp" Then
		Exit Function
	End If

	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_COUNT"
	clsPubDB.SQLType = "SELECT"
	clsPubDB.Where = "COUNT_PAGE_NAME='" & CONST_PAGE_FILE & "' AND COUNT_POST_NAME='" & Trim(Request.QueryString("action")) & "'"
	clsPubDB.AddField "COUNT_ID",""
	clsPubDB.SQLRSExecute()
	Call ResultExecute(clsPubDB.intErrNum,"select count view","ES_ERR")
	If clsPubDB.intRSNum <> 1 Then

		'== delete all record
		clsPubDB.Clear()
		clsPubDB.TableName = "CLASS_COUNT"
		clsPubDB.SQLType = "DELETE"
		clsPubDB.Where = "COUNT_PAGE_NAME='" & CONST_PAGE_FILE & "' AND COUNT_POST_NAME='" & Trim(Request.QueryString("action")) & "'"
		clsPubDB.SQLExecute()
		Call ResultExecute(clsPubDB.intErrNum,"delete count view","ES_ERR")

		'== insert a new formatted record
		clsPubDB.Clear()
		clsPubDB.TableName = "CLASS_COUNT"
		clsPubDB.SQLType = "INSERT"
		clsPubDB.AddField "COUNT_PAGE_NAME",CONST_PAGE_FILE
		clsPubDB.AddField "COUNT_POST_NAME",Trim(Request("action"))
		clsPubDB.SQLExecute()
		Call ResultExecute(clsPubDB.intErrNum,"insert count view"&clsPubDB.ReturnSQL(),"ES_ERR")

	End If

	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_COUNT"
	clsPubDB.SQLType = "SELECT"
	clsPubDB.AddField "*",""
	clsPubDB.Where = "COUNT_PAGE_NAME='" & CONST_PAGE_FILE & "' AND COUNT_POST_NAME='" & Trim(Request.QueryString("action")) & "'"
	clsPubDB.SQLRSExecute()
	Call ResultExecute(clsPubDB.intErrNum,"select count view2","ES_ERR")

	intLastMonth = clsPubDB.objPubRS("COUNT_LAST_MONTH")
	intLastDay = clsPubDB.objPubRS("COUNT_LAST_DAY")
	intMonth = clsPubDB.objPubRS("COUNT_MONTH")
	intDay = clsPubDB.objPubRS("COUNT_DAY")
	intTotal = clsPubDB.objPubRS("COUNT_TOTAL_VIEW")
	
	'== set show value of view count and begin time
	GBL_intHomeViewCount = intTotal
	GBL_intHomeLastViewCount = intLastDay
	GBL_intHomeTodayViewCount = intDay
	GBL_strHomeViewBegin = clsPubDB.objPubRS("COUNT_ADD_TIME")

	If Cstr(Month(clsPubDB.objPubRS("COUNT_LAST_TIME"))) <> Cstr(Month(Date())) Then
		intLastMonth = clsPubDB.objPubRS("COUNT_MONTH")
		intMonth = 1
	Else
		If Cstr(Day(clsPubDB.objPubRS("COUNT_LAST_TIME"))) <> Cstr(Day(Date())) Then
			intLastDay = clsPubDB.objPubRS("COUNT_DAY")
			intDay = 1
		End If
	End If

	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_COUNT"
	clsPubDB.SQLType = "UPDATE"
	clsPubDB.Where = "COUNT_PAGE_NAME='" & CONST_PAGE_FILE & "' AND COUNT_POST_NAME='" & Trim(Request.QueryString("action")) & "'"
	clsPubDB.AddField "COUNT_TOTAL_VIEW",intTotal + 1
	clsPubDB.AddField "COUNT_DAY",intDay + 1
	clsPubDB.AddField "COUNT_MONTH",intMonth + 1
	clsPubDB.AddField "COUNT_LAST_TIME",Now()

	clsPubDB.AddField "COUNT_LAST_MONTH",intLastMonth
	clsPubDB.AddField "COUNT_LAST_DAY",intLastDay

	'== del real ip record
	'If Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" Then
	'		strUserIp = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
	'Else
	'		strUserIp = Request.ServerVariables("REMOTE_ADDR")
	'End If
	'clsPubDB.AddField "COUNT_LAST_IP",strUserIp

	clsPubDB.SQLExecute()
	Call ResultExecute(clsPubDB.intErrNum,"update counter","ES_ERR")
	
End Function
'=============== End of Function ViewCount() =======================
'=====================================================================
'= Function     : GetNowOnline()
'= Time		    : Created At Nov,29,2003
'= Input        : None
'= Output       : None
'= Called by    : 
'= Calls        : 
'= Table        : Query CLASS_USER,Update CLASS_ONLINE
'= Return       : 
'= Description  : get now online user and guest and into db
'=====================================================================
Function GetNowOnline()

⌨️ 快捷键说明

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