Tiny Spoiler

Kleines Plugin für Inhalte die nicht sofort sichtbar sein sollen. Zum Beispiel Spoiler oder Frage-Antwort-Spielchen.

top secret
shows/hides this text


spoiler 2
shows/hides another text


Download bei WordPress

Tiny Spoiler 0.2

Contributors: Tom Braider
Donate link: www.unicef.org
Tags: spoiler, secret, post
Requires at least: 2.5
Tested up to: 2.7
Stable tag: 0.2

[spoiler name="top secret"]shows/hides this text[/spoiler]

Description

  • shows/hides text in spoiler shortcode
  • name of spoiler area can be given
  • only one little button [+] or [-]

Installation

  1. unzip plugin directory into the /wp-content/plugins/ directory
  2. activate the plugin through the Plugins menu in WordPress
  3. insert [spoiler name="top secret"]...[/spoiler] in your post or page

Frequently Asked Questions


Need Help? Find Bug?


read and write comments on plugin page

Who can i change the style?


You can change the Stylesheet in you own theme style.css.
.spoiler is the outer border/area.
.spoiler legend is the title.
.spoiler legend input is the button.
.spoiler div is the content area.

Screenshots


  1. 1. closed and open spoiler

Arbitrary section


Filelist
  • spoiler.php
Changelog
Version 0.2
new: several spoiler can have same name
Version 0.1
  • first release
created by Readme Parser

RSS-Feed 53 Kommentare

