Page 1 of 2

Password Spoiler BBCode

Posted: 06 Mar 2010, 11:14
by BBCode Bot
Password Spoiler BBCode

Author: JACP
Description: With the Password Spoiler BBCode you can post a spoiler where a password is needed to see the content.
Note that users always can see the password if the have edit rights or can quote the post.
The password can also be fetched it they view source.
So this is more for fun :)

BBCode:

Code: Select all

[pswdspoil={SIMPLETEXT}]{TEXT}[/pswdspoil]
HTML:

Code: Select all

<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">
<b>Spoiler</b>: <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="password=prompt('Please enter password to view this message...',' ');
if (password=='{SIMPLETEXT}')
{
alert('Password Accepted!');
if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '')
{
  this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';
  this.innerText = '';
  this.value = 'Hide'; }
else
{
  this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none';
  this.innerText = '';
  this.value = 'Show';
}
}
">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{TEXT}
</div>
</div>
</div>
Helpline:

Code: Select all

Password Spoiler:  [pswdspoil=password]Message[/pswdspoil]
Example:

Code: Select all

[pswdspoil=Test]Tested with phpBB3. When a person clicks the "Show" button, a prompt for a password pops up. If an incorrect password is entered, the popup goes away, and things stay just as they were. If a correct password is entered, the popup goes away and the spoiler opens up. If a person wants to re-hide the spoiler, they must enter the password again. Of course, the spoiler is reset when the person navigates away from that page.

Please note: Anyone that has editing rights to the message will be able to see the password and the message. So, while this is good for general public viewing, I wouldn't suggest hiding your deep, dark secrets with it.[/pswdspoil]
Demo: (password is test)
[pswdspoil=test]Tested with phpBB3. When a person clicks the "Show" button, a prompt for a password pops up. If an incorrect password is entered, the popup goes away, and things stay just as they were. If a correct password is entered, the popup goes away and the spoiler opens up. If a person wants to re-hide the spoiler, they must enter the password again. Of course, the spoiler is reset when the person navigates away from that page.

Please note: Anyone that has editing rights to the message will be able to see the password and the message. So, while this is good for general public viewing, I wouldn't suggest hiding your deep, dark secrets with it.[/pswdspoil]

Re: Password Spoiler BBCode

Posted: 20 Mar 2010, 04:43
by kevinviet
Hi Stoker
Some how this BBcode doesn't working on my board and here too, I use Firefox browser 3.6. When i input the password not thing happen?. Can you check ? thanks

Re: Password Spoiler BBCode

Posted: 20 Mar 2010, 04:55
by cisco007
i am using FF 3.7a3 and it works fine for me!

Re: Password Spoiler BBCode

Posted: 20 Mar 2010, 05:04
by kevinviet
cisco007 » 20 Mar 2010, 03:55 wrote:i am using FF 3.7a3 and it works fine for me!
where you get FF 3.7a3 ? I go for update my FF browser but the latest is only 3.6

Re: Password Spoiler BBCode

Posted: 20 Mar 2010, 08:44
by Stoker
Works fine for me with Firefox and Internet Explorer, but Internet Explorer is blocking the popup so you have to allow that.

Re: Password Spoiler BBCode

Posted: 20 Mar 2010, 13:03
by Anthies
Great BBCode, just what I wanted.

Re: Password Spoiler BBCode

Posted: 20 Mar 2010, 14:39
by cisco007
kevinviet » 20 Mar 2010, 04:04 wrote:
cisco007 » 20 Mar 2010, 03:55 wrote:i am using FF 3.7a3 and it works fine for me!
where you get FF 3.7a3 ? I go for update my FF browser but the latest is only 3.6

it's an experimental version, so don't worry about getting it now! :tup:

Re: Password Spoiler BBCode

Posted: 21 Mar 2010, 14:28
by Sir Xiradorn
I ask to me if there is a method to hide the pass in source code?

Re: Password Spoiler BBCode

Posted: 21 Mar 2010, 15:55
by Inner Circle
when i quote the message where someone posted this bbcode, you could see the password he used, or am i missing something?

Re: Password Spoiler BBCode

Posted: 21 Mar 2010, 16:09
by cisco007
it says so in the first post!

Code: Select all

Author: JACP
Description: With the Password Spoiler BBCode you can post a spoiler where a password is needed to see the content.
Note that users always can see the password if the have edit rights or can quote the post.
The password can also be fetched it they view source.