[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/] texto aquí [/spoiler] 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

Publicado por

Abraham

Autor de Liberitas. Desde el 2004 escribiendo desvaríos

156 comentarios sobre “[Mi plugin] Enhanced Simple Spoiler”

  1. Pingback: BlogR :::
  2. Pingback: Planeta WordPress
  3. Pingback: VERONA BLOG
  4. Pingback: mTm
  5. Pingback: mahmutabi
  6. Pingback: world of mig
  7. Pingback: NOPLAN
  8. Pingback: Download Things
  9. Pingback: Casal 10
  10. 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?

  11. 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)

  12. I think that challenge is too high for me 😆 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.

  13. Pingback: todoRSS » CMS
  14. Hi, I checked your plugin with W3C Xhtml validator and it seems that some are missing, leading to a non validation ?? Any idea ?

  15. 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 !

  16. 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?

  17. 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

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

  19. 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?

  20. 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.

  21. 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?

  22. Pingback: Plugins :: cimddwc
  23. Pingback: &&// L.I.G.H.T.
  24. 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!!!

  25. Pingback: Cbox
  26. Pingback: Pownce Mobile
  27. Pingback: Backlink Checker
  28. 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 =)

  29. Pingback: Kimiko. <3
  30. This plugin doesn’t work with WP 2.9 anymore. Each spoiler is interpreted as a link by WP 2.9, which means that if you put on moderation all comments with a link or more, your regular visitors comments are hold for moderation as well!

    Is there a way to fix this major ISSUE?

    Thanks

  31. Thanks! This is the only plugin that works the way I want it to.. cannot use the wysiwyg editor though .. the [ … ] dont register, however the do, and they do perfectly!! You, my friend, are a king!

  32. Hi Abraham,
    thanks for this plugin, it works perfectly on my site (running with WP 3.0.4)!

    Your code even hides a rather long font list (150 lines) that is embedded in a 2-column table. If you would like to see it, you can find it in my post about how to remove Windows 7 non-latin fonts.

    I gave some credit and added a link to your plugin in my post.

  33. Se te agradece la iniciativa del plugin y la oferta desinteresada. Lo voy a probar en varios sitios.

    PD: También me ha encantado los tips que le has puesto al sitio.

  34. All of a sudden, this plugin just stopped working for me. I haven’t changed ANYTHING, and I just downloaded & reuploaded it, and still nothing.

  35. Pingback: orlando taxi
  36. Pingback: Luxury Rentals

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos necesarios están marcados *