No announcement yet.

Spoiler BBCode

First Prev Next Last
  • Filter
  • Time
  • Show
Clear All
new posts

    loading to test


      it's great and work


        Thank you for this Cup of coffee headed your way!


        • glennrocksvb
          glennrocksvb commented
          Editing a comment
          Thank you very much!

        I spent several hours tinkering with a spoiler tag code last night, I'm not using yours currently but I'm curious to know how difficult it is to add the ability to change the text on the spoiler tag to a user-defined text?

        [spoiler=example]spoiler here[/spoiler]

        Would yield the word "spoiler" on the tag being replaced with "example" instead.

        I've tried messing around with {param} and {option} but can't seem to get it functioning. x.x


        Just to be clear about the use for it and why I'd like to be able to do this. Other than hiding spoilers, we use an expandable/collapsable spoiler tag to condense longer posts and large images as well. It would be useful to name the spoiler tag with a brief description of the contents as opposed to having to type it out below it. I was on another website about 5 years ago that had this option, and it was pretty great.


          Do you want something like thisthat does exactly this kind of Spoiler BBCode? If so, here is the codeyou just have to replace "SPOILER" with {option} in the original replacement code in the first post and enable "Use {option}" setting. See the code below.
          HTML Code:
          <span style="cursor:pointer; border:1px solid red;padding:2px; color:red" onclick="'';'none'" title="Click to show content">{option}</span><span style="display:none; cursor:pointer; border:1px dotted #000; padding:2px" onclick="'';'none'" title="Click to hide content">{param}</span>
          Read this important noteNote: If user doesn't provide the {option} text in the spoiler BBCode tag, then the spoiler will not be displayed and there is nothing to click to show it.
          Last edited by glennrocksvb; 08-28-2018, 07:52 AM.


          • jkotlowski
            jkotlowski commented
            Editing a comment
            Dang, it was that easy. I was severely overcomplicating it! Thanks much Glenn. ^_^

          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            Glad to help

          Wonderful, added this !




              Very good modification. Thank you!


                Hi, I'm using vB 4.2.5

                This works perfectly, however when there is no text above or below it.. it displays it as such:

                Click image for larger version  Name:	2d5bec8c40.png Views:	0 Size:	1.5 KB ID:	21799

                Then if I add any text all at above the spoiler tags

                Click image for larger version

Name:	a74ba734c0.png
Views:	32
Size:	1.7 KB
ID:	21800

                Same applies to the bottom, so basically it works fine as long as there is text both above and below the tags

                Any ideas on how to fix that?


                  it works perfectly, thank you.
                  in attachment, an image I use as icon in editor.
                  Attached Files


                    Thanks a lot for this BBCode