InterOcean Designs
« Post Count Requirement for Board Access »

Welcome Guest. Please Login or Register.
May 23, 2013, 5:24am





InterOcean Designs :: ProBoards Codes :: Code Chat & Support :: Post Count Requirement for Board Access
Page 1 of 2 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Post Count Requirement for Board Access (Read 728 times)
LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Post Count Requirement for Board Access
« Thread Started on Mar 23, 2012, 4:45am »

Hello folks!

I am in need of a reliable code that will restrict access to one of my forum's sub-boards unless a member has reached a certain amount of post count. I believe a code exists in PBS:

http://support.proboards.com/index.cgi?b....=1&thread=70577

Unfortunately, I....fear the accuracy and reliability of this code. :-/ It was stated in the OP that the code above was...obsolete.

An example of what I need is: Members with post count of 24 or below cannot access sub-board X because they need at least 25 posts to enter. We'd like to make it this way so new members wouldn't just come and go since this sub-board would become an essential part of our forum. It is a sub-board, not a category. I believe it would be more appropriate for that sub-board to stay as a sub-board.

Can anyone help? :c
Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #1 on Mar 23, 2012, 8:08am »

Hi LunyRed,
I just had a look at the code you've linked to and it should work for your sub-board.
Proboards now has that function for catagory's etc as standard but not sub-boards.
Try it out and if you have any problems let me know and I'll try to help you.

Pebble.

Edit:

Once you've put the sub board id into the code, change this line:
if(!location.href.match('action=') && !location.href.match('board=')){

to:

if(!location.href.match('action=') && location.href.match('board=')){

Let me know how this works.
« Last Edit: Mar 23, 2012, 11:42pm by Pebble »Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #2 on Mar 23, 2012, 10:36pm »

Hello Pebble!

Really? That code I linked works fine? Okay then. I'll try it in my test forum right away. I'll report the results in this thread later. Thanks!


EDIT: I'm afraid of double-posting right now, but I need your attention, Pebble. ^^;;

I'm experiencing some issues with this code. First question, this line:

var boardid="boardID" // ID of the board only accesible with an amount of posts

I only used the board ID. Do I have to use the full URL of the sub-board?

Once the code is in place, the sub-board AND the main board it's located in...vanish from the main page. However, I can STILL access the board if I click the Last Updated Topic from the Info Center. :-/ The boards aren't technically hidden at all.
« Last Edit: Mar 23, 2012, 11:03pm by LunyRed »Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #3 on Mar 23, 2012, 11:27pm »

Hi Lunyred,
You should just put the ID of the sub-board.
I only read through the code but if it doesn't work I'll try the code out myself.
Do you have this set up on your test site? I seem to remember helping you with something on a test site and think I have an account there so I can log in and see what's happening. ???
Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #4 on Mar 23, 2012, 11:40pm »

So it's only the ID then. Hmmm..

The code is installed in my test site and you still have an account there, Pebble. I'll turn off maintenance mode so you can access it. I'll send you the URL in PMs because I still keep my test forum private. ^^;

I also configured the variables for now and changed the post count required to "3". Meh... Even so, the boards are still hidden from view. :-/
« Last Edit: Mar 23, 2012, 11:41pm by LunyRed »Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #5 on Mar 24, 2012, 9:41am »

Hi LunyRed,
I got into your site and posted etc... worked OK at first but it seems to mess up after the first time it works....   :-/ So I did a bit of research and there's an updated version of this code by wormopolis here: http://wormocodes.proboards.com/index.cgi?board=codedb&action=display&thread=96

That should sort the problems out as it was coded for PB's v4.5
Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #6 on Mar 26, 2012, 2:06am »

Ah, a new code! Thanks for the help, Pebble! I'll go try it now in my test site to see the difference. I'll edit this post later if there happen to be any bugs or sumthin'...

EDIT: I read the instructions for the code from wormo's site and I wonder if I got this right:

["boardID",post#,"restriction"]

["testsubboard",6,"view"]

^ The line above is what I'm currently using in my test site. Care to try it out for me, Pebble? Thanks in advance!
« Last Edit: Mar 26, 2012, 2:19am by LunyRed »Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #7 on Mar 26, 2012, 7:38am »

Hi LunyRed,

Didn't work...... :( Can you take me out of the exempt users. ;)

var exemptUsers="admin"; //seperate by |
Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #8 on Mar 26, 2012, 7:43pm »

Whoops... What was I thinking?! xD

Fixed.
Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #9 on Mar 26, 2012, 9:43pm »

All seems to be set up correctly now - I couldn't get in to the sub-board, upped my post count and the doors opened wide to let me in !

Seems to be working perfectly - Enjoy :)

(PS. You can lock the main doors again now ;) )
Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #10 on Mar 26, 2012, 10:22pm »

[image]

OH YEAH!!

:)

