You are here

function node_db_rewrite_sql in Drupal 5

Same name and namespace in other branches
  1. 4 modules/node.module \node_db_rewrite_sql()
  2. 6 modules/node/node.module \node_db_rewrite_sql()

Implementation of hook_db_rewrite_sql

Related topics

File

modules/node/node.module, line 2926
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_db_rewrite_sql($query, $primary_table, $primary_field) {
  if ($primary_field == 'nid' && !node_access_view_all_nodes()) {
    $return['join'] = _node_access_join_sql($primary_table);
    $return['where'] = _node_access_where_sql();
    $return['distinct'] = 1;
    return $return;
  }
}