<% Dim objRS, arrRank, iRank, rowColor, action, objCon, Rank, strSQL Dim userLevelNameMod, userLevelNameAdmin, starPicSuffix, modStar, adminStar if request.form<>"" or request.querystring<>"" then action = request.queryString("action") SELECT Case action Case "update" set objCon = server.createobject("adodb.connection") With objCon .open datastore for each Rank in request.form if instr(Rank, "LID_") or instr(Rank, "PostL_") or instr(Rank, "andor_") or instr(Rank, "ScoreL_") or instr(Rank, "title_") or Rank="update" then 'ignore else Dim RID:RID = replace(Rank,"RID_","") 'response.write replace(Rank,"RID_","")&"
"&vbcrlf strSQL = "Update pgd_Ranking SET LID="&request.form("LID_"&RID).item&", PostL="&request.form("PostL_"&RID).item&_ ", andor="&request.form("andor_"&RID).item&", scoreL="&request.form("scoreL_"&RID).item&_ ", title='"&SQLAccessInput(request.form("title_"&RID).item)&"' WHERE RID="&RID 'response.write strSQL&"
" .execute strSQL, , adCmdText+adExecuteNoRecords end if next .close End With set objCon = nothing Case "delRank" set objCon = server.createobject("adodb.connection") With objCon .open datastore .execute "DELETE pgd_Ranking WHERE RID="&request.queryString("RID"), , adCmdText+adExecuteNoRecords .close End With set objCon = nothing Case "add" set objCon = server.createobject("adodb.connection") With objCon .open datastore .execute "if not exists(SELECT * from pgd_Ranking WHERE LID = "&request.form("LID")&") Insert INTO pgd_Ranking VALUES ("&request.form("LID")&","&request.form("postL")&","&request.form("andor")&","&request.form("scoreL")&",'"&SQLAccessInput(request.form("title"))&"')", , adCmdText+adExecuteNoRecords .close End With set objCon = nothing Case "modifyDefault" set objCon = server.createobject("adodb.connection") With objCon .open datastore .execute "Update pgd_config SET userLevelNameMod='"&SQLAccessInput(request.form("userLevelNameMod"))&"', userLevelNameAdmin='"&SQLAccessInput(request.form("userLevelNameAdmin"))&"', starPicSuffix='"&SQLAccessInput(request.form("starPicSuffix"))&"', modStar='"&SQLAccessInput(request.form("modStar"))&"', adminStar='"&SQLAccessInput(request.form("adminStar"))&"'", , adCmdText+adExecuteNoRecords .close End With set objCon = nothing End SELECT end if Dim AppRanking set objRS = server.createobject("adodb.recordset") With objRS .open "SELECT LID, PostL, andor, ScoreL, Title, RID FROM pgd_Ranking Order by LID", datastore, , , adCmdText if not (.eof and .bof) then arrRank = .getrows .close .open "SELECT userLevelNameMod, userLevelNameAdmin, starPicSuffix, modStar, adminStar FROM pgd_Config", datastore, , , adCmdText userLevelNameMod = .fields(0).value userLevelNameAdmin = .fields(1).value starPicSuffix = .fields(2).value modStar = .fields(3).value adminStar = .fields(4).value .close End With set objRS = nothing AppRanking = _ vbcrlf&_ "var userLevelNameMod = """&JSEncode(""&userLevelNameMod)&""""&vbcrlf&_ "var userLevelNameAdmin = """&JSEncode(""&userLevelNameAdmin)&""""&vbcrlf&_ "var starPicSuffix = """&HTMLEncode(""&starPicSuffix)&""""&vbcrlf&_ "var modStar = """&HTMLEncode(""&modStar)&""""&vbcrlf&_ "var adminStar = """&HTMLEncode(""&adminStar)&""""&vbcrlf&_ "var strTitle = new Array()"&vbcrlf for iRank = 0 to ubound(arrRank,2) AppRanking = AppRanking&"strTitle ["&iRank+1&"] = """&HTMLEncode(""&arrRank(1,iRank))&chr(1)&andorsign(arrRank(2,iRank))&chr(1)&HTMLEncode(""&arrRank(3,iRank))&chr(1)&JSEncode(""&arrRank(4,iRank))&chr(1)&HTMLEncode(""&arrRank(0,iRank))&""""&vbcrlf next Application.lock Application(dbName&"AppRanking")=AppRanking Application.unlock %> User Ranking : <%= OutputCSS() %>
User Ranking :       Help

> <% if isArray(arrRank) then %> <% rowColor = tableAlt %> <% for iRank = 0 to ubound(arrRank,2) %> <% if rowColor = tableAlt then rowColor = tableinside else rowColor = tablealt %> > <% next %> <% end if %>
Member Ranking System
Rank Representation Post Limit or / and Score Limit Title
" name="LID_<%= arrRank(5,iRank) %>"><%= starPicSuffix %> Posts <= " name="PostL_<%= arrRank(5,iRank) %>"> Score <= " name="ScoreL_<%= arrRank(5,iRank) %>"> " name="title_<%= arrRank(5,iRank) %>"> <% If ubound(arrRank,2) <> 0 then %> <% End If %>

> >
Add Rank
Rank Representation Post Limit or / and Score Limit Title
<%= starPicSuffix %> Posts <= Score <=

> >
Modify Default Values
Default Admin Title Default Moderator Title Admin Star Moderator Star Default Star Suffix
" name="userLevelNameAdmin"> " name="userLevelNameMod"> " name="adminStar"> " name="modStar"> " name="starPicSuffix">