I'm glad it works! I also tried entering that sub-board as a guest and entry is forbidden also! The code blocks guests too!

However, the banner, menu bar, and icon legend are excluded from the warning page. If it's still possible, is there a way to modify this? Here's a screenshot:

http://i925.photobucket.com/albums/ad94/4udonge/test/no_entry.jpg
(Might stretch the page, so I just didn't use the image tags. Page stretching is one of my pet peeves, ehehe..)

So yeah, like I said, is there a way to modify that page to include the missing elements? Or could the code only display that much?
Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #11 on Mar 27, 2012, 8:51am »

Because of the way the code works ( It strips out the display of the table td elements for the whole page) you can't really/easily get them to display again.

You could display your banner by changing this line:

document.write('<center><div style="background-color:#000000"><h2>You do not have enough posts to view this board.</h2><a href="'+location.href.split('?')[0]+'">Go to the home page</a><BR><BR></div></center>')

to:

document.write('<center><div style="background-color:#000000"><img src="http://i925.photobucket.com/albums/ad94/4udonge/Rebirth/LunaticRedRebirth_by_JJ.jpg"><br /><h2>You do not have enough posts to view this board.</h2><a href="'+location.href.split('?')[0]+'">Go to the home page</a><BR><BR></div></center>')

If you wanted the icon legend table back as well, the table could be added to this line, or I might be able to write a bit of code to re-display it again. But, would it make any sense as you can't see the threads which the icons relate to ?
Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #12 on Mar 27, 2012, 8:37pm »


Mar 27, 2012, 8:51am, Pebble wrote:
Because of the way the code works ( It strips out the display of the table td elements for the whole page) you can't really/easily get them to display again.

You could display your banner by changing this line:

document.write('<center><div style="background-color:#000000"><h2>You do not have enough posts to view this board.</h2><a href="'+location.href.split('?')[0]+'">Go to the home page</a><BR><BR></div></center>')

to:

document.write('<center><div style="background-color:#000000"><img src="http://i925.photobucket.com/albums/ad94/4udonge/Rebirth/LunaticRedRebirth_by_JJ.jpg"><br /><h2>You do not have enough posts to view this board.</h2><a href="'+location.href.split('?')[0]+'">Go to the home page</a><BR><BR></div></center>')

If you wanted the icon legend table back as well, the table could be added to this line, or I might be able to write a bit of code to re-display it again. But, would it make any sense as you can't see the threads which the icons relate to ?

Ehh... I changed my mind. If that's the only way to restore the banner in the warning page then I'll have to deal with it. I can't use that line because I would need to do that for every forum skin my forum is using. :(

Also, I'm fine with it if the icon legend can never show up in the warning page. :) I guess that's that.

Thanks for all the help, Pebble! :) I'm all set to use this code in my forum now. ^_^
« Last Edit: Mar 27, 2012, 8:53pm by LunyRed »Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,179
Location: Here & There
Karma: 155
 Re: Post Count Requirement for Board Access
« Reply #13 on Mar 27, 2012, 10:53pm »

I'll have a look at this over the weekend and see if I can come up with something to keep most of the board displaying..... But at least it's working !
Link to Post - Back to Top  IP: Logged

[image]

LunyRed
Senior Member
member is offline

[avatar]


[homepage]

Joined: Sept 2009
Gender: Male
Posts: 542
Location: An archipelago in SE Asia
Karma: 14
 Re: Post Count Requirement for Board Access
« Reply #14 on May 10, 2012, 12:32am »

Hello again!

I'm back and I'm here to report that.....I'm having some problems again with this code especially that I've already added it to my forum. :-/

It's strange, because some of my senior members especially those users who have more than 20 posts sometimes couldn't enter the sub-board that was affected by this code. Either they need to post again at least once or return again to the sub-board and the code will surprisingly grant them access.

I have a couple of newcomers who have gotten into the sub-board EVEN IF the code is in place. :o

Well, kinda feeling uneasy knowing that this code I'm using is having some issues. What could be wrong with it?? I only copied the entire code from my test forum then transferred it into my main site...

Variable:

["highscores",20,"view"]
« Last Edit: May 10, 2012, 12:35am by LunyRed »Link to Post - Back to Top  IP: Logged

[image]
[ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o'
Page 1 of 2 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]


Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile