[Mi plugin] Enhanced Simple Spoiler

He actualizado el genial plugin Simple Spoiler para hacerlo compatible con el uso del WYSIWYG de WordPress. He añadido la opción de encapsular el código dentro de [ ] en lugar de usar < >. Ahora se pueden usar los dos métodos, sin necesidad de modificar los posts antiguos.

Instalación

Simplemente coloca el archivo enhanced-ss.php en el directorio de plugins de tu instalación de WordPress [normalmente wp-content/plugins/]. ¡Actívalo y comienza a usarlo!

Modo de uso

Si usas el editor visual enriquecido de WordPress [TinyMCE], simplemente tienes que colocar el texto que quieras ocultar entre las etiquetas [spoiler] texto aquí [/spoiler].

Si no usas el editor visual sólo tienes que colocar el texto que quieras ocultar entre las etiquetas [spoiler] texto aquí [/spoiler] o bien <spoiler> texto aquí </spoiler>.

Formato

Puedes usar dos palabras o frases que quieras como texto para mostrar u ocultar el contenido. Por ejemplo:

En el editor visual [spoiler /dame la verdad/ /no me la enseñes/] dará como resultado algo así

dame la verdad ▼

Por otra parte, en el editor simple <spoiler 'dame la verdad' 'no me la enseñes'> texto aquí </spoiler> dará el mismo resultado. Date cuenta que las comillas ‘ ‘ no son compatibles con el editor visual, por lo que la sintaxis es distinta de uno a otro.

Lista de cambios

1.6.2 - Añadido “php” al comienzo del archivo. No sé por qué razón no estaba presente. Gracias Amanda

1.6.1 - Modificada la función yk_callback para hacerla compatible con XHTML 1.0 [espero]. Gracias Marcus

1.6 - Versión inicial, para continuar la numeración de Simple Spoiler.

Nota:

No sé ni PHP ni Javascript ni nada de nada, simplemente he añadido un par de líneas y he cambiado otras simplemente observando y luego usando el método de ensayo-error. No pidas más características para añadir al plugin, se llama Simple por algo ;)

Descárgalo aquí

English

I have updated the beautiful Simple Spoiler plugin to make it compatible with WYSIWYG editor embedded in WordPress. I have added the option to use [ ] instead of < >. Now you can use both methods whithout digging into your older posts to modify the code.

Installation

Put enhanced-ss.php file inside plugins directory of your WordPress installation [usually wp-content/plugins/]. Activate it and start using it!

How to use

If you write with the WordPress visual rich editor [TinyMCE], simply put the text you want to hide between [spoiler] text here [/spoiler] tags.

If you don’t use the visual editor you only have to put the text between [spoiler] text here [/spoiler] or <spoiler> text here </spoiler> tags.

Formatting

You can use two words or phrases as text link to show or hide the content. For example:

In visual editor [spoiler /give me the truth/ /hide it from me/] will result as something like this

give me the truth ▼

By the other hand, in simple editor <spoiler 'give me the truth' 'hide it from me'> text here </spoiler> will produce the same output. Take in mind that ‘ ‘ are not compatible with visual editor, that’s why the syntax is not the same in both examples.

Changelog

1.6.2 - Added “php” to the beggining of the file. I don’t know why it wasn’t present. Thanks Amanda

1.6.1 - Modified yk_callback function to make it XHTML 1.0 compatible [I hope]. Thanks Marcus

1.6 - Initial release, to continue Simple Spoiler version number.

PS:

I don’t know PHP nor Javascript, I have simply added a pair of lines of code and chaged others by observation and later testing for errors. Please don’t request more features for this plugin, its name is Simple for some reason ;)

Download here

