How to limit number of posts per user a day?
4 posters
Page 1 of 1
How to limit number of posts per user a day?
In my forum, users spam alot, I want to limit number of posts of user per 1 days.
E.g: 5 topics /1 day 20 posts/ day per user. Is it possible?
Thanks.
E.g: 5 topics /1 day 20 posts/ day per user. Is it possible?
Thanks.
Re: How to limit number of posts per user a day?
Hello,
As far as I know, it is not possible to limit how many times a user can post in one day.
As far as I know, it is not possible to limit how many times a user can post in one day.
Re: How to limit number of posts per user a day?
I hope it is possible to do by js or css. Away, thank for your info.
Re: How to limit number of posts per user a day?
Hello,
Yes, it's possible by JavaScript, but it can be bypassed if you disable it. Try this :
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages
Paste the code below :
At the top are two variables you can modify :
perDay : The amount of posts a user can post a day. ( counted from the time they visit the forum )
errorMsg : The message displayed when they try to post, but have reached the limit.
Just to let you know, this can be bypassed if :
* Member is using an outdated browser
* Member disabled JavaScript
* Member has cleared their browser cache
Yes, it's possible by JavaScript, but it can be bypassed if you disable it. Try this :
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages
Paste the code below :
- Code:
$(function() {
var perDay = 20,
errorMsg = 'You\'ve reached the maximum number of posts per day.';
if (localStorage.postExp > +new Date - 24*60*60*1000 && Math.abs(localStorage.postsThen - _userdata.user_posts) >= perDay) $('form[action="/post"] input[type="submit"]').click(function() {alert(errorMsg); return false});
else if (localStorage.postExp === undefined) {
localStorage.postsThen = _userdata.user_posts;
localStorage.postExp = +new Date;
}
})
At the top are two variables you can modify :
perDay : The amount of posts a user can post a day. ( counted from the time they visit the forum )
errorMsg : The message displayed when they try to post, but have reached the limit.
Just to let you know, this can be bypassed if :
* Member is using an outdated browser
* Member disabled JavaScript
* Member has cleared their browser cache
Re: How to limit number of posts per user a day?
You're welcome,
I may have made a small mistake in my previous post. However, If you notice anything wrong, try replacing it by this script :
Topic archived
If you have any trouble feel free to open a new topic.
I may have made a small mistake in my previous post. However, If you notice anything wrong, try replacing it by this script :
- Code:
$(function() {
var perDay = 20,
errorMsg = 'You\'ve reached the maximum number of posts per day.';
if (localStorage.postExp > +new Date - 24*60*60*1000 && Math.abs(localStorage.postsThen - _userdata.user_posts) >= perDay) $('form[action="/post"] input[type="submit"]').click(function() {alert(errorMsg); return false});
else if (localStorage.postExp === undefined && _userdata.session_logged_in === 1) {
localStorage.postsThen = _userdata.user_posts;
localStorage.postExp = +new Date;
}
})
Topic archived
If you have any trouble feel free to open a new topic.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum