views_handler_filter_upload_fid.inc in Views (for Drupal 7) 6.2
File
modules/upload/views_handler_filter_upload_fid.inc
View source
<?php
class views_handler_filter_upload_fid extends views_handler_filter_boolean_operator {
function construct() {
parent::construct();
$this->value_value = t('Has attached files');
}
function query() {
$this
->ensure_my_table();
$this->query
->add_where($this->options['group'], "(SELECT COUNT(*) FROM {upload} u WHERE u.vid = {$this->table_alias}.{$this->real_field}) " . (empty($this->value) ? '=' : '<>') . " 0");
}
}