You are here

function protected_node_isset_protected in Protected Node 5

Same name and namespace in other branches
  1. 6 protected_node.module \protected_node_isset_protected()
  2. 7 protected_node.module \protected_node_isset_protected()
  3. 1.0.x protected_node.module \protected_node_isset_protected()

This method determines the protected flag status for the given node id.

Parameters

int $nid The node id you wish to check for.:

Return value

boolean TRUE if the node identified by the nid you provided is protected, FALSE otherwise.

2 calls to protected_node_isset_protected()
protected_node_nodeapi in ./protected_node.module
Implementation of hook_nodeapi(). @link http://api.drupal.org/api/function/hook_nodeapi/5
protected_node_set_protected in ./protected_node.module
Sets the given node to protected with the provided password. The password cannot be empty.

File

./protected_node.module, line 381

Code

function protected_node_isset_protected($nid) {
  if (!is_numeric($nid)) {
    return FALSE;
  }
  $nodes = db_num_rows(db_query('SELECT nid FROM {protected_nodes} WHERE nid = %d', $nid));
  if ($nodes > 0) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}