A Spoiler BBCode

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
patrikstar
Registered User
Posts: 330
Joined: Sun Feb 12, 2006 9:37 am
Location: Phoenix, AZ
Contact:

A Spoiler BBCode

Post by patrikstar »

I was bored messing with BBCodes so here is one.

*updated*

Added no id attribute and works perfect for multiple spoilers and is 1 line long

AdminCP>Posting>BBCodes

Input into correct text areas.

BB Usage:

Code: Select all

[spoiler]{TEXT}[/spoiler]
HTML Replace:

Code: Select all

<h6><span onclick="if (this.innerHTML != 'click for spoiler') { this.innerHTML = 'click for spoiler' } else { this.innerHTML = 'click to hide<br />{TEXT}'}">click for spoiler</span></h6>
Purpose: Where you have [spoiler]text here[/spoiler] on the page it will say "click for spoiler" and if you click it the text "click for spoiler" will be replaced with the words defined by the poster

This is to give out answers to solutions without showing them only if the person wants to see it does he click the thing.

Say your talking about a movie and you dont want to give away a scene to anyone who hasnt seen the movie but you want to say it so if anyone has seen the movie or doesnt care they can click and see what it says.


*update*
small problem i found but can't seem to fix

some tags need to be around the spoiler instead of inside of it like the size tag if you want to size the text use this method

Code: Select all

[size=18][spoiler]This is a spoiler[/spoiler][/size]
not

Code: Select all

[spoiler][size=18]This is a spoiler[/size][/spoiler]
Last edited by patrikstar on Thu Jun 29, 2006 1:15 am, edited 5 times in total.
User avatar
RATT
Registered User
Posts: 734
Joined: Fri Aug 19, 2005 6:27 am

Re: A Spoiler BBCode

Post by RATT »

patrikstar wrote: I was bored messing with BBCodes so here is one.

AdminCP>Posting>BBCodes

Input into correct text areas.

BB Usage:

Code: Select all

[spoiler]{TEXT}[/spoiler]
HTML Replace:

Code: Select all

<h6><span onclick="document.getElementById('{TEXT}').innerHTML = '{TEXT}' ">Spoiler (click for spoiler)</span></h6>
<div id="{TEXT}"></div>


Wuts the purpose in this?wut duz it do?
cooleo100d
Registered User
Posts: 113
Joined: Wed Sep 03, 2003 7:49 pm
Contact:

Post by cooleo100d »

That's pretty cool.

Thanks for posting it.
DKing
Registered User
Posts: 751
Joined: Sat Jul 03, 2004 8:38 pm

Re: A Spoiler BBCode

Post by DKing »

RATT wrote:
patrikstar wrote:I was bored messing with BBCodes so here is one.

AdminCP>Posting>BBCodes

Input into correct text areas.

BB Usage:

Code: Select all

[spoiler]{TEXT}[/spoiler]
HTML Replace:

Code: Select all

<h6><span onclick="document.getElementById('{TEXT}').innerHTML = '{TEXT}' ">Spoiler (click for spoiler)</span></h6>
<div id="{TEXT}"></div>


Wuts the purpose in this?wut duz it do?

Read his full post. Gosh, some people....

Umm nice post! I'll go ahead and copy this down before a mod removes it because this thread isn't really about support liek this forum is asking for! :P lol but yeah thanks! :)
-DKing
Latest phpBB Version: 2.0.21
Search For a MOD: MOD Search
User avatar
patrikstar
Registered User
Posts: 330
Joined: Sun Feb 12, 2006 9:37 am
Location: Phoenix, AZ
Contact:

Post by patrikstar »

ya he didnt see the full post i updated it but ya there is no feature forum to share so i just put it here where 3.0 users would see it
User avatar
RATT
Registered User
Posts: 734
Joined: Fri Aug 19, 2005 6:27 am

Post by RATT »

patrikstar wrote: ya he didnt see the full post i updated it but ya there is no feature forum to share so i just put it here where 3.0 users would see it


Thankyou patrik for editing your post After i posted my post.
DKing wrote: Gosh, some people....


Yep ur right DKing, Gosh some people...Read his post,

