<% call doWebHead() call doSkinParse("online","") call doWebEnd() sub doPageLoad() ctl.loadUI() cp.title="与我在线" cp.subtitle="在线列表" cp.module="" end sub sub doPageParse() doOnlineList() end sub sub doOnlineList() listData.setDataCfg "url","online.asp" listData.setListNum(10) listData.setDataDB "table","db_user_online" listData.setDataDB "id","tim_update" listData.setDataDB "field","*" 'listData.setDataDB "query","username='"&user.username&"'" listData.setDataDB "order","tim_update desc" listData.setDataDB "orders","tim_update asc" listData.doLoad() listData.doParse() if listData.isData() then listData.dTable.doAppendFields("iscurrent,username") dim tmpiscurrent,tmpSessionid,tmpUserid,tmpUsername,tmpUserids if not user.isLogin() then tmpSessionid=ops.client.getSessionID listData.doBegin() do while listData.isNext() tmpUserid=listData.getItemInt("userid") tmpiscurrent="" if user.isLogin() then if user.userid=tmpUserid then tmpiscurrent="yes" else if tmpSessionid=listData.getItemInt("sessionid") then tmpiscurrent="yes" end if listData.setItem "iscurrent",tmpiscurrent listData.setItem "ip",linkURL.toIP("."&listData.getItem("ip"),user.getDataInt("grade")) if int(tmpUserid)>0 then tmpUserids=tmpUserids&(","&tmpUserid) loop listData.doBegin() if len(tmpUserids)>0 then tmpUserids=mid(tmpUserids,2) if len(tmpUserids)>0 then dim tmpTreeUser set tmpTreeUser=ops.db.getQueryTree("!select userid,username from db_user where userid in ("&tmpUserids&")") listData.doBegin() do while listData.isNext() tmpUserid=listData.getItemInt("userid") if inPart(tmpUserids,tmpUserid,",")>0 then tmpUsername=tmpTreeUser.getItem(tmpUserid) if len(tmpUsername)<1 then tmpUsername="[unknown]" else tmpUsername=cfg.getApp("var.guest") end if listData.setItem "username",tmpUsername loop listData.doBegin() end if end if end sub %>