|
[ C ] Passworded Spoilers
|
|
Topic Started: Jun 13 2011, 12:51 PM (963 Views)
|
|
Owen532
|
Jun 13 2011, 12:51 PM
Post #1
|
- Posts:
- 31
- Group:
- Members
- Member
- #389,138
- Joined:
- April 30, 2011
|
Board Address: Private Board Software: Zetaboards Description:
Even though I do not want it (I'd probably require it), but wouldn't it be good instead of PM'ing something to everyone. Staff members have a special password to unlocking spoilers, or members/certain groups can, etc.
So you open the spoiler and then inside is a password box and if the password is correct, then if opens fully, if not try again or close it.
|
|
|
| |
|
Xero
|
Jun 13 2011, 01:43 PM
Post #2
|
- Posts:
- 596
- Group:
- Members
- Member
- #383,666
- Joined:
- February 25, 2010
|
I apologize. I have failed and am unable to complete this request.
Edited by Xero, Jun 19 2011, 02:09 AM.
|
|
|
| |
|
Quozzo
|
Jun 28 2011, 03:37 PM
Post #3
|
By the blood of Sanguinius!
- Posts:
- 1,780
- Group:
- Members
- Member
- #386,319
- Joined:
- September 1, 2010
- I'm Browsing With
- Chrome
- Latest Blog Entry
- http://resources.zetaboards.com/blog/main/2070103/
|
In a spoiler, place the password like so: [password=bar]
- Code: Below the Board
-
<script type="text/javascript"> $('.spoiler:contains("[password=")').each(function(){ $(this).html($(this).html().replace(/\[password=([^'"]+?)\]/, "<span style='display:none;'>$&</span>")) }).prev().click(function(event){ if($(this).next().css('display') == "none"){ event.stopImmediatePropagation(); $(this).next().html().match(/\[password=([^"']+?)\]/) pass = prompt("What is the password","") if(pass == RegExp.$1){ $(this).next().toggle(); }else{ alert('Sorry, try again') }; }; }); </script>
|
|
|
| |
|
anubis505-ZNR
|
Jul 1 2011, 11:05 PM
Post #4
|
- Posts:
- 20
- Group:
- Members
- Member
- #33,776
- Joined:
- October 27, 2004
|
I wanted to use this but no matter what I try it won't work.
- Code:
-
[spoiler][password=bar]Some text[/spoiler] [spoiler[password=bar]]Some text[/spoiler] [spoiler password=bar]Some text[/spoiler] [spoiler=[password=bar]]Some text[/spoiler] [spoiler]Some text[/spoiler] [password=bar] [spoiler][password="bar"]Some text[/spoiler]
etc... Nothing worked in FF or Chrome. I put the script in Below the Board.
[password=bar] does disappear when inbetween the spoiler tags. But the normal spoiler text does not. Nor does it prompt for a password. I even tried logging in as a different user in case it let the poster see it unconditionally.
|
|
|
| |
|
Cory
|
Jul 1 2011, 11:26 PM
Post #5
|
- Posts:
- 16,587
- Group:
- Members
- Member
- #44,593
- Joined:
- February 12, 2005
|
Try the first one only, if it still doesn't work, please post your Board Template.
|
|
|
| |
|
anubis505-ZNR
|
Jul 2 2011, 01:23 AM
Post #6
|
- Posts:
- 20
- Group:
- Members
- Member
- #33,776
- Joined:
- October 27, 2004
|
The first one is what I had initially tried and retried.
Spoiler: click to toggle - Code: Below the Board
-
<link rel="stylesheet" href="http://z3.ifrm.com/142/141/0/p209444/examples.css" type="text/css" media="screen"> <link rel="stylesheet" href="http://z3.ifrm.com/142/141/0/p209495/jquery.jgrowl.css" type="text/css" media="screen"> <script type="text/javascript" src="http://z3.ifrm.com/142/141/0/p209494/jquery.jgrowl_minimized.js"></script>
<script type="text/javascript"> //<![CDATA[ if($("#top_info a:first").attr("href") != main_url+"login/"){ $(function(){ $("#top_menu").append('<li><a href="javascript:void(0);">The Guild</a><ul><li><a href="javascript:aio2.donate.form2();">Donate</a></li><li><a href="javascript:aio2.bank.get_balance();">Bank</a></li><li><a href="javascript:aio2.posting.leaderboard(0);">Leaderboard</a></li><li><a href="'+main_url+'pages/shop">Market</a></li><li><a href="'+main_url+'pages/acp">Admin CP</a></li></ul></li>'); $.jGrowl.defaults.animateClose = {marginBottom:"-50px",opacity:"hide"}; $.jGrowl.defaults.position = "bottom-left"; $.jGrowl.defaults.glue = "before"; $.jGrowl.defaults.life = 10000; }); var aio_custom = { cd : "51abd10c85", prompt_default : { buttons : {}, opacity : 0.5, persistent : false } } $.getScript("http://z5.ifrm.com/9054/28/0/f5015499/shop.js"); } else { if($("#aiopage").size() > 0){location.href=main_url+"login";} } //]]> </script>
<script type='text/javascript'> //Awards and Awards Page by Quozzo awardsheight = 40; awardswidth = 40; var awards = new Array(); a=0; //awards[a++] = new Array("username","award","piccy","date","reason","worth"); awards[a++] = new Array("PainWhisper","GFX Contributor","http://z5.ifrm.com/9054/28/0/p1027690/GFX.png","6/24/2011","Awarded to members who contribute their graphics talents to HotN.","~0"); awards[a++] = new Array("PainWhisper","Eskiv Champ","http://z5.ifrm.com/9054/28/0/p1027689/eskiv_award.png","6/24/2011","Eskiv Tourney Champion","~50"); awards[a++] = new Array("PainWhisper","1,000+ Posts","http://z5.ifrm.com/9054/28/0/p1027769/comment.png","6/26/2011","Made 1,000+ posts.","~50"); awards[a++] = new Array("Nubi","1,000+ Posts","http://z5.ifrm.com/9054/28/0/p1027769/comment.png","6/24/2011","Made 1,000+ posts.","~50"); awards[a++] = new Array("Setoshin","1,000+ Posts","http://z5.ifrm.com/9054/28/0/p1027769/comment.png","6/26/2011","Made 1,000+ posts.","~50"); awards[a++] = new Array("soul of sin","1,000+ Posts","http://z5.ifrm.com/9054/28/0/p1027769/comment.png","6/26/2011","Made 1,000+ posts.","~50"); awards[a++] = new Array("Anomaly","Copter Champ","http://z5.ifrm.com/9054/28/0/p1027688/Helicopter.png","6/24/2011","Copter Crash Tourney Champion","~50"); awards[a++] = new Array("Hero","Cookie Monster","http://z5.ifrm.com/9054/28/0/p1027783/cookie.gif","6/28/2011","Have 50 Cookies in your possession.","~50"); </script> <script type='text/javascript' src='http://z5.ifrm.com/9054/28/0/f5015497/awards2.js'></script>
<script type='text/javascript' src='http://z5.ifrm.com/9054/28/0/p1027787/customprofile.js'>//Simple Profile Customization </script>
<script type='text/javascript' src='http://z3.ifrm.com/212/175/0/p336126/countries.js'>//Country flags in post </script>
<script type='text/javascript' src='http://z5.ifrm.com/9054/28/0/p1027784/moods.js'>//Moods in posts </script>
<script type="text/javascript"> var fid = "hPTHhp1xAoWp"; $.getScript("http://zeta-host.zxq.net/files/comments/v2/mainC.js"); //ZB profile comments </script>
<script type='text/javascript' src='http://z5.ifrm.com/9054/28/0/f5015484/progressbar.js'>//progress bar in posts </script>
<script type='text/javascript' src='http://z5.ifrm.com/9054/28/0/f5015482/tabs.js'>//clickable tabs in posts </script>
<style type='text/css'> .activetab{ font-weight: 900; } </style>
<script type='text/javascript' src='http://z5.ifrm.com/9054/28/0/f5015485/tablebbc.js'>//create tables via bbcode in posts </script>
<script type='text/javascript' src='http://z3.ifrm.com/313/104/0/p246374/dice_roll.js?c=3'> //generate dice roll in posts </script>
<script type="text/javascript"> $("td.c_last, tr.c_info").remove(); $("div.category:not(#stats) td.c_mark, td.c_subforum, td.c_forum").attr("rowspan", "1"); $("td.c_subforum, .category td.c_foot").attr("colspan", "2"); </script>
<script type="text/javascript"> $("tr[id*='forum']:not(:eq(-1)), tr:has(td.c_subforum)").after("<tr><td colspan='2' style='background: none; border: 0'></td></tr>"); $("tr:has(td.c_subforum), div[id*='cat'] tr:has(td.c_foot)").prev().remove(); </script>
<script type="text/javascript"> $('.spoiler:contains("[password=")').each(function(){ $(this).html($(this).html().replace(/\[password=([^'"]+?)\]/, "<span style='display:none;'>$&</span>")) }).prev().click(function(event){ if($(this).next().css('display') == "none"){ event.stopImmediatePropagation(); $(this).next().html().match(/\[password=([^"']+?)\]/) pass = prompt("What is the password","") if(pass == RegExp.$1){ $(this).next().toggle(); }else{ alert('Sorry, try again') }; }; }); </script>
<style type="text/css"> /* colored usernames */ a.member[href*="/profile/53276"] { color: #000; } </style>
Good luck, it's kind of a mess. That's just my below the board. I can post the rest if you need it.
|
|
|
| |
|
Quozzo
|
Jul 2 2011, 02:16 AM
Post #7
|
By the blood of Sanguinius!
- Posts:
- 1,780
- Group:
- Members
- Member
- #386,319
- Joined:
- September 1, 2010
- I'm Browsing With
- Chrome
- Latest Blog Entry
- http://resources.zetaboards.com/blog/main/2070103/
|
It works if you place it at the bottom of the Below the Board section, something is clearly clashing with it. I also increased its functionality by opening if the user is the poster.- Code:
-
<script type="text/javascript"> $('.spoiler:contains("[password=")').each(function(){ $(this).html($(this).html().replace(/\[password=([^'"]+?)\]/, "<span style='display:none;'>$&</span>")) }).prev().click(function(event){ if($(this).next().css('display') == "none" && !$(this).parent(".c_post").parent().prev().find(".c_username").text().match($('#top_info strong').text()) ){ event.stopImmediatePropagation(); $(this).next().html().match(/\[password=([^"']+?)\]/) pass = prompt("What is the password","") if(pass == RegExp.$1){ $(this).next().toggle(); }else{ alert('Sorry, try again') }; }; }); </script>
|
|
|
| |
|
anubis505-ZNR
|
Jul 2 2011, 03:44 AM
Post #8
|
- Posts:
- 20
- Group:
- Members
- Member
- #33,776
- Joined:
- October 27, 2004
|
Well, I just briefly took out everything in my Below the Boards section except for your script and it still doesn't work. So it must be somewhere else... *attacks forum*
Yep. Something else is definitely messing with it. I took out everything and it worked. I guess I'll go through each script at a time and try to find the conflict.
EDIT
This makes sense.
- Code:
-
<script type="text/javascript"> //SMOOTH spoiler $(function(){ $(".spoiler_toggle").unbind("click").live("click", function(){ $(this).next().slideToggle("fast"); }); }); </script>
The Smooth Spoiler seems to be the problem. Fortunately it was the first thing in my Board Template.
|
|
|
| |
|
Cory
|
Jul 2 2011, 12:38 PM
Post #9
|
- Posts:
- 16,587
- Group:
- Members
- Member
- #44,593
- Joined:
- February 12, 2005
|
So you know the solution to get both to work now, yes?
|
|
|
| |
|
Professor Jango
|
Jul 5 2011, 01:01 PM
Post #10
|
- Posts:
- 45
- Group:
- Members
- Member
- #389,429
- Joined:
- June 6, 2011
- My Board URL
- http://forums.port-haven.com
|
Forgive my ignorance, but what would prohibit a user from quoting your post to see what the password was?
|
|
|
| |
|
Quozzo
|
Jul 6 2011, 04:31 AM
Post #11
|
By the blood of Sanguinius!
- Posts:
- 1,780
- Group:
- Members
- Member
- #386,319
- Joined:
- September 1, 2010
- I'm Browsing With
- Chrome
- Latest Blog Entry
- http://resources.zetaboards.com/blog/main/2070103/
|
- Professor Jango
- Jul 5 2011, 01:01 PM
Forgive my ignorance, but what would prohibit a user from quoting your post to see what the password was? or what the content is.- Code:
-
<script type="text/javascript"> $('.spoiler:contains("[password=")').each(function(){ $(this).html($(this).html().replace(/\[password=([^'"]+?)\]/, "<span style='display:none;'>$&</span>")) }).prev().click(function(event){ if($(this).next().css('display') == "none" && !$(this).parent(".c_post").parent().prev().find(".c_username").text().match($('#top_info strong').text()) ){ event.stopImmediatePropagation(); $(this).next().html().match(/\[password=([^"']+?)\]/) var pass = prompt("What is the password","") if(pass == RegExp.$1){ $(this).next().toggle(); }else{ alert('Sorry, try again') }; }; }); var q = $('#txt_quote'); if(q.length){ q.val(q.val().replace(/\[spoiler(?:=(?:.+?))?\](?:.+?)\[\/spoiler\]/gi, function(txt){ if(/\[password=(.+?)\]/.test(txt)) return ""; else return txt; })); }; </script>
If a spoiler has a password then you can't quote it to see the content or the password
|
|
|
| |
|
Cory
|
Jul 6 2011, 08:49 AM
Post #12
|
- Posts:
- 16,587
- Group:
- Members
- Member
- #44,593
- Joined:
- February 12, 2005
|
But you'll still be able to see the password in the page source and Firebug and whatnot, so there's probably no foolproof method to deterring that without the use of PHP/MySQL?
|
|
|
| |
|
Quozzo
|
Jul 6 2011, 04:18 PM
Post #13
|
By the blood of Sanguinius!
- Posts:
- 1,780
- Group:
- Members
- Member
- #386,319
- Joined:
- September 1, 2010
- I'm Browsing With
- Chrome
- Latest Blog Entry
- http://resources.zetaboards.com/blog/main/2070103/
|
- Cory
- Jul 6 2011, 08:49 AM
But you'll still be able to see the password in the page source and Firebug and whatnot, so there's probably no foolproof method to deterring that without the use of PHP/MySQL? Or turn JS off (but i specifically wanted the password in the spoiler for such an occurrence :wink: )
As Cory said, there's no way to possibly secure something using JS alone and nor is it designed for that purpose. JS is executed in the browser so the browser must first see what it needs to secure before executing the JS and for that very reason JS is not used for security. If the JS is hiding omething on the page then disabling JS will mostly be enough to view the content, but if the JS calls content from another page through various methods then its possible to intercept that JS code and change its values to allow it to show the content.
Using JS to hide the protected content is enough to throw off most users who wont know how to circumvent it, or even know its possible.
|
|
|
| |
|
Reid
|
Jul 8 2011, 03:25 PM
Post #14
|
È una trappola!
- Posts:
- 6,767
- Group:
- Developer
- Member
- #223,645
- Joined:
- October 30, 2006
- I'm Browsing With
- Firefox
|
Completed!
Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|