Very handy option would be to be possible to limit total number of nodes per some period of time? For example: "Some Role" can create 5 new nodes per month. Maybe the way to do it would be to reset counters at the beginning of every month.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | node_limitnumber.zip | 14.87 KB | ekrispin |
Comments
Comment #1
nachenko commentedReset counters would not be needed. Just a query that checks how many publications of type X in the given time a user has, then count the number of rows returned by the query.
it's simple, but have other priorities on this module at this moment, sorry. Per-user limit is more important to me than per-time limit.
Comment #2
Richard_ commentedI second point's request. Having total limit without time in mind is quite a BIG limitation.
I got here looking for that exact solution - How to limit number of nodes per user role within certain period of time.
Nachenko, thank you for your consideration.
Comment #3
ekrispin commentedThis is super easy to implement, I have done this in our website.
All you have to do is to change the SQL Select statement in node_limitnumber.module line 139 from:
to:
The above limits the number of nodes of each type per hour. If you want to have limit per day replace the 3600 with 24*3600 and so on.
Comment #4
vm commentedThis would be an interesting patch to allow a setting in the admin side provided the time was a variable that was allowed to be set.
Comment #5
fehin commentedsubscribing
Comment #6
ekrispin commentedAttached is an unofficial version which supports the specification of durations (and also the limiting of the number of comments).
I have implemented it so that in the admin panel you can now specify for each rule the duration of time in which the limit is to be imposed. Currently "hour" and "day" are supported but you can easily add any other time interval to the corresponding associative arrays.
Other new features and changes in this version:
* Limit Comments - Support for imposing limits also on number of comments.
* Support for limit value of 0.
* Informative messages to the user were eliminated except of the message issued when the limit is actually reached (and the message was changed to be more appropriate and to contain the period of time aspect).
* Changed to impose on a user the most constraining rule rather then the least. For example if User1 belongs to both Role1 and Role2, and Role1 is limited to 2 and Role2 is limited to 10 of a certain node type. Previously the constraint imposed on the user was 10, after the change it is 2.
Note that there is also a column named 'period' added to the node_limitnumber_rules database table.
The enhancements were done on version 5.x-1.1-3. All the lines which were changed or added are marked with a
/* EK */comment. I don't know how to produce a meaningful diff so I attach the whole new version of the module compressed in a zip file. It is up to the maintainers if they want to officially adopt and incorporate it and put me as a contributor to this wonderful module.This version was well tested and is used in a production website for quite a while (http://www.gurusfeet.com).
If you have questions do not hesitate to ask.
==============================
Erez Krispin
www.openify.com
Comment #7
Fanaile commented*subscribing*
Comment #8
jdwfly commentedThis is possible with the Drupal 6 version of the module.
Comment #10
Kutakizukari commented