Perhaps this function should read:

function nodefamily_content_type_is_max($typename, $uid) {
  $max = nodefamily_content_type_get_max($typename);
  if (($max == 0 || $uid == 0) && $uid == 1) {
    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;
}

so that user 1 can post as many of whichever content type they want.

Comments

rconstantine’s picture

oops, I guess that should also have been ||, not && -- sorry.

fago’s picture

Status: Needs review » Closed (won't fix)

no, I don't think that it makes sense, that the superuse should have more than one profile. Creating profiles for other users is possible by setting the author appropriate.

rconstantine’s picture

I'm not talking about profiles. This field can be used to limit any kind of content! In my case, I don't want users to have more than 10 organic groups that they are in charge of. They can join as many groups as they want, but they can't start them. But as a site admin, I want to own and maintain a handful of groups myself. This number is more than I want users to create. So I think you can see the problem there. This isn't just usable by nodeprofile. In fact, I think your own docs state as much. Please reconsider. Thanks.

rconstantine’s picture

Status: Closed (won't fix) » Active
rconstantine’s picture

@fago, so what do you think? Can you see the usefulness of the feature beyond nodeprofiles? Thanks for considering this again. I think it could be generally useful. May even be useful to allow certain roles to be exempt from the limit as well.

fago’s picture

Category: bug » feature

you are right, I thought too much about the profiles.
So I agree that this might be useful, so best would be a permission for it, perhaps even per content type.

However, it's no bug, so I change this to feature request. So if you provide a (clean written) patch, I'm of course open to include it :)

fago’s picture

Status: Active » Fixed

I think this is already fixed, but a bit different. Anonymous users can have unlimited nodes, so just set the author to anonymous.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.