/[drupal]/contributions/modules/user_stats/views/views_handler_field_is_online.inc
ViewVC logotype

Diff of /contributions/modules/user_stats/views/views_handler_field_is_online.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.3, Fri Feb 13 03:18:36 2009 UTC revision 1.1.2.4, Thu Apr 30 07:54:48 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: views_handler_field_is_online.inc,v 1.1.2.2 2009/02/12 20:02:26 liammcdermott Exp $  // $Id: views_handler_field_is_online.inc,v 1.1.2.3 2009/02/13 03:18:36 liammcdermott Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 12  Line 12 
12   */   */
13  class views_handler_field_is_online extends views_handler_field_boolean {  class views_handler_field_is_online extends views_handler_field_boolean {
14    function query() {    function query() {
15      $sql = "(". time() ." - users.access) < 900";      // We use an IF for MySQL/PostgreSQL compatibility. Otherwise PostgreSQL
16        // would return 'f' and 't'.
17        $sql = "IF((". time() ." - users.access) < 900, 1, 0)";
18      // We liberally steal from views_handler_sort_formula here.      // We liberally steal from views_handler_sort_formula here.
19      $this->ensure_my_table();      $this->ensure_my_table();
20      $this->field_alias = $this->query->add_field(NULL, $sql, $this->table_alias .'_'. $this->field);      $this->field_alias = $this->query->add_field(NULL, $sql, $this->table_alias .'_'. $this->field);

Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4

  ViewVC Help
Powered by ViewVC 1.1.2