PDA

View Full Version : Max replies per week per user in specified forums


VBDev
01-11-2004, 10:00 PM
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:

This hack has been released by VBulletinDev's team : http://www.vbulletindev.net

Ce hack a ete realis? par la team de VBulletinDev et est telechargeable en FR sur http://www.vbulletindev.net

VBDev
01-12-2004, 06:27 PM
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 :)

bigdaddy04
01-15-2004, 05:49 PM
So you finally did it :)

2 questions:
1. Do you have a 2.3.x version of this?
2. If this is the hack I requested...I think I said threads, not replies :)

Thanks for your time bud, good to see you actually take me up on this idea.

*arie
01-20-2004, 07:01 PM
nice job.

plauderer
06-06-2004, 08:39 PM
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.

sharjah
06-27-2004, 11:36 PM
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?

calvin.krause
08-05-2004, 03:51 PM
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:

$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.

calvin.krause
08-06-2004, 01:09 AM
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:


$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

"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!

calvin.krause
08-07-2004, 01:16 AM
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?

Thanks!

NetRover
08-07-2004, 12:03 PM
Sounds useful, could this work to fit in with subscriptions also?

Waiting to see if anyone else says this does not stop replies even after the set limit.

Andy

calvin.krause
08-21-2004, 12:26 AM
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?

Thanks!

I fixed all the problems in this hack. It works great now. If you want the fixed version, PM me, because I don't have time to post the fixes now.

-=Sniper=-
08-24-2004, 07:09 PM
any chance you can post a code, which allows the user to create only one thread in a selected forum? but can reply to it as much as he/she wants?

thanks