You are here

function search_files_directories_dashboard in Search Files 6.2

Same name and namespace in other branches
  1. 7.2 search_files_directories.module \search_files_directories_dashboard()

generate the search_files_directories dashboard page

1 string reference to 'search_files_directories_dashboard'
search_files_directories_menu in ./search_files_directories.module
Implementation of hook_menu().

File

./search_files_directories.module, line 663
Used to index files in directories

Code

function search_files_directories_dashboard() {
  $output = '';
  $lastindex = variable_get('search_files_directories_last_index', 0);
  if ($lastindex == 0) {
    $output .= sprintf("%s = <i>%s</i><br/>\n", t('Last Index'), t('never'));
  }
  else {
    $output .= sprintf("%s = %s<br/>\n", t('Last Index'), format_date($lastindex, $type = 'custom', $format = 'Y-m-d H:i:s', $timezone = NULL, $langcode = NULL));
  }
  $sql = "SELECT count(*) FROM {search_dataset} WHERE type = 'search_files_dir'";
  $result = db_query($sql);
  $result = db_result($result);
  $output .= sprintf("Files indexed = %s<br/>\n", $result);
  $sql = "SELECT count(*) FROM {search_dataset} WHERE (type = 'search_files_dir' AND reindex > 0)";
  $result = db_query($sql);
  $result = db_result($result);
  $output .= sprintf("Files indexed and scheduled for reindexing = %s<br/>\n", $result);
  $directoryrescanage = search_files_variable_get_directoryrescanage();
  $output .= sprintf("%s = %s [sec]<br/>\n", t('Directory Rescan Age'), $directoryrescanage);
  $nextdirectoryrescan = $lastindex + $directoryrescanage;
  $output .= sprintf("%s = %s<br/>\n", t('Next Directory (Re-)Scan at or after'), format_date($nextdirectoryrescan, $type = 'custom', $format = 'Y-m-d H:i:s', $timezone = NULL, $langcode = NULL));
  $sql = "SELECT count(*) FROM {search_files_directories_directories}";
  $result = db_query($sql);
  $result = db_result($result);
  $output .= sprintf("Number of Directories configured = %s<br/>\n", $result);
  $sql = "SELECT count(*) FROM {search_files_directories_files}";
  $result = db_query($sql);
  $result = db_result($result);
  $output .= sprintf("Files found in configured Directories and Subdirectories = %s<br/>\n", $result);
  $sql = "SELECT count(*) FROM {search_files_directories_files} WHERE index_attempts = 0";
  $result = db_query($sql);
  $result = db_result($result);
  $output .= sprintf("Files without index attempt = %s<br/>\n", $result);
  $output .= l(t('Update index'), 'admin/settings/search_files/directories/update_index');
  $output .= "<br/>\n";
  return $output;
}