📄 inc_functions.asp
字号:
if (fM_POSTS < intRankLevel1) then Member_Level = Member_Level & strRankLevel0
if (fM_POSTS >= intRankLevel1) and (fM_POSTS < intRankLevel2) then Member_Level = Member_Level & strRankLevel1
if (fM_POSTS >= intRankLevel2) and (fM_POSTS < intRankLevel3) then Member_Level = Member_Level & strRankLevel2
if (fM_POSTS >= intRankLevel3) and (fM_POSTS < intRankLevel4) then Member_Level = Member_Level & strRankLevel3
if (fM_POSTS >= intRankLevel4) and (fM_POSTS < intRankLevel5) then Member_Level = Member_Level & strRankLevel4
if (fM_POSTS >= intRankLevel5) then Member_Level = Member_Level & strRankLevel5
case "2"
Member_Level = Member_Level & strRankMod
case "3"
Member_Level = Member_Level & strRankAdmin
case else
Member_Level = Member_Level & "Error"
end select
end if
getMember_Level = Member_Level
end function
'############## This Function Append By Guozi ##############
'### [GetUserIDGlowColor] ###
'###########################################################
function GetUserIDGlowColor(fM_TITLE, fM_LEVEL, fM_POSTS)
dim idGlowColor
idGlowColor = "#A9B6CD"
if Trim(fM_TITLE) <> "" then
idGlowColor = "#9898BA"
else
select case fM_LEVEL
'一般用户
case "1"
if (fM_POSTS < intRankLevel1) then
idGlowColor = "#A9B6CD"
else
idGlowColor = "#9898BA"
end if
'论坛版主
case "2"
idGlowColor = "#cccccc"
'系统管理员
case "3"
idGlowColor = "#9898BA"
end select
end if
GetUserIDGlowColor = idGlowColor
end function
'-----------------------------------------------------------
'############## This Function Append By Guozi ##############
'### [GetUserIDFontColor] ###
'###########################################################
function GetUserIDFontColor(fM_TITLE, fM_LEVEL, fM_POSTS)
dim idFontColor
idFontColor = "#000066"
if Trim(fM_TITLE) <> "" then
idFontColor = "#990000"
else
select case fM_LEVEL
'一般用户
case "1"
if (fM_POSTS < intRankLevel1) then
idFontColor = "#333333"
else
idFontColor = "#000066"
end if
'论坛版主
case "2"
idFontColor = "#0000ff"
'系统管理员
case "3"
idFontColor = "#990000"
end select
end if
GetUserIDFontColor = idFontColor
end function
'-----------------------------------------------------------
function getStar_Level(fM_LEVEL, fM_POSTS)
dim Star_Level
Star_Level = ""
select case fM_LEVEL
case "1"
if (fM_POSTS < intRankLevel1) then Star_Level = Star_Level & ""
if (fM_POSTS >= intRankLevel1) and (fM_POSTS < intRankLevel2) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColor1 & ".gif border=0>"
if (fM_POSTS >= intRankLevel2) and (fM_POSTS < intRankLevel3) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColor2 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor2 & ".gif border=0>"
if (fM_POSTS >= intRankLevel3) and (fM_POSTS < intRankLevel4) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColor3 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor3 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor3 & ".gif border=0>"
if (fM_POSTS >= intRankLevel4) and (fM_POSTS < intRankLevel5) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColor4 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor4 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor4 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor4 & ".gif border=0>"
if (fM_POSTS >= intRankLevel5) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColor5 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor5 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor5 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor5 & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColor5 & ".gif border=0>"
case "2"
if fM_POSTS < intRankLevel1 then Star_Level = Star_Level & ""
if (fM_POSTS >= intRankLevel1) and (fM_POSTS < intRankLevel2) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0>"
if (fM_POSTS >= intRankLevel2) and (fM_POSTS < intRankLevel3) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0>"
if (fM_POSTS >= intRankLevel3) and (fM_POSTS < intRankLevel4) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0>"
if (fM_POSTS >= intRankLevel4) and (fM_POSTS < intRankLevel5) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0>"
if (fM_POSTS >= intRankLevel5) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorMod & ".gif border=0>"
case "3"
Star_Level = ""
if (fM_POSTS < intRankLevel1) then Star_Level = Star_Level & ""
if (fM_POSTS >= intRankLevel1) and (fM_POSTS < intRankLevel2) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0>"
if (fM_POSTS >= intRankLevel2) and (fM_POSTS < intRankLevel3) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0>"
if (fM_POSTS >= intRankLevel3) and (fM_POSTS < intRankLevel4) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0>"
if (fM_POSTS >= intRankLevel4) and (fM_POSTS < intRankLevel5) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0>"
if (fM_POSTS >= intRankLevel5) then Star_Level = Star_Level & "<img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0><img src=" & strImageURL & "icon_star_" & strRankColorAdmin & ".gif border=0>"
case else
Star_Level = Star_Level & "Error"
end select
getStar_Level = Star_Level
end function
'##############################################
'## Multi-Moderators ##
'##############################################
function chkForumModerator(fForum_ID, fMember_Name)
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS." & strDBNTSQLName & " = '" & fMember_Name & "'"
set rsUsrName = my_Conn.Execute (strSql)
if rsUsrName.EOF or rsUsrName.BOF or not(ChkQuoteOk(fMember_Name)) or not(ChkQuoteOk(fForum_ID)) then
chkForumModerator = "0"
rsUsrName.close
exit function
else
MEMBER_ID = rsUsrName("MEMBER_ID")
rsUsrName.close
end if
set rsUsrName = nothing
'## Forum_SQL
strSql = "SELECT * "
strSql = strSql & " FROM " & strTablePrefix & "MODERATOR "
strSql = strSql & " WHERE (FORUM_ID = " & fForum_ID & " "
strSql = strSql & " AND MEMBER_ID = " & MEMBER_ID & ") OR ("
strSQL= strSql & " MEMBER_ID = " & MEMBER_ID & " AND FORUM_ID = -1)"
set rsChk = my_Conn.Execute (strSql)
if rsChk.bof or rsChk.eof then
chkForumModerator = "0"
else
chkForumModerator = "1"
end if
rsChk.close
set rsChk = nothing
end function
'######################################
'# listForumModerators() 及
'# listForummanger()
'# 已经转移到 inc_functions2.asp 文件
'#
'# http://www.WormCN.net
'######################################
function getMemberName(fUser_Number)
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID = " & fUser_Number
set rsGetMemberID = my_Conn.Execute(strSql)
if rsGetMemberID.EOF or rsGetMemberID.BOF then
getMemberName = ""
else
if strAllowHTML <> "1" then
getMemberName = rsGetMemberID("M_NAME")
else
getMemberName = "<a href=""pop_profile.asp?mode=display&id="& fUser_Number & """ target=_blank>"
getMemberName = getMemberName & rsGetMemberID("M_NAME") & "</a>"
end if
end if
end function
function getMemberNumber(fUser_Name)
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_NAME = '" & fUser_Name & "'"
set rsGetMemberID = my_Conn.Execute(strSql)
if rsGetMemberID.EOF or rsGetMemberID.BOF then
getMemberNumber = -1
exit function
end if
getMemberNumber = rsGetMemberID("MEMBER_ID")
end function
'##############################################
'## NT Authentication ##
'##############################################
sub NTUser()
if Session(strCookieURL & "username")="" then
'## Forum_SQL
strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_LEVEL, " & strMemberTablePrefix & "MEMBERS.M_PASSWORD, " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_USERNAME = '" & Session(strCookieURL & "userid") & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.M_STATUS = " & 1
set rs_chk = my_conn.Execute (strSql)
if rs_chk.BOF or rs_chk.EOF then
strLoginStatus = 0
else
Session(strCookieURL & "username") = rs_chk("M_NAME")
if strSetCookieToForum = 1 then
Response.Cookies(strUniqueID & "User").Path = strCookieURL
end if
Response.Cookies(strUniqueID & "User")("Name") = rs_chk("M_NAME")
Response.Cookies(strUniqueID & "User")("Pword") = rs_chk("M_PASSWORD")
Response.Cookies(strUniqueID & "User")("Cookies") = ""
Response.Cookies(strUniqueID & "User").Expires = dateAdd("d", 30, strForumTimeAdjust)
Session(strCookieURL & "last_here_date") = ReadLastHereDate(Request.Form("Name"))
if strAuthType = "nt" then
Session(strCookieURL & "last_here_date") = ReadLastHereDate(Session(strCookieURL & "userID"))
end if
strLoginStatus = 1
mLev = cint(ChkUser2(Request.Cookies(strUniqueID & "User")("Name"), Request.Cookies(strUniqueID & "User")("Pword")))
if mLev = 4 then
Session(strCookieURL & "Approval") = "15916941253"
end if
end if
rs_chk.close
set rs_chk = nothing
end if
end sub
function ChkAccountReg()
'## Forum_SQL
strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.M_LEVEL, " & strMemberTablePrefix & "MEMBERS.M_USERNAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_USERNAME = '" & Session(strCookieURL & "userid") & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.M_STATUS = " & 1
set rs_chk = my_conn.Execute (strSql)
if rs_chk.BOF or rs_chk.EOF then
ChkAccountReg = "0"
else
ChkAccountReg = "1"
end if
rs_chk.close
set rs_chk = nothing
end function
sub NTAuthenticate()
dim strUser, strNTUser, checkNT
strNTUser = Request.ServerVariables("AUTH_USER")
strNTUser = replace(strNTUser, "\", "/")
if Session(strCookieURL & "userid") = "" then
strUser = Mid(strNTUser,(instr(1,strNTUser,"/")+1),len(strNTUser))
Session(strCookieURL & "userid") = strUser
end if
if strNTGroups="1" then
strNTGroupsSTR = Session(strCookieURL & "strNTGroupsSTR")
if Session(strCookieURL & "strNTGroupsSTR") = "" then
Set strNTUserInfo = GetObject("WinNT://"+strNTUser)
For Each strNTUserInfoGroup in strNTUserInfo.Groups
strNTGroupsSTR=strNTGroupsSTR+", "+strNTUserInfoGroup.name
NEXT
Session(strCookieURL & "strNTGroupsSTR") = strNTGroupsSTR
end if
end if
if strAutoLogon="1" then
strNTUserFullName = Session(strCookieURL & "strNTUserFullName")
if Session(strCookieURL & "strNTUserFullName") = "" then
Set strNTUserInfo = GetObject("WinNT://"+strNTUser)
strNTUserFullName=strNTUserInfo.FullName
Session(strCookieURL & "strNTUserFullName") = strNTUserFullName
end if
end if
end sub
function chkDisplayForum(fForum_ID)
if (mlev = 4) then
chkDisplayForum= true
exit function
end if
'## Forum_SQL - load the user list
strSql = "SELECT " & strTab
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -