function views_handler_field_history_user_timestamp::init

Same name in other branches
  1. 7.x-3.x modules/node/views_handler_field_history_user_timestamp.inc \views_handler_field_history_user_timestamp::init()

Overrides views_handler_field_node::init

File

modules/node/views_handler_field_history_user_timestamp.inc, line 8

Class

views_handler_field_history_user_timestamp
Field handler to display the marker for new content.

Code

function init(&$view, $options) {
    parent::init($view, $options);
    global $user;
    if ($user->uid) {
        $this->additional_fields['created'] = array(
            'table' => 'node',
            'field' => 'created',
        );
        $this->additional_fields['changed'] = array(
            'table' => 'node',
            'field' => 'changed',
        );
        if (module_exists('comment') && !empty($this->options['comments'])) {
            $this->additional_fields['last_comment'] = array(
                'table' => 'node_comment_statistics',
                'field' => 'last_comment_timestamp',
            );
        }
    }
}