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.

Create Password Protected Forum HELP

View previous topic View next topic Go down

Create Password Protected Forum HELP

Post by Noctis on May 22nd 2011, 6:59 pm

I attempted to do the "Create Password Protected Forum" and I couldnt even read all the directions. Some of it was cut off. Does anyone have the complete version?

Noctis
Forumember

Posts : 98
Reputation : 0
Language : English

Back to top Go down

Re: Create Password Protected Forum HELP

Post by Maikeru Shinigami on May 22nd 2011, 7:33 pm

If you have a custom homepage, you could do some javascript for a password. This is an untested script, try it out:
<html>
<head>
<title>ENTER TITLE OF PAGE HERE!</title>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9","A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
var pass="ENTER PASSWORD HERE"
var z=23;
var y=28;
var f= new Array();
var K= new Array();
for (x=0; x<10; x++){
f[x]=x<<9
f[x]+=23
}
for (x=10; x<36; x++){
y=y<<1
v= Math.sqrt(y)
v = parseInt(v,16)
v+=5
f[x]=v
y++
}
for (x=36; x<62; x++){
z=z<<1
v= Math.sqrt(z)
v = parseInt(v,16)
v+=74
f[x]=v
z++
}
var iCounter = ENTER AMOUNT OF RETRIES IF PASSWORD FAILS //How many retries
function inc(){
iCounter--
if (iCounter > 0)
{
if (confirm("\nPassword is incorrect.\n\n\n\nRetry?"))
Check()
else
alert('ENTER WHAT YOU WANT IT TO SAY IF PASSWORD IS INCORRECT e.g. Incorrect - Try Again');
history.go(-1);
}
else
alert('ENTER WHAT YOU WANT IT TO SAY IF AMOUNT OF RETRIES ABOVE ARE REACHED e.g. You have failed "X" times. Access Denied.');
history.go(-1);
}
function Check(){
pass = prompt("ENTER WHAT YOU WANT IT TO SAY ABOVE THE BOX THE ENTER PASSWORD e.g. Enter Password:","")
if(pass==null || pass==""){
history.go(-1)}
else{
var lpass=(pass.length)+1
for (l=1; l<lpass; l++){
K[l]=pass.charAt(l)
}
var code=0;
for (y=1; y<lpass; y++){
for(x=0; x<62; x++){
if (K[y]==base[x]){
code+=f[x]
code*=y
}
}
}

if (code==174153441) // code==ENTER PASSWORD < I'm not very good with JavaScript, so that part is a guess, be careful!

go()
else
inc()
}
}
function go(){
location.href=pass+".html";
}
// End -->
</SCRIPT>
<body>
<center>
<A HREF="javascript:Check()">Access the protected area.</A><BR>
</center>
</body>
</html>

Maikeru Shinigami
Forumember

Male Posts : 120
Reputation : 10
Language : English
Location : Location Location Awesome Level: 9,001

Back to top Go down

Re: Create Password Protected Forum HELP

Post by Noctis on May 22nd 2011, 9:57 pm

No I mean like individual forums.

Noctis
Forumember

Posts : 98
Reputation : 0
Language : English

Back to top Go down

Re: Create Password Protected Forum HELP

Post by Maikeru Shinigami on May 23rd 2011, 12:08 am

Oh! Now I understand. Here is the code:
Code:
<script>
function checkform(form)
{
if (form.pass.value != "abc" )
{
alert('You have entered wrong Password! Please try again!');
return false;
}
}

</script>


<br><br><br><div align="center">
<form method="post" onsubmit="return checkform(this);" name="password" action="http://khoahoctunhien.2forum.biz/">


<label><input value="Enter Password" name="pass" onclick="if (this.value == 'Enter Password') this.value = '';" onblur="if (this.value == '') this.value = 'Enter Password';" type="text"></label>
<br>
<br>
<b>Please enter the Password to login!</b><br>
<b>(Pass : abc)</b>

<br>
<br><div align="center"><input name="ok" value="Enter!" type="submit">

</div>

</form>

<form method="post" onsubmit="return checkform(this);" name="password" action="YOUR-LINK-HERE">

Edit this as well:
<script>
function checkform(form)
{
if (form.pass.value != "YOUR-PASS" )
{
alert('You have entered wrong Password! Please try again!');
return false;
}
}

</script>

Add all of this onto your HTML. Which means you must make a new HTML page.

Maikeru Shinigami
Forumember

Male Posts : 120
Reputation : 10
Language : English
Location : Location Location Awesome Level: 9,001

Back to top Go down

Re: Create Password Protected Forum HELP

Post by MrMario on May 23rd 2011, 12:47 am

I'll fix the tutorial. Something happened with the layout. :/

MrMario
Helper
Helper

Male Posts : 22186
Reputation : 1830
Language : test

http://test.com

Back to top Go down

Re: Create Password Protected Forum HELP

Post by Maikeru Shinigami on May 23rd 2011, 12:55 am

There is not anything wrong with the tutorial. The reason why the layout is cut in half, is because of the forum widgets. Click on the arrow on top of the forum widgets, and everything should be fine. The forum widgets are causing this.

Maikeru Shinigami
Forumember

Male Posts : 120
Reputation : 10
Language : English
Location : Location Location Awesome Level: 9,001

Back to top Go down

Re: Create Password Protected Forum HELP

Post by MrMario on May 23rd 2011, 12:59 am

Nope it wasn't. The code used for the layout in the post caused the issue. Its fixed now.

MrMario
Helper
Helper

Male Posts : 22186
Reputation : 1830
Language : test

http://test.com

Back to top Go down

Re: Create Password Protected Forum HELP

Post by Vangogh on June 17th 2011, 1:30 am

How/Can you apply this to your forum as a whole?
Like the home page of my forum (with all the forums listed on it).
I want to keep my whole forum private to those who know the password...
Where would I paste the code? Because there is no body... or a place to paste it on to.

Thanks!

Vangogh
New Member

Posts : 2
Reputation : 0
Language : English

Back to top Go down

Re: Create Password Protected Forum HELP

Post by Sanket on June 17th 2011, 7:38 am

As is login is required. So what else do you need?

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

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