Tiny Spoiler
Kleines Plugin für Inhalte die nicht sofort sichtbar sein sollen. Zum Beispiel Spoiler oder Frage-Antwort-Spielchen.
Tiny Spoiler 0.2
Contributors: Tom BraiderDonate 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
- unzip plugin directory into the
/wp-content/plugins/directory - activate the plugin through the
Pluginsmenu in WordPress - 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
Arbitrary section
Filelist
- spoiler.php
Version 0.2
new: several spoiler can have same name
Version 0.1
- first release
created by Readme Parser

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?
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.
Im Quelltext steht dann sowas wie
<a href="mailto:&#115;&#116;&#101;& ...was es den Bots sicher etwas schwerer macht. Browser zeigen aber einen normalen Link an.
[...] Tiny Spoiler : Toms Dimension [...]
[...] 文章註解器:Tiny Spoiler [...]
this plugin rocks!
[...] Tiny Spoiler [...]
[...] 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. [...]
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
simple use another name.
see the new sample on the top.
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
Klingt sinnvoll. Ich glaub ich bau sowas ein. Danke für den Tipp.
Thanks Really great!!
Das Plugin ist super und genau das, was ich gesucht habe. Zwar habe alles installiert, doch der Text wird nicht verborgen.
Was kann ich tun?
Was anderes
Haste mal ein Beispiel/Link? Standardmäßig ist der Text eigentlich weg. Also die Höhe des Bereiches ist 0:
.spoiler div { height: 0; }Hast du im CSS was geändert?
Also ich hab den Eintrag auf "private" gestellt, weil ich eben nur was testen wollte, kann ihn aber gerne mal öffnen. Es ist der erste unter http://www.kitesinsummer.com/log/
Am CSS habe ich noch gar nichts geändert. Ich habe lediglich das Plugin installiert, aktiviert und ein Testpost gemacht.
Bei dir wird weder das CSS noch das Javascript geladen. Kannst du mal in der header.php deines Theme nachsehen ob da
<?php wp_head(); ?>vor</head>drin steht? Ansonsten einfach mal eintragen. Oder mal ein anderes Theme testen.Nee, steht nicht drin. Also ich hab nur das hier gefunden:
Wo soll ich denn das
genau einfügen?Am besten direkt die Zeile über .
Wie du sehen kannst, ist der text jetzt verborgen, aber beim klicken geschieht nichts. Langsam kriege ich das Gefühl mein Theme wurde schlampig gecoded.... Was kann ich jetzt tun?
Ich hoffe ich stresse dich nicht zu sehr >_<
Nvm. Hat sich erledigt
Danke trotzdem
Naja, löschen ist keine Lösung.
Es liegt wirklich am Theme. Das JS wird nämlich in den footer eingefügt, der auch nicht da ist. Ich schreib dir gleich ne Mail. Soviel zum Stress.
[...] 找到ä個蠻好玩的WordPress外掛Tiny Spoiler [...]
[...] 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. [...]
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
Danke für den Tipp. Kommt davon, wenn man alles nur mit Firefox testet und hofft, dass wenigstens die einfachsten Sachen auch gleich aussehen.
Ich habs mal geändert. Zeile 19 um den Backgound erweitert. Sieht besser aus.
.spoiler legend { padding-right: 5px; background: white; }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
http://0p0media.com/media/discografia/lucifer/
where is the spoiler?
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. =)
Hello Nod,
thanks for your korean support.
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?
[...] Tiny Spoiler-shows/hides this [...]
Hallo,
kann man den Spoiler auch per Php ins Template einbauen?
Hallo Elena,
müsste mit
echo replace_spoiler_tag( inhalt, name );gehen, habs allerdings nicht getestet.
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
a little shove
strange, when I put in style.css not worked, I had to edit the spoiler.php to work, thx!
It work at the end of style.css for me. Perhaps other stylesheets overwrite it?
I have to align the content of the spoiler in the center?
No you havn't but you can.
[...] + 버튼으로 숨겨주고 보여주는 기능을 하는 플러그인 제작자 홈페이지: http://www.tomsdimension.de/wp-plugins/tiny-spoiler 경로: wordpresswp-contentplugins 에 추가 다운로드 링크: Tiny-Spoiler 0.2 [...]
[...] Eklenti Ana SayfasÄ [...]
[spoiler]just testing spoiler tags in comment[/spoiler]
Not working because only the content will be scanned per shortcode. Do you need spoilers in comments?
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 (
&minusor&#x2212) or just from your keybord as other Unicode symbols (depends on your operating system).Thanks for your Tiny Spoiler plugin.
Sorry, i can't change the code to
&minus. Then the button shows&minusinstead of-. Javascript issue?But i set the size of the button per CSS. See the sample. So it looks nice.
Loving this plugin, thanks a bunch!
Hallo, wie ist die Anzeige im Feed? Ist dort dann einfach der Shortcode zu sehen?
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.
Can't works on my blog..
more? infos?
Why this plugins doesn't work in my blog?
I can't click the spoiler button. :(
Do you have a sample on you site?
It's just a bit Javascript.
Not workink on 3.0 ver
Wordpress 3? Works, see above!