| 1 |
<?php |
<?php |
| 2 |
// $Id: views_handler_filter_is_online.inc,v 1.1.2.2 2009/02/12 20:02:26 liammcdermott Exp $ |
// $Id: views_handler_filter_is_online.inc,v 1.1.2.3 2009/02/13 03:18:36 liammcdermott Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 12 |
*/ |
*/ |
| 13 |
class views_handler_filter_is_online extends views_handler_filter_boolean_operator { |
class views_handler_filter_is_online extends views_handler_filter_boolean_operator { |
| 14 |
function query() { |
function query() { |
| 15 |
$sql = "(". time() ." - users.access) < 900"; |
if ($this->value == 1) { |
| 16 |
|
// Is online. |
| 17 |
|
$sql = "(". time() ." - users.access) < 900"; |
| 18 |
|
} |
| 19 |
|
else { |
| 20 |
|
// Is offline |
| 21 |
|
$sql = "(". time() ." - users.access) > 900"; |
| 22 |
|
} |
| 23 |
$this->ensure_my_table(); |
$this->ensure_my_table(); |
| 24 |
$this->query->add_where($this->options['group'], $sql); |
$this->query->add_where($this->options['group'], $sql); |
| 25 |
$this->field_alias = $this->table_alias .'_'. $this->field; |
$this->field_alias = $this->table_alias .'_'. $this->field; |