vForums Support > Programming & Coding :: Code Requests & Support :: > Prevent Posting by Post Count

Prevent Posting by Post Count - Posted By dog199200 (dog199200) on 21st Feb 09 at 12:39am
Can I please get something that will prevent someone "posting" in a select board if they don't have a certain amount of posts? I still want them to be able to view the board they are looking at and be able to read threads, but just not be able to post. I am currently using a code that prevents the board from being seen at all if they don't have the right amount of posts and thats not working to well..

Edit: and if it helps here is the code I am using for easy editing:

Code:
 
  1. <script>
  2. var restrict = [
  3.  
  4. ["Affiliating","20"],
  5. ["Advertising","20"]
  6. ];
  7.  
  8. if(location.href.match(/\/board\//)){
  9. for(i=0;i<restrict.length;i++){
  10. if(location.href.match(restrict[i][0]) && vf_posts<restrict[i][1]){
  11. alert('Sorry, you need to have at leave 20 posts to post this board.');
  12. history.go(-1);
  13. }
  14. }
  15. }
  16. </script>
 

Re: Prevent Posting by Post Count - Posted By Michael (wrighty) on 23rd Feb 09 at 12:15pm
Isn't this a built in feature? {Unsure}

Re: Prevent Posting by Post Count - Posted By slip (slip) on 23rd Feb 09 at 6:03pm
Posted By dog199200 on 21st Feb 09 at 12:39am
 
Can I please get something that will prevent someone "posting" in a select board if they don't have a certain amount of posts? I still want them to be able to view the board they are looking at and be able to read threads, but just not be able to post. I am currently using a code that prevents the board from being seen at all if they don't have the right amount of posts and thats not working to well..

Edit: and if it helps here is the code I am using for easy editing:

Code:
 
  1. <script>
  2. var restrict = [
  3.  
  4. ["Affiliating","20"],
  5. ["Advertising","20"]
  6. ];
  7.  
  8. if(location.href.match(/\/board\//)){
  9. for(i=0;i<restrict.length;i++){
  10. if(location.href.match(restrict[i][0]) && vf_posts<restrict[i][1]){
  11. alert('Sorry, you need to have at leave 20 posts to post this board.');
  12. history.go(-1);
  13. }
  14. }
  15. }
  16. </script>
 


A certain amount of posts could be called a rank. And so you can easily set permissions for a particular board such that people in below that rank can view but not post in the board. The rank will be needed to post as well. Use the admin panel. {Smile}

Re: Prevent Posting by Post Count - Posted By dog199200 (dog199200) on 24th Feb 09 at 11:51pm
...none of my ranks work with the post count I have setup, and the forum I need this code on is an RP forum so I cant very well chance the ranks to make it fit like I could with a chat forum, other wise I would of done it view rank and no requested a code.

Re: Prevent Posting by Post Count - Posted By ashkir (ashkir) on 25th Feb 09 at 2:44am
Perhaps make a rank with the same name? I think it does something like:

var vf_usergroup = Array('9');


Like mine is on vForums Support.

Re: Prevent Posting by Post Count - Posted By Michael (wrighty) on 25th Feb 09 at 4:02pm
It's easily doable as posts are stored in vf_posts {Smile}

Re: Prevent Posting by Post Count - Posted By dog199200 (dog199200) on 25th Feb 09 at 7:08pm
 
Perhaps make a rank with the same name? I think it does something like:

var vf_usergroup = Array('9');


Like mine is on vForums Support.


I took the "Same Name" thing into thought and tried it out and it worked, but because I am using the Staff has User Groups code, I can make hidden ranks by adding them only into the members ranks area and not into the ranks to display via the code, so it worked perfectly {Smile} thanks, so ok no code needed then {Smile}

Quote:
It's easily doable as posts are stored in vf_posts {Smile}


Yes it is, {Tongue Out} but my javascript sucks really bad {Tongue Out}

Re: Prevent Posting by Post Count - Posted By Michael (wrighty) on 26th Feb 09 at 4:28pm
Do you still need this?

Re: Prevent Posting by Post Count - Posted By dog199200 (dog199200) on 26th Feb 09 at 9:35pm
nope, making a rank with the same name worked great {Smile} , thanks for asking