nodefamily_content_type_is_max

Versions
5
nodefamily_content_type_is_max($typename, $uid)

Return, if the maximum population is already reached.

Code

contributions/nodefamily/nodefamily.module, line 295

<?php
function nodefamily_content_type_is_max($typename, $uid) {
  $max = nodefamily_content_type_get_max($typename);
  if ($max == 0 || $uid == 0) {
    return FALSE;
  }
  $result = db_query("SELECT COUNT(*) FROM {node} n WHERE uid = %d AND type = '%s'", $uid, $typename);
  $count = db_result($result);
  return $count == $max;
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.