<% function add00(mydouble) ds0 = round(mydouble,2) ds = cstr(ds0) if instr(ds,".") = 0 then ds = ds&".00" elseif instr(ds,".") = 1 then ds2 = ds ds = "0"&ds2 elseif (ds0 < 0) and instr(ds,".") = 2 then ds2 = abs(ds0) ds = "-"&add00(ds2) end if if len(ds) - instr(ds,".") < 2 then ds = ds&"0" end if add00 = ds end function %>
<%scriptcalled = request.ServerVariables("SCRIPT_NAME")%>

Statistics

<% if mdcuclass = "47" then sqloption = "" sqloption2 = "" else sqloption = " where ID <> '3446288'" sqloption2=" and ID <> '3446288'" end if 'Count members sqlm = "select count(name) as mc from information"&sqloption set rsm = conn.execute(sqlm) membercount=rsm("mc") 'Count members that post at least once sqlp = "select count(name) as tmp from information where postcount > 0"&sqloption2 set rsp = conn.execute(sqlp) totmp = rsp("tmp") 'Count total posts by members sqltp = "select sum(postcount) as totalpost from information"&sqloption set rstp = conn.execute(sqltp) totalpost=rstp("totalpost") 'Count total login times sqllc = "select sum(logincount) as totallogin from information"&sqloption set rslc = conn.execute(sqllc) totallogin=rslc("totallogin") 'Count members that registered sqlrc = "select count(name) as tmr from information where registerstatus=yes"&sqloption2 set rsrc = conn.execute(sqlrc) regd = rsrc("tmr") startdate = cdate(start) webage = date - startdate %>

<% strsort = request.QueryString("sort") if strsort <> "" then strsort = request.QueryString("sort")&" desc" else strsort = "logincount desc" sqlall = "select * from information"&sqloption&" order by "&strsort&",ID" set rsall = server.CreateObject("ADODB.RecordSet") rsall.open sqlall,conn,1,3 rsall.movefirst i = 1 do while not rsall.eof %> <% rsall.movenext i=i+1 loop rsall.close %>
Rank ชื่อ - สกุล ชื่อเล่น Login(ครั้ง) โพส (ครั้ง) Logon ครั้งสุดท้าย
<%=i%> <%=rsall("name")&" "&rsall("surname")%> <%=rsall("nickname")%>  <%=rsall("logincount")%> <%=rsall("postcount")%> <%=rsall("lastlogintime")%>