For those who are interested in limiting also the number of comments, here is the changes you need to do:

In node_limitnumber.module, add at the end the following function:

function node_limitnumber_comment($a1, $op) {
  global $user;

  // Verify that the user is not editing a previously posted node
  $url = preg_replace('/\//', '_', $_GET['q']);
  $r = strpos($url, t('edit'));
  
  $account = $user;

  if (($op == "form" || $op == "validate") && !$r && $user->uid != 1){
                $limit = _get_limits_for_user ($account, 'comment');
  
  		if (!empty($limit)) { 
  		
  			$count = db_result(db_query("SELECT COUNT(*) AS cnt FROM {comments} t WHERE t.timestamp >= ". (time()-3600). " AND t.uid = '$account->uid'"));
  
  				if ($count >= $limit) {
  				        form_set_error('', t("Sorry, you have reached the maximum of !limit comments you can post per hour.", array ('!limit' => $limit)));
                                        watchdog('quota_by_role', "Reached limit of comments per hour");      
  				} 
  			
		}
    
  }
} 

In node_limitnumber.inc

Add after lines 17 and 61 ($pubtypes = node_get_types('names');), the following line:

$pubtypes['comment'] = "Comment";

Comments

ekrispin’s picture

See also http://drupal.org/node/260055#comment-1502964 for the support for limiting comments in addition to nodes and for a duration of time.

jdwfly’s picture

Version: 5.x-1.1-3 » 6.x-2.0-alpha2
Status: Active » Fixed

This has been added into the 6.x-2.0-alpha2 version of this module.

EHA’s picture

I'm testing 6.x.-2.0-alpha2. In Rules, I don't see option to limit comments, just "set the limit for the node type".

Please help, more information on implementing this feature.

EHA’s picture

^Update: I now see the limit comments function on the 6.x-2.x-dev release.

However, I would appreciate help in working out the Rules for this. Basically, I need to limit comments on a specific node type to 1 per user. Any direction would be appreciated.

Status: Fixed » Closed (fixed)

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

gausarts’s picture

Version: 6.x-2.0-alpha2 » 6.x-2.0-alpha3
Status: Closed (fixed) » Active

Sorry to reopen, I tested the latest alpha, but when I go to rules I found a condition is not configurable

Node Limit Number module

Set the limit for comments
     Unavailable argument: Comment 

Is it implemented yet? Thanks

waddles’s picture

Status: Active » Fixed

It is implemented but your Event needs to relate to the Comment module to trigger it.

Status: Fixed » Closed (fixed)

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