You are here

function custom_search_db_rewrite_sql in Custom Search 6

File

./custom_search.module, line 411
Bring customizations to the default search box

Code

function custom_search_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
  if ($query == '' && $primary_table == 'n' && ($primary_field = 'nid' && empty($args))) {
    $excluded_types = array_filter(variable_get('custom_search_' . variable_get('custom_search_delta', '') . 'node_types_excluded', array()));
    if (!empty($excluded_types)) {
      $where = " n.type NOT IN ('" . join("','", $excluded_types) . "') ";
      return array(
        'where' => $where,
      );
    }
  }
}