It was edited after i posted mine.
Sometimes its better to be quiet and look foolish rather than open the mouth and remove all doubt. ;)
User avatar
cheater512
Registered User
Posts: 296
Joined: Sat Mar 05, 2005 11:27 pm
Location: Brisbane, Australia
Contact:

Post by cheater512 »

Someone else was posting Spoiler code which is a bit fancier and doesnt use a id= parameter.
Might want to look in to it.

Otherwise its sweet.

I wonder how we can keep track of all the custom bbcodes?
User avatar
patrikstar
Registered User
Posts: 330
Joined: Sun Feb 12, 2006 9:37 am
Location: Phoenix, AZ
Contact:

Post by patrikstar »

cheater512 wrote: Someone else was posting Spoiler code which is a bit fancier and doesnt use a id= parameter.
Might want to look in to it.

Otherwise its sweet.

I wonder how we can keep track of all the custom bbcodes?


i saw one but the guy didnt seem to have it working unless you meant another one
User avatar
cheater512
Registered User
Posts: 296
Joined: Sat Mar 05, 2005 11:27 pm
Location: Brisbane, Australia
Contact:

Post by cheater512 »

Yeah but that code can be made to work and is easier since it doesnt need a id. :)
ElbertF
Registered User
Posts: 527
Joined: Thu Mar 11, 2004 9:41 pm
Location: Australia
Contact:

Post by ElbertF »

This one is pretty perfect (no ID):

Code: Select all

[spoiler]{TEXT1}[/spoiler]

Code: Select all

<div><input type="button" value="&raquo;" style="width: 30px; font-size: 10px;" onClick="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 = '&laquo'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = '&raquo;'; }"></div><div><div style="display: none;">
{TEXT1}</div></div>
Trel
Registered User
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid
Contact:

Post by Trel »

Code: Select all

<div class="spoiler">
<input type="button" class="spoiler-button" onClick="this.nextSibling.nextSibling.style.display ='block';this.parentNode.removeChild(this);" value="Show Spoiler">
<span class="spoiler-content" style="display:none">{TEXT}</span>
</div>
This one is even smaller and doesn't use ID ;)
User avatar
patrikstar
Registered User
Posts: 330
Joined: Sun Feb 12, 2006 9:37 am
Location: Phoenix, AZ
Contact:

Post by patrikstar »

my id one is a single line and works perfect so whats the problem

also those buttons look horid to me i like text to click on rather than buttons

also etncrew yours only supports one spoiler per page and doenst let anyone know that they will spoil something if they click the buttons its just some arrows

anyways i updated my code to be better and works perfect so what ever
User avatar
SHS`
Former Team Member
Posts: 6615
Joined: Wed Jul 04, 2001 9:13 am
Location: Yellow Beach, Nine Dragons, Hong Kong
Name: Jonathan Stanley
Contact:

Post by SHS` »

Trel wrote:

Code: Select all

<div class="spoiler">
<input type="button" class="spoiler-button" onClick="this.nextSibling.nextSibling.style.display ='block';this.parentNode.removeChild(this);" value="Show Spoiler">
<span class="spoiler-content" style="display:none">{TEXT}</span>
</div>
This one is even smaller and doesn't use ID ;)

Code: Select all

<span style="background-color: black; color: black;">{TEXT}</span>
K.I.S.S. Trel... :P
Jonathan “SHS`” Stanley • 史德信
Image
Trel
Registered User
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid
Contact:

Post by Trel »

SHS` wrote:
Trel wrote:

Code: Select all

<div class="spoiler">
<input type="button" class="spoiler-button" onClick="this.nextSibling.nextSibling.style.display ='block';this.parentNode.removeChild(this);" value="Show Spoiler">
<span class="spoiler-content" style="display:none">{TEXT}</span>
</div>
This one is even smaller and doesn't use ID ;)

Code: Select all

<span style="background-color: black; color: black;">{TEXT}</span>
K.I.S.S. Trel... :P


So, now there's this skin which has a black background. How do you know you're supposed to highlite ;)
cooleo100d
Registered User
Posts: 113
Joined: Wed Sep 03, 2003 7:49 pm
Contact:

Post by cooleo100d »

Trel wrote: So, now there's this skin which has a black background. How do you know you're supposed to highlite ;)

Wouldn't the browser highlight with a different color?
Locked

Return to “[3.0.x] Support Forum”