You are here

function content_profile_profile_exists in Content Profile 6

Checks whether a node of this type exists already for the author

Parameters

$node: The node, which is to be created.

$uid: The user to check for.

Return value

If a node exists, the node id, FALSE else.

1 call to content_profile_profile_exists()
content_profile_nodeapi in ./content_profile.module
Implementation of hook_nodeapi().

File

./content_profile.module, line 407

Code

function content_profile_profile_exists($node, $uid) {
  $query = "SELECT n.nid AS nid FROM {node} n WHERE n.type = '%s' AND n.uid = %d ";
  if (module_exists('translation') && translation_supported_type($node->type)) {
    $query .= "AND n.language = '%s'";
  }
  return db_result(db_query($query, $node->type, $uid, $node->language));
}