Version: 1.00, by VBDev
Developer Last Online: Dec 2021
Version: 3.0.0
Rating:
Released: 01-11-2004
Last Update: Never
Installs: 6
No support by the author.
This hack allows the administrator to set in a specific (by editing it or by adding a new one) forum a maximum number of replies per week
and per user.
The week is defined as 7 days before the current date. There is no specific day for the beginning of the week. The week is so dynamic and a
member which has created too much posts during the last 7 days, will have to wait to be able to post again in this forum
Ce hack permet a l'administrateur de specifier dans le(s) forum(s) qu'il veut si une limite de posts par semaine et par membre doit etre
fix?e ou non.
La semaine correspond au 7 derniers jours, il n'y a pas de jour specifique pour le debut de la semaine. La semaine est donc dunamique et si
un membre a post? trop de posts pendant la derniere semaine, il devra attendre avant de pouvoir poster a nouveau.
Installation time : 10 min
Files to modify : 2
Phrases to add: 5
Template to modify: 1
Template to create : 1
I made this hack from an original idea of bigdaddy04 on vbulletin.org
:devious:
how can i make it that they only couldnt reply on threads anymore when limit is reached but still can post new threads ? because when limit is reached now they also couldnt post new threads and i only want to limit replys not new threads.
Great hack .. I've been looking for this hack for sometime ... Thank you.
Is it possible to modify this hack to limit the number of replies per day?
Yes, in includes/function_newpost.php find this:
Code:
$temps_restant = time() - 604800;
604800 is the number of seconds that must elapse before the user can post again. You can change this value to whatever you want. There are 3600 seconds in one hour, so a 24 hour day is 86400.
However, remember to update your phrases to reflect if the limit is for an hour, a day, a week, etc., so your users don't get confused.
I've noticed a small problem with this hack and am having trouble fixing it.
In the forumdisplay.php file, the code in question is below:
PHP Code:
$reponses = $DB_site->query_first("SELECT COUNT(" . TABLE_PREFIX . "post.postid) AS rep_week FROM " . TABLE_PREFIX . "post, " . TABLE_PREFIX . "thread WHERE " . TABLE_PREFIX . "post.dateline>$temps_restant AND thread.forumid=$forumid AND " . TABLE_PREFIX . "post.threadid=" . TABLE_PREFIX . "thread.threadid AND " . TABLE_PREFIX . "post.username='$bbuserinfo[username]'");
The problem lies with the very end of the statement
PHP Code:
"post.username='$bbuserinfo[username]'");
Everything normally works great, until you have a user that has an ' in their username. For example: Bob'sAutoShop
PHP is gonna throw out an error because the string Bob'sAutoShop is going to end as soon as it see's the ' mark.
How do I need to format the code (the " and the ' marks) in order for this to work correctly? I want to keep my fix inside this line of code if at all possible, so I don't have to change much of the default vBulletin code.
Can you help me here? I'd GREATLY appreciate it if you could. Thanks!
I have tested it a little but can't have seen if all was OK during 1 week
I'm waiting your bug report if there are
Actually, I'm discovering that this hack doesn't actually stop users from making replies. It does keep members from being able to create new threads, but they can still reply on any thread in your forum. It will show you the number of posts allowed and the number that you have left. Members can continue to post even after they have exceeded the max amount.
Is there a way to modify this so that it keeps members from being able to reply?