38 Respuestas a “[Mi plugin] Enhanced Simple Spoiler”


  1. 1 aretziel Identicon Icon aretziel

    ahh, stupid me! thanks!!!

    I totaly missed that spoiler /text /text variable =)

    thanks alot *feels stupid* :)

  2. 2 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    Read again the post, please. You can put whatever you want or leave it by default.

  3. 3 aretziel Identicon Icon aretziel

    hi.

    I wonder if there are any way to be able to get your own text instead of ‘give me the truth’.
    Not by editing the .php file but each time you do the [spolier] you may do something like [spoiler:titel] where title is the text that will be the link to show the hidden content.

    I use this not only for spoilers when writing about movies but to put content on my blog that is optional to view =)

  4. 4 Marcelo Identicon Icon Marcelo

    EXCELENTE. Muchisimas, muchisimas gracias, lo venia buscando hace tiempo. Muchas gracias.

  5. 5 forex Identicon Icon forex

    thanks

  6. 6 Kadir GÜNAY Identicon Icon Kadir GÜNAY

    thank you my friend this plugin is so nice and usefull.

  7. 7 oyun hileleri Identicon Icon oyun hileleri

    thanks alot…

  8. 8 diziizle Identicon Icon diziizle

    thanks..

  9. 9 dizi izle Identicon Icon dizi izle

    thanks

  10. 10 dizi izle Identicon Icon dizi izle

    thanks a lot…

  11. 11 Loli Identicon Icon Loli

    Mira esta pagina como exemplo: http://ecolala.awardspace.com/blog/?page_id=6
    gracias pela attencion ^^

  12. 12 Loli Identicon Icon Loli

    Hola! jejejejeje
    sooo, i can’t use ur plugin :( why i dunno, i want use it so much, its will be easy my pages!!!
    whould u can help me?

    Ann, when i CLICK on the plugin, no ocorre nada!!! PorQUe!!!
    preciso de la ayuda tuya!!!

  13. 13 Jeff Identicon Icon Jeff

    I’m also having trouble getting it to work. The spoiler text goes away and in it’s place it says “Show”, but when I click it nothing happens. The sample on your page works, so I have a feeling it’s related to my theme somehow. When I look at the page source after adding spoiler text, here’s what I see:

    Show ▼

    [The spoiler text]

    I do use apostrophe’s within the spoiler text itself, as I use contractions. Are these incompatible with the spoiler tag?

  14. 14 Wai Kay Identicon Icon Wai Kay

    Hi guys. Nice to see that someone has enhanced my plugin when I was busy in the past years. To answer some of your questions, the original intention of my plugin is to have a simple spoiler. There are some other spoilers in the past but they are all very complicated.

    If you want a button instead of a text link to the spoiler, simple modify the $spoiler_show_text and $spoiler_hide_text and the yk_callback function to return an rather than a <a> link.

    On spoilers in feeds, that is simply a limitation on the feed reader which we can do nothing about.

  15. 15 dusakabin Identicon Icon dusakabin

    thank you for your work, all works deserves a thank you

  16. 16 canarkadaş Identicon Icon canarkadaş
  17. 17 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    Isn’t added yet? :whist:

  18. 18 Aypeus Identicon Icon Aypeus

    Would be nice if this could be added to Wp-Plugins-Db.org :)

  19. 19 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    The “Spoiler button” doesn’t work or are the [ ] tags?

  20. 20 Peter Identicon Icon Peter

    Hi, the plugin works fine with my wordpress 2.1.3. But one things does not work: i build a “spoiler”-button in my admin panel, which adds the spoiler-tags. For me as an admin, this works fine. But my co-author can´t use it with his restricted rights as an “author”. The spoiler-tags do not work for him. When i set his rights to “publisher”, the spoiler-tags work for him, but i don´t want him to be a publisher…so what can i do?

  21. 21 Rob Identicon Icon Rob

    this is a test

  22. 22 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    Hi, I don’t have enough knowledge to do what you are requesting. I’m sorry about that.

  23. 23 sguzelcik Identicon Icon sguzelcik

    Hi
    Thanks for that plugin. I want a button to expand all links in page. Is it possible?

  24. 24 eXPeri3nc3 Identicon Icon eXPeri3nc3

    Hi there, is it possible to input pictures instead of the text?

    As in buttons or whatsoever, and change the alignment?

    Thanks.

  25. 25 issen1 Identicon Icon issen1

    Well i think i did something wrong or something
    i asked if something like this would be possible:
    [spoiler*][spoiler*]text[/spoiler*][/spoiler*]

  26. 26 issen1 Identicon Icon issen1

    Hey, I like your Plugin, it ruleeez ;)
    But, i want to make something like a double spoiler , something like this:
    text

    Is that possible?
    or could you add such a function?

    thx issen1

  27. 27 Emiliano Identicon Icon Emiliano

    Buenismo !!! La modificación resulta muy buena, te felicito !

  28. 28 Javier E Identicon Icon Javier E

    Gran plugin, uno de los mejores que he visto

  29. 29 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    It should work from WP 1.5 to 2.1-alpha. The only possible reason for your problem is that your browser has disabled javascript or something like this. Check it out.

  30. 30 Shelly Identicon Icon Shelly

    Hi, I downloaded your plugin but it doesn’t seem to work for me. Does it work with Wordpress version 2.0.1? It hides the part of the post I want but it doesn’t show it when I click on the link to “show”. Is it because it’s not compatible with Wordpress 2.0.1 or is it something that I’m doing wrong?

  31. 31 Eric Identicon Icon Eric

    Ok. The plugin is just working fine ! I have some issues with my theme, and I guess I’m gonna use a new one !

    Thanks !

  32. 32 Eric Identicon Icon Eric

    Hi, I checked your plugin with W3C Xhtml validator and it seems that some are missing, leading to a non validation ?? Any idea ?

  33. 33 Marcus Identicon Icon Marcus

    Thats ok, the plugin is cool ;)

  34. 34 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    I think that challenge is too high for me :lol: That problem comes with the original plugin itself, and I don’t know how to avoid it in feeds. Problem is that plugin’s javascript code doesn’t run on Bloglines because it is embeded into your blog’s header. In feeds there is no way to add it, or I don’t know how to do it, sorry.

  35. 35 Marcus Identicon Icon Marcus

    So it works on comments :p

    BTW, if you want another challenge, here it is: When i looked at the post feed on Bloglines, it wasnt covered like in the site, but i could look at the hidden stuff. So if you know how to fix it, i suppose the plugin will be flawless (at least at what i can see, i dont know php either)

  36. 36 Marcus Identicon Icon Marcus

    It works! \o/

    Now the Xhtml freaks can sleep ;)
    Thanks for super-fast reply :D

  37. 37 ]V[orlock Zernebock Identicon Icon ]V[orlock Zernebock

    I have modified yk_callback function to make it XHTML 1.0 compatible [I hope]. Please tell me if it works or not.

    PS. Remember I don’t know PHP nor Javascript at all! ;)

  38. 38 Marcus Identicon Icon Marcus

    Hello, can you help out with one thing? I posted something and it “broke” the Xhtml validation. It is on this line:

    Error Line 186, column 56: an attribute specification must start with a name or name token .

    …u testar este negócio aqui <a ‘javascript:void(null);’ onclick=”s_togg

    An attribute name (and some attribute values) must start with one of a restricted set of characters. This error usually indicates that you have failed to add a closing quotation mark on a previous attribute value (so the attribute value looks like the start of a new attribute) or have used an attribute that is not defined (usually a typo in a common attribute name).

    What should i do to fix it?

  1. 1 mTm
    Dirección Pingback a 30 Nov. 1999 @ 0:00
  2. 2   WordPress Plugin: Simple Spoiler Updated by Blogging Pro
    Dirección Pingback a 19 Abr. 2006 @ 22:35
  3. 3 Estranhos vendedores de farol at Marcus Oliveira
    Dirección Pingback a 20 Abr. 2006 @ 20:51
  4. 4 Planeta WordPress
    Dirección Pingback a 21 Abr. 2006 @ 11:20
  5. 5 Vidablog » Themes y plugins para WordPress
    Dirección Pingback a 21 Abr. 2006 @ 16:40
  6. 6 BlogR :::
    Dirección Pingback a 24 Abr. 2006 @ 19:33
  7. 7 Raul Vera (azul) » Blog Archive » Nuevos ‘themes’ y ‘plugins’ para WordPress
    Dirección Pingback a 26 Abr. 2006 @ 4:55
  8. 8 Spoiler plugin at Lost Blog
    Dirección Pingback a 26 Abr. 2006 @ 23:00
  9. 9 todoRSS » CMS
    Dirección Pingback a 2 May. 2006 @ 10:29
  10. 10 Simple Spoiler Enhanced « WordPress Support
    Dirección Pingback a 4 May. 2006 @ 18:22
  11. 11 Plugin-FAQ at Uli’s Blog
    Dirección Pingback a 21 May. 2006 @ 11:57
  12. 12 Klapptext in Wordpress möglich? - WordPress Deutschland Forum
    Dirección Pingback a 15 Jun. 2006 @ 12:08
  13. 13 VERONA BLOG
    Dirección Pingback a 5 Jul. 2006 @ 18:32
  14. 14 TwoViews: The Third Design at TwoViews
    Dirección Pingback a 3 Sep. 2006 @ 17:00
  15. 15 Quotes/meh at Duke Nukem’s Revenge
    Dirección Pingback a 11 Sep. 2006 @ 22:21
  16. 16 Die besten Wordpress Plugins at Gequirlte Scheisse
    Dirección Pingback a 13 Oct. 2006 @ 20:50
  17. 17 My First Post » Anak Melayu BOLEH blog! Mana gadis manis melayu aku?
    Dirección Pingback a 28 Nov. 2006 @ 19:23
  18. 18 Let’s ちゅちゅ
    Dirección Pingback a 26 Dic. 2006 @ 12:31
  19. 19 Wordpress добавки I « Steve’s blog
    Dirección Pingback a 24 Ene. 2007 @ 7:01
  20. 20 Plugins/Plugin Compatibility/2.1 « WordPress Codex
    Dirección Pingback a 27 Ene. 2007 @ 20:15
  21. 21 Klapptext in Wordpress möglich? - WordPress Deutschland Forum
    Dirección Pingback a 27 Ene. 2007 @ 20:43
  22. 22 Games - About - FreeGamesNews
    Dirección Pingback a 7 Feb. 2007 @ 2:46
  23. 23 Ajax で記事を折り畳んでくれるプラグイン » [WordPress] Tips Community
    Dirección Pingback a 8 Feb. 2007 @ 7:01
  24. 24 Gedankenschrei Blog » Die besten Wordpress Plugins
    Dirección Pingback a 17 Feb. 2007 @ 19:19
  25. 25 blog.teranetworks.de ~ geeks? » My del.icio.us bookmarks for March 5th
    Dirección Pingback a 6 Mar. 2007 @ 0:02
  26. 26 Text ein- und ausblenden (Java Script) | funkygog Blog
    Dirección Pingback a 10 Mar. 2007 @ 22:02
  27. 27 Text ein- und ausblenden (WP-Plug-In Spoiler) | funkygog Blog
    Dirección Pingback a 10 Mar. 2007 @ 23:09
  28. 28 Rain Harbour Blog » Imprint
    Dirección Pingback a 11 Mar. 2007 @ 3:28
  29. 29 Eure Meinung zu DVDfacts.info - Seite 2 - dvdb.de-Community
    Dirección Pingback a 19 Mar. 2007 @ 21:44
  30. 30 Install mod for the wysiwyg editor - CutePHP Forums
    Dirección Pingback a 21 Mar. 2007 @ 8:55
  31. 31 pascal-berkhahn.de » Meine benutzten Plugins
    Dirección Pingback a 25 Mar. 2007 @ 14:00
  32. 32 El Blog de René » Blog Archive » Mis plugins de Wordpress
    Dirección Pingback a 1 Abr. 2007 @ 18:40
  33. 33 Spoiler plugin? « bbPress support forums
    Dirección Pingback a 4 Abr. 2007 @ 3:18
  34. 34 Omlity » Blog Archive » Themes - Plugins, WordPress
    Dirección Pingback a 25 Abr. 2007 @ 18:34
  35. 35 t-infection.com | tasarım oyuncakları, web teknolojileri » Wordpress için Simple Spoiler Eklentisi
    Dirección Pingback a 15 May. 2007 @ 3:19
  36. 36 Wordpress için Simple Spoiler Eklentisi : İnternet ve Yaşam
    Dirección Pingback a 17 May. 2007 @ 11:14
  37. 37 MrValdez » PinoyForum.net Journals Beta - Report 4: Default Plugins
    Dirección Pingback a 7 Jun. 2007 @ 5:15
  38. 38 Mis plugins de Wordpress | bocabit.com
    Dirección Pingback a 22 Jun. 2007 @ 14:43
  39. 39 WP Plugins DB » Plugin Details » Enhanced Simple Spoiler
    Dirección Pingback a 18 Jul. 2007 @ 11:29
  40. 40 B A C K - TO - B A C K
    Dirección Pingback a 22 Ago. 2007 @ 21:12
  41. 41 Sayfamıza HoşGeLdiniz (Güvenlik, Programlar, internet, Donanim)
    Dirección Pingback a 31 Ago. 2007 @ 12:20
  42. 42 mahmutabi
    Dirección Pingback a 4 Sep. 2007 @ 15:20
  43. 43 bilgiservisim » En iyi 100 wordpress eklentisi
    Dirección Pingback a 4 Sep. 2007 @ 19:31
  44. 44 WordPress Plugins Database » Plugin Details » Simple Spoiler Enhanced
    Dirección Pingback a 8 Sep. 2007 @ 11:50
  45. 45 CANARKADAŞ » 232 Wordpress eklentisi (Açıklamalı) (Wordpress plugin list)
    Dirección Pingback a 23 Sep. 2007 @ 16:24
  46. 46 waikay.net » Plugin: Spoiler
    Dirección Pingback a 28 Sep. 2007 @ 10:18
  47. 47 My favorite WordPress Resources | sebthom.de
    Dirección Pingback a 30 Sep. 2007 @ 10:11
  48. 48 Kapasite » Site arşivi » more
    Dirección Pingback a 23 Oct. 2007 @ 7:46
  49. 49 Plugins :: cimddwc
    Dirección Pingback a 28 Oct. 2007 @ 16:13
  50. 50 WordPress 2.3 compatiblity Plugins | Dreamer's Blog
    Dirección Pingback a 6 Dic. 2007 @ 17:17
  51. 51 230 Wordpress eklentisi — Wordpress Türkiye
    Dirección Pingback a 8 Dic. 2007 @ 20:47
  52. 52 &&// L.I.G.H.T.
    Dirección Pingback a 13 Dic. 2007 @ 16:11
  53. 53 P I N K B L I S S.org vr. 13
    Dirección Pingback a 31 Dic. 2007 @ 20:31
  54. 54 Cbox
    Dirección Pingback a 11 Ene. 2008 @ 18:31
  55. 55 Giavasan » Cursor*10
    Dirección Pingback a 16 Ene. 2008 @ 13:16
  56. 56 Plugins - Bull3t's Blog
    Dirección Pingback a 17 Ene. 2008 @ 8:10
  57. 57 230 Wordpress eklentisi | Aktifindir
    Dirección Pingback a 20 Ene. 2008 @ 12:45
  58. 58 300 Adet Wordpress Eklentisi : Yılmaz Eres
    Dirección Pingback a 26 Ene. 2008 @ 15:44
  59. 59 Pownce Mobile
    Dirección Pingback a 2 Feb. 2008 @ 22:33
  60. 60 Backlink Checker
    Dirección Pingback a 10 Feb. 2008 @ 17:58
  61. 61 wordpress indir wordpress tema wordpress theme » Blog Arşivi » Kategorilere ayrılmış yüzlerce wordpress eklentileri eklenti indir wordpress eklentisi hemen ücretsiz yükle bedava
    Dirección Pingback a 20 Feb. 2008 @ 5:55
  62. 62 world of mig
    Dirección Pingback a 4 Mar. 2008 @ 17:12
  63. 63 NOPLAN
    Dirección Pingback a 8 Mar. 2008 @ 11:04
  64. 64 ::~ Sugar-Princess ~::
    Dirección Pingback a 11 Mar. 2008 @ 14:18
  65. 65 YIN-YIN LE ZINZIN | Harder, Better, Faster, Stronger
    Dirección Pingback a