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.

How can I Password Protect a specific Forum?

View previous topic View next topic Go down

Solved How can I Password Protect a specific Forum?

Post by Van-Helsing on October 26th 2013, 2:09 pm

Hi all,
How can I Password Protect a specific forum with password in my forum with JavaScript and/or CSS? I have tried some of the tuturials here without success. Furthermore I was red the tutorials in AvacWeb:
Spoiler:
Could you help me? Is this code correct? How can I make it work?
I am using the following javascripts:

Spoiler:

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):alert("Invalid Password"),window.location.reload())}};

Spoiler:

Code:

fpass.add('1', 'This is a Password Protected Forum. Please Enter the Password:', 'password');

Are these scripts correct or must I put them in one script?

* My Forum Version is PHPBB2.

Best Regards,
Dark-Avenger


Last edited by Dark-Avenger on October 30th 2013, 2:18 pm; edited 3 times in total

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by [NH]Shadow on October 26th 2013, 3:48 pm

I am coding a JS mod that will do this; the password protect for forums is a relatively simple patch, but this is not its only function, so it might be a few weeks before it is finished.

[NH]Shadow
Forumember

Male Posts : 28
Reputation : 3
Language : English, Русский, Svenska, Español

http://teamnighthawk.forumotion.com

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by Van-Helsing on October 28th 2013, 7:53 pm

Bump?

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by Van-Helsing on October 30th 2013, 1:30 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by Kaizer Lee on October 30th 2013, 6:55 am

Hi, I tested it out on my forum and it worked.

Can you please check if there are scripts conflicting with these code? You can do that by trying to delete one script (Make sure you have a hard copy of it) and see if there'll be an effect to the Password script and then put it back if it doesn't Smile

Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by Van-Helsing on October 30th 2013, 11:19 am

Hi all,
I have clean all other javascripts and placed these in two javascripts and the codes are:

Javascript For Password Protected Forums
Spoiler:

Code:

fpass.add('71', 'This is a Password Protected Forum. Please Enter the Password:', 'testing');

Main Javascript for forum password protection
Spoiler:

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):alert("Invalid Password"),window.location.reload())}};[/spoiler]
I ve just placed them and I have removed the forum cookies but its not working.Sad 

Best Regards,
Dark-Avenger

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by Van-Helsing on October 30th 2013, 2:18 pm

Ok guys I have fix it. I was put the two scripts into one and disabled the Google Analytics Javascript. That JavaScript conflicts the Forum Password Protection Javascript.

Thank you all for your assistance.
Best Regards,
Dark-Avenger

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I Password Protect a specific Forum?

Post by Sir Chivas™ on October 30th 2013, 11:33 pm

Dark-Avenger wrote:Hi all,
I have clean all other javascripts and placed these in two javascripts and the codes are:

Javascript For Password Protected Forums
Spoiler:

Code:

fpass.add('71', 'This is a Password Protected Forum. Please Enter the Password:', 'testing');

Main Javascript for forum password protection
Spoiler:

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):alert("Invalid Password"),window.location.reload())}};[/spoiler]
I ve just placed them and I have removed the forum cookies but its not working.Sad 

Best Regards,
Dark-Avenger
Dark-Avenger wrote:Ok guys I have fix it. I was put the two scripts into one and disabled the Google Analytics Javascript. That JavaScript conflicts the Forum Password Protection Javascript.

Thank you all for your assistance.
Best Regards,
Dark-Avenger
Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!


Topic Solved & Locked.

Sir Chivas™
Support Moderator
Support Moderator

Male Posts : 6756
Reputation : 428
Language : English, Spanish, and French
Location : || CSS || HTML || Graphics Designs || Support ||

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