vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Prevent Posting by Post Count - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
Prevent Posting by Post Count (21st Feb 09 at 12:39am UTC)
Resolved
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>
 
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Prevent Posting by Post Count (23rd Feb 09 at 12:15pm UTC)
Isn't this a built in feature? {Unsure}
slip
Moderator
*****

Posts: 760
Status: Offline
Gender: Male
Location: India
Joined:  

Additional Groups:
Design Team
***


Reputation: 31%  


pmmsn
Re: Prevent Posting by Post Count (23rd Feb 09 at 6:03pm UTC)
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}
dog199200
Guest
Re: Prevent Posting by Post Count (24th Feb 09 at 11:51pm UTC)
...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.
ashkir
Full Member
***

[Avatar]

Posts: 1,159
Status: Offline
Gender: Male
Location: Cali!
Age: 35
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
Re: Prevent Posting by Post Count (25th Feb 09 at 2:44am UTC)
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.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Prevent Posting by Post Count (25th Feb 09 at 4:02pm UTC)
It's easily doable as posts are stored in vf_posts {Smile}
dog199200
Guest
Re: Prevent Posting by Post Count (25th Feb 09 at 7:08pm UTC)
 
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}
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Prevent Posting by Post Count (26th Feb 09 at 4:28pm UTC)
Do you still need this?
dog199200
Guest
Re: Prevent Posting by Post Count (26th Feb 09 at 9:35pm UTC)
nope, making a rank with the same name worked great {Smile} , thanks for asking
 Printable View

All times are GMT+0 :: The current time is 6:39am
Page generated in 0.4607 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums