The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Password protect on each forum

View previous topic View next topic Go down

Solved Password protect on each forum

Post by HogwartsAcademy on December 30th 2012, 12:50 am

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.

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on December 30th 2012, 1:48 am

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?

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on December 30th 2012, 6:05 am

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.

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on December 31st 2012, 6:30 pm

bump

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 1st 2013, 10:13 am

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?

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 1st 2013, 10:20 pm

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..

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by forexrobert on January 1st 2013, 10:38 pm

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

forexrobert
New Member

Posts : 6
Reputation : 1
Language : english

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 1st 2013, 11:11 pm

@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.


HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 1st 2013, 11:26 pm

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?

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 1:51 am

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?

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 3:18 am

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..

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 3:31 am

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?

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 9:14 am

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

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by levy on January 2nd 2013, 9:18 am

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

levy
Hyperactive

Male Posts : 2582
Reputation : 345
Language : Romanian, English
Location : criticize artwork, not people!

http://help.forumotion.com/

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 9:38 am

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.

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by levy on January 2nd 2013, 9:46 am

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

levy
Hyperactive

Male Posts : 2582
Reputation : 345
Language : Romanian, English
Location : criticize artwork, not people!

http://help.forumotion.com/

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 7:34 pm

Thank you.

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 7:46 pm

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?

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 7:53 pm

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..

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 7:56 pm

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..

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

Solved Re: Password protect on each forum

Post by HogwartsAcademy on January 2nd 2013, 8:17 pm

Works. Finally man everything is great, solved.

HogwartsAcademy
Forumember

Posts : 474
Reputation : 1
Language : English

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum