PDA

View Full Version : A forum lock



123123
08-16-2006, 01:45 PM
i have a forum and i want that before users of my forum enter and category or forum the must agree with a certain disclaimer.

i mean as a user clicks on a forum link a window should come in front of him and asks wether you agree or disagree with watever is written in the text in that window.until and unless the user clicks agree he/she cant enter the forum or category clicked.

i want a javascript code that can be placed in the forum description box,so i am requesting it here.

thanx in advance

Twey
08-16-2006, 02:17 PM
Don't need Javascript for this.
<p>Disclaimer: blather blather blather blather blather blather.</p>
<form action="/forum/"><input type="submit" value="I Agree"></form>
<form action="/"><input type="submit" value="I Disagree"></form>

123123
08-16-2006, 03:56 PM
i think you didnt quite understood want i requested.


i want that no user could enter forum without agreeing with the disclaimer.


the code that you providedshows the agree,disagree button but doesnt stops the user to enter it unless until he/she agrees.

step by step

1> i click the link to enter a forum category
2> a window should appear asking to click eigther agree or dis agree button without which he/she cannot enter

3>i click on agree
4>now ,i can enter

hope this makes sense:rolleyes:

mwinter
08-16-2006, 03:57 PM
Don't need Javascript for this.

True, but a simple form might not suffice, either. It depends on why the disclaimer is there. If it's for legal protection, then the user must be forcibly be presented with it, otherwise they can claim (and prove) that they could accept the "protected" content without ever even seeing the terms, let alone actually agreeing with them.

If this is the case, a system similar to password protection is necessary: each user establishes a session, and that session stores whether the user agrees to the terms. If they haven't yet, upon making a request to a protected document, the user is prompted by the terms and conditions. If they agree, they can continue. This has to be implemented server-side.

Mike

123123
08-19-2006, 01:00 PM
i require some answers please

Twey
08-19-2006, 08:21 PM
I'm afraid this could get complicated, since what Mike's saying indicates that sessions and/or cookies would be necessary here, and your forum will almost certainly set ones of its own that could interfere. We really need more information, if that is the case.

123123
08-20-2006, 01:15 PM
http://pita-ten

123123
08-20-2006, 01:18 PM
ชื่อีหยั๋ง??:p

123123
08-20-2006, 01:23 PM
ตอบหน่อยดิ๊??:mad:

Twey
08-20-2006, 02:00 PM
私達はあなたをわかりません。 英語を話して下さい。

123123
08-21-2006, 04:02 PM
i don have the access to the core files of my phpbb forum,i can only lace some codes in some areas provided for description.

So i wanted just a simple modification that the user agrees with before entering a paticular category or forum.



:confused: and who made all these blank posts by my user name,it wasn't me......:confused:

costas
08-21-2006, 04:40 PM
Well, I'm new to Javascript, but I think it's not really difficult. You have to write some code using javascript first:


<script language="javascript">
function disclaimer()
{
disclaimer = "Bla Bla Bla"
confirmstatus = confirm(disclaimer)
}
</script>

Then, in the link you add the "OnClick" parameter as shown:


<a href="somepage.html" onClick = disclaimer()>

After he/she has agreed the link process continues. If, on the other hand, he/she doesn't agree the link process stops.

Hope I helped!!!!:)

mburt
08-21-2006, 04:51 PM
Okay.. Now I'm just confused, what were all those weird characters for?

mburt
08-21-2006, 04:55 PM
Looking at the original question, I don't think this would be too hard.

Try this:


<html>
<head>
</head>
<body>
<form action="http://www.google.ca/">
Disclaimer text.. blah blah blah
<br><input type="checkbox" id="b1" onclick="
enter.disabled=false
b2.checked=false
">I Agree
<br><input type="checkbox" id="b2" onclick="
enter.disabled=true
b1.checked=false
" checked>I Disagree
<br><input type="submit" id="enter" value="Enter" disabled="true">
</form>
</body>
</html>

mburt
08-21-2006, 04:56 PM
Costas: that script goes to the target, regardless of the confirm box. If the value is false, you need to put in a return false, so the link won't be activated.

Twey
08-21-2006, 05:01 PM
The problem is that legally, it must be impossible to access the forum without clicking accept on the form.
Okay.. Now I'm just confused, what were all those weird characters for?I think they were Hebrew.

mburt
08-21-2006, 05:02 PM
Yes, I see now. Regardless of "I agree" or "I Disagree" the URL is still there, so it's very easy to get the page.

costas
08-21-2006, 05:07 PM
Costas: that script goes to the target, regardless of the confirm box. If the value is false, you need to put in a return false, so the link won't be activated.

But I tried it and when I pressed "Cancel", it remained in the previous page.

mburt
08-21-2006, 05:41 PM
costas: this is what it should be:


<script language="javascript">
function disclaimer()
{
disclaimer = "Bla Bla Bla"
confirmstatus = confirm(disclaimer)
if (confirmstatus) {}
else {return false}
}
</script>

costas
08-21-2006, 05:43 PM
Mike, you were right and I was all wrong

mburt
08-21-2006, 06:19 PM
Yours could very well work, but my idea nulls the link when the returned value is false. And if it is true, the link proceeds as normal :)

Twey
08-21-2006, 06:33 PM
But it doesn't matter anyway, because neither prevents directly accessing the URL.

mburt
08-21-2006, 06:41 PM
Right :)

The only way I see doing this is to use an encrypter for the page URL.


A=97
B=98
C=99
etc.

Then multiply the values by themselve, then all together, getting your hash code.

Twey
08-21-2006, 07:05 PM
Still doesn't prevent someone who knows the page URL from accessing the page. That sort of thing is fine for simple hidden-page scripts, but in this case it just won't do.

mburt
08-21-2006, 07:12 PM
But.. you could also throw away your dignity, and use a URL like this:


120934ujlkrnm01923c4091u4019274n012f.htm
:)

Twey
08-21-2006, 07:17 PM
But it still doesn't prevent it. :) If it's possible to access the page without having to click "accept" at least once, it won't do.

mburt
08-21-2006, 07:19 PM
Hmm... You could make the page within the disclaimer page. Painstaking work, but it could be done.

Example:


function newpage() {
document.write("<html>"+
"<head>"+
"</head>"+
"<body>"+
"<i>test</i>"+
"</body>"+
"</html>")
}

123123
08-22-2006, 01:44 PM
so which code should i use.....

i am confused:confused:

mwinter
08-22-2006, 02:03 PM
Okay.. Now I'm just confused, what were all those weird characters for?

I think they were Hebrew.

They were Thai.




so which code should i use.....

i am confused

You still haven't established the reasons why you are doing this. As I wrote way back at the start of this thread, if there are legal reasons for you doing this then the solution is not trivial. For a click-through agreement to be legally binding, it must be provable in court: that the user is guaranteed to be presented with it (rather than just shown a link to the terms); that the system is reliable and cannot be bypassed (which rules out any client-side solution); and that it is beyond reasonable doubt that in so agreeing to the terms, the user is aware that they are entering into a contract. If you search the Web, you'll find more information on it all.

If there isn't a legal aspect to this, then something simpler might be possible (including the stock script available here at DD).

Mike

mburt
08-22-2006, 08:55 PM
The real security lies in (as mwinter said) the disclaimer. If it is bypassed, you have to be able to rest it in court