Password protect on each forum Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Password protect on each forum

    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Password protect on each forum

    Post by HogwartsAcademy December 30th 2012, 01:50

    So I've seen this happen to many, many other forums but however aren't Forumotion, as well as read different threads to people actually accomplishing this, so I'm asking everyone out there who knows how to successfully code this, can you please help me out?

    I'm looking to adding a password entry upon each forum of my desire. With looking at my username, you can tell my forum is most likely to be about a school in Harry Potter, right? Well, in Harry Potter, for students to enter their Common Rooms, they must know the password for the door to swing open. This is what I'm requesting of you. Do you know the necessary coding for this to come alive? For a person to click on a forum labelled as Common Room, a text box would come up with a password, for the students to be able to enter the forum, they must know, letter for letter, number for number, the exact password, and once they hit "enter" or "submit" or whatever the entry button is, then they would be able to enter the forum.

    I know this is possible, so please don't tell me to bring this up as a suggestion, all I'm asking for is your help. Thank you.
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy December 30th 2012, 02:48

    Thanks mate, it worked. Is there anyway I can have this password protection feature without the white background so that it uses my background, header and footer?
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy December 30th 2012, 07:05

    That's not what I mean, I'm saying when you click on the forum it stays on the same page but shows the password entry box, then when you enter the correct password it will move to the different page. Is there a way to do this? Please help me out mate.

    Edit: There's a new big problem.. when you click on the forum and the password screen comes up, and if you do not know the password, when you try and click cancel, it for some reason still keeps the password screen up and disables you to close the browser or anything, so I had to alt force close, some of my members needed to reboot their PC's. Help.
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy December 31st 2012, 19:30

    bump
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 1st 2013, 11:13

    No it doesn't mate, it just brings me back to the password screen for some reason.. know what I can do to fix this?
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 1st 2013, 23:20

    Okay I got like 2 different problems with this now..

    1. When I click cancel it works but when you enter the password correctly it redirects to the site's index page and not the forum I set it to..

    2. When you enter the password the correctly it doesn't ask you for it again..
    avatar
    forexrobert
    New Member


    Posts : 6
    Reputation : 1
    Language : english

    Solved Re: Password protect on each forum

    Post by forexrobert January 1st 2013, 23:38

    How can I close a forum in here?
    I don't see anywhere the info on how to close a forum we have just created.

    THank you
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 00:11

    forexrobert wrote:How can I close a forum in here?
    I don't see anywhere the info on how to close a forum we have just created.

    THank you

    What do you mean close? Like delete it? If so, just go to the Admin Panel -> General -> Categories and Forums -> choose the forum you created and click on the red X to delete it.

    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 00:26

    Rideem3 wrote:
    HogwartsAcademy wrote:Okay I got like 2 different problems with this now..

    1. When I click cancel it works but when you enter the password correctly it redirects to the site's index page and not the forum I set it to..

    2. When you enter the password the correctly it doesn't ask you for it again..
    Your second problem isn't a problem. That's meant to happen. It's for convenience. You've entered it once you shouldn't have to again.

    Well what if I change the password? And what about the first question mate?
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 02:51

    Rideem3 wrote:Can you link me to the password protected forum?

    Also, once the user deletes his cookies he has to enter the password again.

    I can't because you need to be logged in to view it, am I allowed to let you use my admin login info?
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 04:18

    Done.

    P.S. Do you find anything wrong with the background of my forum, like when you scroll to the right or left the background only moves but the content doesn't.. maybe it's a CSS problem or just a problem with the theme..
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 04:31

    This is amazing mate, I thank you 100%, is there a code that prompts you to enter the password everytime you click on the forum?
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 10:14

    I tried replacing that with the main code now it doesn't even ask for a password.. lol
    levy
    levy
    Hyperactive


    Male Posts : 2632
    Reputation : 350
    Language : English, Romanian
    Location : Romania

    Solved Re: Password protect on each forum

    Post by levy January 2nd 2013, 10:18

    Try this code

    Code:
    <script>
    function checkform(form)
    {
    if (form.pass.value != "abc" )
    {
    alert('incorect');
    return false;
    }
    }

    </script>

    <form method="post" onsubmit="return checkform(this);" name="password" action="redirect"><label><input value="Scrieti parola aici..." name="pass" onclick="if (this.value == 'Scrieti parola aici...') this.value = '';" onblur="if (this.value == '') this.value = 'Scrieti parola aici...';" type="text"></label> <input name="ok" value="Autentificare" type="submit"></form>

    Replace abc with your password
    Incorect with your message if isn't good password.
    Redirect with link
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 10:38

    RicYiu wrote:Try this code

    Code:
    <script>
    function checkform(form)
    {
    if (form.pass.value != "abc" )
    {
    alert('incorect');
    return false;
    }
    }

    </script>

    <form method="post" onsubmit="return checkform(this);" name="password" action="redirect"><label><input value="Scrieti parola aici..." name="pass" onclick="if (this.value == 'Scrieti parola aici...') this.value = '';" onblur="if (this.value == '') this.value = 'Scrieti parola aici...';" type="text"></label> <input name="ok" value="Autentificare" type="submit"></form>

    Replace abc with your password
    Incorect with your message if isn't good password.
    Redirect with link

    How can I modify this to add more than one forum? Also mate, I think if I can't figure out Rideem's idea, I will turn back to you, thank you brother.
    levy
    levy
    Hyperactive


    Male Posts : 2632
    Reputation : 350
    Language : English, Romanian
    Location : Romania

    Solved Re: Password protect on each forum

    Post by levy January 2nd 2013, 10:46

    You make other "fake" category and add your real cateogry in them.
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 20:34

    Thank you.
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 20:46

    Rideem3 wrote:Try this:
    Code:
    var fpass={add:function(a,b,c){a=RegExp("f"+a+"-");a.test(window.location.pathname.substr(1))&&(window.stop(),prompt(b)==c?window.location.reload():(alert("Invalid Password"),window.location.pathname="/forum"))}};

    It brings the Password up but when you click enter it redirects to pw screen again, and if you don't get it right it says invalid then redirects to forum.

    Want to use the Admin Acc again?
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 20:53

    Rideem3 wrote:No, that's not necessarry. You can't make it ask for the password every time because you won't be able to view the forum at all.

    Okay.. how can I make it ask for it once again..
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 20:56

    Rideem3 wrote:Use this code:
    Code:
    var fpass={add:function(a,b,c){a=RegExp("f"+a+"-");a.test(window.location.pathname.substr(1))&&!my_getcookie("forumpass_"+window.location.pathname.substring(1,window.location.pathname.indexOf("-")))&&(window.stop(),prompt(b)==c?(my_setcookie("forumpass_"+window.location.pathname.substring(1,window.location.pathname.indexOf("-")),!1),window.location.reload()):alert("Invalid Password"),window.location.pathname="/forum")}};

    It does the same thing lad, when you enter the password correctly it redirects to the forum index page..
    avatar
    HogwartsAcademy
    Forumember


    Posts : 474
    Reputation : 1
    Language : English

    Solved Re: Password protect on each forum

    Post by HogwartsAcademy January 2nd 2013, 21:17

    Works. Finally man everything is great, solved.