Limit the number of responses to specific members
4 posters
Page 1 of 1
Limit the number of responses to specific members
Hi to all of you,
I would like to block the number of responses (20) to specific members per day,
and this on all pages of the forum.
Thank you in advance.
a++
I would like to block the number of responses (20) to specific members per day,
and this on all pages of the forum.
Thank you in advance.
a++
Last edited by Milouze14 on November 18th 2015, 4:57 pm; edited 1 time in total
Re: Limit the number of responses to specific members
What exactly do you mean by block responses to a certain member? Do you mean the profile wall?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Limit the number of responses to specific members
Hi SLGray,
sorry for my language, I am French and my English is can not be explicit.
I would like to block the number of responses to certain members and this day on every page of the forum, is it possible please?
Arrived at the 21 th answer: answer button and a message appears disparraisse indicating a defined text.
Thank you in advance.
a++
sorry for my language, I am French and my English is can not be explicit.
I would like to block the number of responses to certain members and this day on every page of the forum, is it possible please?
Arrived at the 21 th answer: answer button and a message appears disparraisse indicating a defined text.
Thank you in advance.
a++
Re: Limit the number of responses to specific members
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Limit the number of responses to specific members
Not because it has no answer most of the time here
and Ange Tuteur and remarkable in this kind of question .
Thank you
a++
Re: Limit the number of responses to specific members
let me see if i understand the request
you want to set a limit like if user viewed more then 20 page peer a day he should see that he is off limit or something like that
am i right ?
i hope if my guessing right that would be clear to the staff so they think about the answer
you want to set a limit like if user viewed more then 20 page peer a day he should see that he is off limit or something like that
am i right ?
i hope if my guessing right that would be clear to the staff so they think about the answer
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Limit the number of responses to specific members
Hi, I would not have a lock on some members who display too much message.
but I'll wait Ange Tuteur, as I understand it also helps the French media time to time.
Thank you.
a++
but I'll wait Ange Tuteur, as I understand it also helps the French media time to time.
Thank you.
a++
Last edited by Milouze14 on November 13th 2015, 7:08 pm; edited 1 time in total
Re: Limit the number of responses to specific members
i see
will ill be also waiting the answer i hope its a good news
sorry for not helping
im not good in coding
will ill be also waiting the answer i hope its a good news
sorry for not helping
im not good in coding
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Limit the number of responses to specific members
Hi to all of you,
I go up the subject.
Thank you in advance.
I go up the subject.
Thank you in advance.
Re: Limit the number of responses to specific members
Hi @Milouze14,
It's possible, however, it can also be bypassed as the solution would be with JavaScript. Try adding the following script in all the pages :
It should prevent the post from being submitted once the limit has been reached. ( 20 )
If any questions let me know.
P.S.
Sorry for the late reply. I've been ill, but I'm slowly getting better.
It's possible, however, it can also be bypassed as the solution would be with JavaScript. Try adding the following script in all the pages :
- Code:
$(function() {
var storage = window.localStorage;
if (storage && (!storage.post_count || +storage.post_count_exp > +new Date - 24*60*60*1000)) {
storage.post_count = _userdata.user_posts;
storage.post_count_exp = +new Date;
}
$('form[name="post"]').submit(function() {
var storage = window.localStorage;
if (storage && (+storage.post_count - _userdata.user_posts) > 20) {
alert('You have reached the maximum number of posts for today.');
return false;
}
});
});
It should prevent the post from being submitted once the limit has been reached. ( 20 )
If any questions let me know.
P.S.
Sorry for the late reply. I've been ill, but I'm slowly getting better.
Re: Limit the number of responses to specific members
I Ange Tuteur ,
First of all thank you very much, sorry I bothered if you are suffering,
the script does not work on my tests forums !!
Take your time because I'm in no hurry.
Get Well my friend .
a++
First of all thank you very much, sorry I bothered if you are suffering,
the script does not work on my tests forums !!
Take your time because I'm in no hurry.
Get Well my friend .
a++
Re: Limit the number of responses to specific members
Oops, I made a small mistake. Try now :
If you need to test, you can change the post limit by modifying the
. Since we use greater than ( > ), the posts must be greater than 20 for the alert message to display.
is the duration of time that the post count is stored.
Note however, that this can be bypassed by disabling JavaScript or clearing the browser cache. I'm not sure, but the way I have it setup may also cause logging out to do the same.
- Code:
$(function() {
var storage = window.localStorage;
if (_userdata.session_logged_in && storage) {
if (!storage.post_count || +storage.post_count_exp < +new Date - 24*60*60*1000) {
storage.post_count = _userdata.user_posts;
storage.post_count_exp = +new Date;
}
$('form[name="post"]').submit(function(e) {
var storage = window.localStorage;
if (storage && Math.abs(+storage.post_count - _userdata.user_posts) > 20) {
alert('You have reached the maximum number of posts for today.');
e.preventDefault();
}
});
} else if (storage) {
storage.removeItem('post_count');
storage.removeItem('post_count_exp');
}
});
If you need to test, you can change the post limit by modifying the
|
|
Note however, that this can be bypassed by disabling JavaScript or clearing the browser cache. I'm not sure, but the way I have it setup may also cause logging out to do the same.
Re: Limit the number of responses to specific members
Hi Ange Tuteur,
It's not even my good friend, I have the alert that fires right after dropping the script by having emptied my browser cache.
ok thank you, one more quick question on the duration of storage,
Can you explain the operation please do
Thank you for your patience
a++
It's not even my good friend, I have the alert that fires right after dropping the script by having emptied my browser cache.
ok thank you, one more quick question on the duration of storage,
Can you explain the operation please do
- Code:
24*60*60*1000
Thank you for your patience
a++
Re: Limit the number of responses to specific members
I found a better way to set it up, so replace the script with this :
This will add a storage item for a specific user. For example, "User A" has reached the limit and cannot post anymore, but your "User B" account can still post. Logging out will no longer remove the post limit for individual accounts, unless the duration is exceeded, then the post count is reset. You can of course still bypass this with clearing your cache, etc.. but it should be better than before.
is the amount of time until the user's post limit is reset. It is :
( 24 hours, 60 minutes, 60 seconds, 1000 milliseconds )
- Code:
$(function() {
var storage = window.localStorage;
if (_userdata.session_logged_in && storage) {
if (!storage['post_count_' + _userdata.username] || +storage['post_count_' + _userdata.username + '_exp'] < +new Date - 24*60*60*1000) {
storage['post_count_' + _userdata.username] = _userdata.user_posts;
storage['post_count_' + _userdata.username + '_exp'] = +new Date;
}
$('form[name="post"]').submit(function(e) {
var storage = window.localStorage;
if (storage && Math.abs(+storage['post_count_' + _userdata.username] - _userdata.user_posts) > 20) {
alert('You have reached the maximum number of posts for today.');
e.preventDefault();
}
});
}
});
This will add a storage item for a specific user. For example, "User A" has reached the limit and cannot post anymore, but your "User B" account can still post. Logging out will no longer remove the post limit for individual accounts, unless the duration is exceeded, then the post count is reset. You can of course still bypass this with clearing your cache, etc.. but it should be better than before.
|
|
Re: Limit the number of responses to specific members
what to say !!!!
A big thank you my friend.
I modified the alert message on the body :
and the stylesheet
Get well soon and thank you again for your dedication.
A big thank you my friend.
I modified the alert message on the body :
- Code:
$(function() {
var storage = window.localStorage;
if (_userdata.session_logged_in && storage) {
if (!storage['post_count_' + _userdata.username] || +storage['post_count_' + _userdata.username + '_exp'] < +new Date - 24*60*60*1000) {
storage['post_count_' + _userdata.username] = _userdata.user_posts;
storage['post_count_' + _userdata.username + '_exp'] = +new Date;
}
$('form[name="post"]').submit(function(e) {
var storage = window.localStorage;
if (storage && Math.abs(+storage['post_count_' + _userdata.username] - _userdata.user_posts) > 2) {
$('body').append('<div id="M14_Alerte_PostMax">You have reached the maximum number of posts for today.</div>');
e.preventDefault();
}
});
}
});
and the stylesheet
- Code:
#M14_Alerte_PostMax
{
position:fixed;
top:30%;
left:30%;
width:40%;
height:50px;
text-align:center;
color:white;
background:red;
padding:10px;
border:5px solid white ;
z-index:999;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
Get well soon and thank you again for your dedication.
Re: Limit the number of responses to specific members
You're welcome ! ^^
Topic archived
Thanks, and have a good day.
Topic archived
Thanks, and have a good day.
Similar topics
» Limit the number of title to display
» Limit on the number of groups
» How to limit edit field to a specific group
» How to limit number of posts per user a day?
» New limit of number of forums and categories?
» Limit on the number of groups
» How to limit edit field to a specific group
» How to limit number of posts per user a day?
» New limit of number of forums and categories?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum