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.
This is a Hitskin.com skin preview
Install the skin • Return to the skin page
$(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;
}
})
$(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;
}
})