function ad_db_rewrite_sql in Advertisement 6.3
Same name and namespace in other branches
- 6.2 ad.module \ad_db_rewrite_sql()
- 7 ad.module \ad_db_rewrite_sql()
Implementation of hook_db_rewrite_sql().
File
- ./
ad.module, line 820
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'",
);
}
}