?? inc_pub_func.asp
字號(hào):
'== 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,"對(duì)不起,您沒(méi)有提交權(quán)限","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,"錯(cuò)誤的頁(yè)面欄目請(qǐng)求","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 "首頁(yè) 上一頁(yè) "
Else
Response.Write "<a href=" & strFileName & "&intPageNow=1" & strAddType & "> 首頁(yè)</a> "
Response.Write "<a href=" & strFileName & "&intPageNow=" & intCurrentPage - 1 & strAddType & ">上一頁(yè) </a>"
End If
If n - intCurrentPage < 1 Then
Response.Write "下一頁(yè) 尾頁(yè) "
Else
Response.Write "<a href=" & strFileName & "&intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
Response.Write "下一頁(yè)</a> <a href=" & strFileName & "&intPageNow=" & n & strAddType & ">尾頁(yè) </a>"
End If
Response.Write "第<font color=red>" & intCurrentPage & "</font>/" & n & "頁(yè) "
Response.Write "" & intTotalNumber & "條 " & intMaxPerPage & "條/頁(yè) "
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 & "頁(yè) "
If intCurrentPage < 2 Then
Response.Write "上一頁(yè) "
Else
'Response.Write "<a href=" & strFileName & "&intPageNow=1" & strAddType & "> 首頁(yè)</a> "
Response.Write "<a href=" & strFileName & "&intPageNow=" & intCurrentPage - 1 & strAddType & ">上一頁(yè)</a> "
End If
If n - intCurrentPage < 1 Then
Response.Write "下一頁(yè) "
Else
Response.Write "<a href=" & strFileName & "&intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
Response.Write "下一頁(yè)</a> "
'Response.Write "<a href=" & strFileName & "&intPageNow=" & n & strAddType & ">尾頁(yè) </a>"
End If
If intShowFlag = 1 Then
Response.Write "<font color=red>" & intCurrentPage & "</font>/" & n & " "
End If
Response.Write "" & intTotalNumber & "條 " & intMaxPerPage & "條/頁(yè) "
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 & "頁(yè)</option>"
Else
Response.Write "<option value=" & i & ">第" & i & "頁(yè)</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,"管理員權(quán)限","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")
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -