-
Notifications
You must be signed in to change notification settings - Fork 0
/
online.php
60 lines (56 loc) · 2.1 KB
/
online.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* 显示在线用户
*
* 显示在线用户
*
* 调用模板:/templates/online.html
*
* @category jieqicms
* @package system
* @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
* @author $Author: juny $
* @version $Id: online.php 326 2009-02-04 00:26:22Z juny $
*/
define('JIEQI_MODULE_NAME', 'system');
require_once('global.php');
jieqi_getconfigs(JIEQI_MODULE_NAME, 'power');
jieqi_checkpower($jieqiPower['system']['viewonline'], $jieqiUsersStatus, $jieqiUsersGroup, false);
//包含配置参数
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
include_once(JIEQI_ROOT_PATH.'/header.php');
if(!JIEQI_USE_CACHE || !$jieqiTpl->is_cached(JIEQI_ROOT_PATH.'/templates/online.html')){
include_once(JIEQI_ROOT_PATH.'/class/online.php');
$online_handler =& JieqiOnlineHandler::getInstance('JieqiOnlineHandler');
$criteria=new CriteriaCompo(new Criteria('updatetime', JIEQI_NOW_TIME-$jieqiConfigs['system']['onlinetime'], '>'));
$allnum=$online_handler->getCount($criteria);
$criteria->add(new Criteria('uid', '0'), '>');
$criteria->setSort('groupid');
$criteria->setOrder('ASC');
$result = $online_handler->queryObjects($criteria);
$userrows = array();
$usernum=0;
$i=0;
if($result){
while ($srow = $online_handler->getRow($result)) {
$userrows[$i]['uid']=$srow['uid'];
$userrows[$i]['siteid']=$srow['siteid'];
$userrows[$i]['uname']=jieqi_htmlstr($srow['uname']);
$userrows[$i]['name']=jieqi_htmlstr($srow['name']);
if(strlen($userrows[$i]['name']) == 0) $userrows[$i]['name'] = $userrows[$i]['uname'];
$userrows[$i]['logintime']=$srow['logintime'];
$userrows[$i]['updatetime']=$srow['updatetime'];
$userrows[$i]['location']=jieqi_htmlstr($srow['location']);
$i++;
$usernum++;
}
}
$jieqiTpl->assign('allnum', $allnum);
$jieqiTpl->assign('usernum', $usernum);
$jieqiTpl->assign('guestnum', $allnum - $usernum);
$jieqiTpl->assign_by_ref('userrows', $userrows);
}
if (JIEQI_USE_CACHE) $jieqiTpl->setCaching(1);
$jieqiTset['jieqi_contents_template'] = JIEQI_ROOT_PATH.'/templates/online.html';
include_once(JIEQI_ROOT_PATH.'/footer.php');
?>