alle Kommentare anzeigen / show all comments
  1. Bassoprofondo Bassoprofondo sagt:

    Hm, das Plug schaut ja "ganz nett" aus. Frage: Ist es eventuell dazu geeignet, um im Impressum einer Webseite, also dort, wo man üblicherweise die eigene eMail angibt, diese Adresse vor Spam-Robotern zu verbergen (auch vor Googel etc.), so dass man vor so einem Kram verschont bleibt?

    • Tom Tom sagt:

      Nein, als Spam-Schutz ist es nicht geeignet, da der Inhalt des Spoilers ja im Quelltext der Webseite vorhanden und nur per Stylesheet im Browser ausgeblendet wird. Bots werden ihn also finden.
      Ich benutze für Emailadressen eine kleine Funktion.

      function antispamMail( $email ) 
      {
        $mail = preg_replace( "/(.)/se", " '&#' . ord( '\\1' ) . ';' ", $email );
        echo '<a href="mailto:'.$mail.'" >'.$mail.'</a>';
      }

      Im Quelltext steht dann sowas wie
      <a href="mailto:&amp;#115;&amp;#116;&amp;#101;&amp; ...
      was es den Bots sicher etwas schwerer macht. Browser zeigen aber einen normalen Link an.

  2. [...] Tiny Spoiler - This plugin allows you to add spoilers to your content and then show or hide it with a plus or minus sign. I don’t have a use for this right now but this would be ideal for a gaming site that includes hints and walkthrough information. [...]

  3. egi egi sagt:

    something wrong if we got 2 or more spoiler in one post...
    when we click the bottom spoiler it's always show the first spoiler...
    d you know how to fix this up?
    btw thanks!! for the great plugin

    • Tom Tom sagt:

      simple use another name. :wink: see the new sample on the top.

      • Andre Andre sagt:

        Um ohne den Namen zu ändern mehrere Spoiler auf einer Seite haben zu können, solltest du in einer neuen Version den Quelltext wie folgt oder ähnlich ändern:

        function replace_spoiler_tag( $content, $name )
        {
        $caracteres = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
        $addition = "";
        for ($i = 0; $i < 10; $i++) {
        $addition .= $caracteres[rand(0,25)];
        }
        $id = str_replace(' ', '', $name).$addition;
        $s='

        '.$name.'

        '
        .$content.'

        ';
        return $s;
        }

        mfg, warez16

  4. egi egi sagt:

    Thanks Really great!!

  5. Kate Kate sagt:

    Das Plugin ist super und genau das, was ich gesucht habe. Zwar habe alles installiert, doch der Text wird nicht verborgen. :sad:

    Was kann ich tun?

  6. [...] 找到ä個蠻好玩的WordPress外掛Tiny Spoiler [...]

  7. [...] Tiny Spoiler - Tiny Spoiler is used to show and hide pieces of text. I discussed this plugin in an earlier article and thought it could be used for spoilers when people are stuck in a game. [...]

  8. CineKie CineKie sagt:

    Hallo Tom,

    erstmal vielen Dank für das Plugin - sehr schön und genau das, was ich gesucht habe!

    Ist dir auch schon aufgefallen, dass die Anzeige beim Internet Explorer fehlerhaft ist? In allen Versionen zieht sich die Linie des Randes mitten durch den Spoiler-Titel, im 8er ist die Titel-Schrift zusätzlich blau. Alle anderen Browser zeigen die Spoiler korrekt an.

    Kann man da was gegen machen?

    Gruß
    Sven

    • Tom Tom sagt:

      Danke für den Tipp. Kommt davon, wenn man alles nur mit Firefox testet und hofft, dass wenigstens die einfachsten Sachen auch gleich aussehen. :uebel: Ich habs mal geändert. Zeile 19 um den Backgound erweitert. Sieht besser aus.
      .spoiler legend { padding-right: 5px; background: white; }

  9. 0p0 0p0 sagt:

    Tiny spoiler failed again in my site...
    the spoiler does not un fold when the button is clicked, I have no styles in my stylesheet that may affect the rendering you can check anyway like the las time to see if there's anything wrong with my styles :P

    http://0p0media.com/media/discografia/lucifer/

  10. Nod Nod sagt:

    Hi Tom, I'm trying to remove inline scripts to improve loading speed. So I'd love to know how to combine the inline scripts in spoiler.php with other js file.

    http://fantasyamplifier.com/bookreview-psychological-strategies-and-tactics/

    I have a quick review post about your plugin. It is written in Korean though. I love your plugin!

    http://fantasyamplifier.com/wp-plugin-tiny-spoiler/

    Have a good day. =)

    • Tom Tom sagt:

      Hello Nod,
      thanks for your korean support. :-D
      I have an idea to "write" the custom styles and scripts to a resource file but don't testet anything. Combination of all js / css files would be great. But how? :gruebel:

  11. Elena Elena sagt:

    Hallo,

    kann man den Spoiler auch per Php ins Template einbauen?

  12. r4ibOm r4ibOm sagt:

    this plugin is great, but I am weak in the css, as you would have me is the css for this model is equal to your site? thx :-P

    • Tom Tom sagt:

      a little shove :)

      /* tiny spoiler */
      .spoiler {
          border: 1px #999 dashed;
          background: #fff;
      }
      
      .spoiler legend {
          margin-left: 10px;
      }
      
      .spoiler legend input {
          width: 20px;
          border: 0;
          background: #1A4E88;
          color: #fff;
          font-weight: bold;
          -moz-border-radius: 6px;
          -khtml-border-radius: 6px;
          -webkit-border-radius: 6px;
          border-radius: 6px;
      }
      

  13. r4ibOm r4ibOm sagt:

    strange, when I put in style.css not worked, I had to edit the spoiler.php to work, thx!

  14. r4ibOm r4ibOm sagt:

    I have to align the content of the spoiler in the center?

  15. [...] + 버튼으로 숨겨주고 보여주는 기능을 하는 플러그인 제작자 홈페이지: http://www.tomsdimension.de/wp-plugins/tiny-spoiler 경로: wordpresswp-contentplugins 에 추가 다운로드 링크: Tiny-Spoiler 0.2 [...]

  16. sherly sherly sagt:

    [spoiler]just testing spoiler tags in comment[/spoiler]

  17. Tathagata Tathagata sagt:

    Your spoiler uses a plus and a hyphen-minus signs for the hide/show button. But the hyphen-minus has different level and narrower than the horizontal bar of the plus in many typefaces (e.g. Arial). That make it looks kind of awkward while triggering that button.

    It would be very nice if you fix that by using a minus sign instead of a hyphen-minus in your spoiler plugin (spoiler.php). You can put this symbol (a minus sign) using HTML mnemonics (&amp;minus or &amp;#x2212) or just from your keybord as other Unicode symbols (depends on your operating system).

    Thanks for your Tiny Spoiler plugin.

    • Tom Tom sagt:

      Sorry, i can't change the code to &amp;minus. Then the button shows &amp;minus instead of -. Javascript issue?
      But i set the size of the button per CSS. See the sample. So it looks nice.

  18. StillRooney StillRooney sagt:

    Loving this plugin, thanks a bunch! :)

  19. René René sagt:

    Hallo, wie ist die Anzeige im Feed? Ist dort dann einfach der Shortcode zu sehen?

    • Tom Tom sagt:

      Ehrlich gesagt keine Ahnung. Aber ich denke, dass die Filter auch dort über den Content laufen. Die eigentlich Frage ist ob dort das Javascript funktioniert. Das glaube ich eher nicht. Probiers mal aus. ;)

  20. Andy Andy sagt:

    Can't works on my blog.. :sad:

  21. Zippy Zippy sagt:

    Why this plugins doesn't work in my blog?
    I can't click the spoiler button. :(

alle Kommentare anzeigen / show all comments

Kommentar schreiben




Tiny Corner