foundsql = "ORDER BY userpoint DESC,userid DESC"
Else
foundsql = "ORDER BY userlogin DESC,userid DESC"
End If
If grade > 0 Then
SQL = "SELECT TOP " & maxline & " userid,username,userpoint,userlogin FROM [NC_User] WHERE UserGrade=" & grade & " " & foundsql
Else
SQL = "SELECT TOP " & maxline & " userid,username,userpoint,userlogin FROM [NC_User] " & foundsql
End If
Set Rs = Newasp.Execute(SQL)
i = 0
strContent = ""
If Not (Rs.BOF And Rs.EOF) Then
strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
Do While Not Rs.EOF
If (i Mod 2) = 0 Then
ListStyle = Trim(styles) & 1
Else
ListStyle = Trim(styles) & 2
End If
username = "<a href=""" & Newasp.InstallDir & "user/userlist.asp?userid=" & Rs("userid") & """ target=""_blank"">" & Rs("username") & "</a>"
strContent = strContent & Newasp.MainSetting(23)
strContent = Replace(strContent, "{$ListStyle}", ListStyle)
strContent = Replace(strContent, "{$InstallDir}", Newasp.InstallDir)
strContent = Replace(strContent, "{$UserName}", username)
strContent = Replace(strContent, "{$username}", Rs("username"))
strContent = Replace(strContent, "{$UserID}", Rs("userid"))
strContent = Replace(strContent, "{$UserLogin}", Rs("userlogin"))
strContent = Replace(strContent, "{$UserPoint}", Rs("userpoint"))
Rs.MoveNext
i = i + 1
strContent = Replace(strContent, "{$OrderID}", i)
Loop
strContent = strContent & "</table>"
End If
Rs.Close: Set Rs = Nothing
LoadUserRank = strContent
End Function
''================================================
''函数名:ReadUserRank
''作 用:读取用户排行列表
''参 数:str ----原字符串
''================================================
Public Function ReadUserRank(ByVal str)
On Error Resume Next
Dim strTemp, i, sTempContent
Dim nTempContent, ArrayList
Dim arrTempContent, arrTempContents
strTemp = str
If InStr(strTemp, "{$ReadUserRank(") > 0 Then
sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadUserRank(", ")}", 1)
nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadUserRank(", ")}", 0)
arrTempContents = Split(sTempContent, "|||")
arrTempContent = Split(nTempContent, "|||")
For i = 0 To UBound(arrTempContents)
ArrayList = Split(arrTempContent(i), ",")
strTemp = Replace(strTemp, arrTempContents(i), LoadUserRank(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
Next
End If
ReadUserRa