You are here

function ad_db_rewrite_sql in Advertisement 7

Same name and namespace in other branches
  1. 6.3 ad.module \ad_db_rewrite_sql()
  2. 6.2 ad.module \ad_db_rewrite_sql()

Implementation of hook_db_rewrite_sql().

File

./ad.module, line 956

Code

function ad_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
  if (variable_get('ad_no_search', 1) && !user_access('administer advertisements') && !user_access('edit any advertisement') && $query == '' && $primary_table == 'n' && ($primary_field = 'nid' && empty($args))) {
    return array(
      'where' => " n.type != 'ad'",
    );
  }
}