📄 common.asp
字号:
<%
Private Function userCode(ByVal strUsername)
Randomize Timer
strUserCode = strUsername & hexValue(15)
strUserCode = formatSQLInput(strUserCode)
strUserCode = Replace(strUserCode, "''", "'", 1, -1, 1)
userCode = strUserCode
End Function
Private Function hexValue(ByVal intHexLength)
Dim intLoopCounter
Dim strHexValue
Randomize Timer
For intLoopCounter = 1 to intHexLength
intHexLength = CInt(Rnd * 1000) Mod 16
Select Case intHexLength
Case 1
strHexValue = "1"
Case 2
strHexValue = "2"
Case 3
strHexValue = "3"
Case 4
strHexValue = "4"
Case 5
strHexValue = "5"
Case 6
strHexValue = "6"
Case 7
strHexValue = "7"
Case 8
strHexValue = "8"
Case 9
strHexValue = "9"
Case 10
strHexValue = "A"
Case 11
strHexValue = "B"
Case 12
strHexValue = "C"
Case 13
strHexValue = "D"
Case 14
strHexValue = "E"
Case 15
strHexValue = "F"
Case Else
strHexValue = "Z"
End Select
hexValue = hexValue & strHexValue
Next
End Function
Private Function disallowedMemberNames(ByVal strUserName)
strUsername = Replace(strUsername, "salt", "", 1, -1, 1)
strUsername = Replace(strUsername, "password", "", 1, -1, 1)
strUsername = Replace(strUsername, "author", "", 1, -1, 1)
strUsername = Replace(strUsername, "code", "", 1, -1, 1)
strUsername = Replace(strUsername, "username", "", 1, -1, 1)
strUsername = Replace(strUsername, "NoAct", "", 1, -1, 1)
disallowedMemberNames = strUsername
End Function
Private Function decodeString(ByVal strInputEntry)
strInputEntry = Replace(strInputEntry, "=", "=", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "a", "a", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "b", "b", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "c", "c", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "d", "d", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "e", "e", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "f", "f", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "g", "g", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "h", "h", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "i", "i", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "j", "j", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "k", "k", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "l", "l", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "m", "m", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "n", "n", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "o", "o", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "p", "p", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "q", "q", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "r", "r", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "s", "s", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "t", "t", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "u", "u", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "v", "v", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "w", "w", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "x", "x", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "y", "y", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "z", "z", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "A", "A", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "B", "B", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "C", "C", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "D", "D", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "E", "E", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "F", "F", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "G", "G", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "H", "H", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "I", "I", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "J", "J", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "K", "K", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "L", "L", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "M", "M", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "N", "N", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "O", "O", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "P", "P", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Q", "Q", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "R", "R", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "S", "S", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "T", "T", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "U", "U", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "V", "V", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "W", "W", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "X", "X", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Y", "Y", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Z", "Z", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "0", "0", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "1", "1", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "2", "2", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "3", "3", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "4", "4", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "5", "5", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "6", "6", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "7", "7", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "8", "8", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "9", "9", 1, -1, 0)
decodeString = strInputEntry
End Function
Private Function updateTopicPostCount(ByVal intForumID)
Dim rsCount
Dim lngNumberOfTopics
Dim lngNumberOfPosts
lngNumberOfTopics = 0
lngNumberOfPosts = 0
Set rsCount = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT Count(timestopic.bbsid) AS Topic_Count "
strSQL = strSQL & "From timestopic "
strSQL = strSQL & "WHERE timestopic.bbsid = " & intForumID & " "
rsCount.Open strSQL, adoCon
If NOT rsCount.EOF Then lngNumberOfTopics = CLng(rsCount("Topic_Count"))
rsCount.Close
strSQL = "SELECT Count(timespost.postid) AS Thread_Count "
strSQL = strSQL & "FROM timestopic INNER JOIN timespost ON timestopic.topicid = timespost.topicid "
strSQL = strSQL & "GROUP BY timestopic.bbsid "
strSQL = strSQL & "HAVING (((timestopic.bbsid)=" & intForumID & "));"
rsCount.Open strSQL, adoCon
If NOT rsCount.EOF Then lngNumberOfPosts = CLng(rsCount("Thread_Count"))
rsCount.Close
Set rsCount = Nothing
strSQL = "UPDATE timesbbs SET "
strSQL = strSQL & "timesbbs.topicnum = " & lngNumberOfTopics & ", timesbbs.postnum = " & lngNumberOfPosts
strSQL = strSQL & " WHERE timesbbs.bbsid= " & intForumID & ";"
adoCon.Execute(strSQL)
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -