You are here

function search_file_attachments_search_status in Search File Attachments 7

Implements hook_search_status().

File

./search_file_attachments.module, line 116
Contains the functionality for the Search File Attachments module.

Code

function search_file_attachments_search_status() {
  $total = db_query('SELECT COUNT(*) FROM {file_managed} WHERE status = 1')
    ->fetchField();
  $remaining = db_query("SELECT COUNT(*) FROM {file_managed} f\n    LEFT JOIN {search_dataset} d ON d.type = 'file' AND d.sid = f.fid\n    WHERE f.status = 1 AND d.sid IS NULL OR d.reindex <> 0")
    ->fetchField();
  return array(
    'remaining' => $remaining,
    'total' => $total,
  );
}