There’s a new plugin for wordpress 2.7 or greater.
This page is for people who cannot understand Korean. Please let me know about any mistakes in grammar or expression
Based On
- Simple Spoiler: http://waikay.net/2005/03/plugin-spoiler/
- Very simple and great wordpress plugin. Thanks waikay
Install
- Upload
aj-spoiler
folder extracted from downloaded file below(wp-aj-spoiler.zip
) towp-contnet/plugins
- Open
aj-spoiler.php
and edit options and re-upload it.(see ‘Config’ below) - Go to
Wp-Admin > Plugins
panel andActivate
Ajax-Spoiler. - That’s all.
Config
- $feed_visibility: (‘
show
‘ or ‘hide
‘) Define visibility for feed subscribers. If ‘hide’, feed subscribers must visit the page on blog to check those hidden contnets. - $use_html_tagset: (
true
orfalse
) Set this true if you want to use
tag. Default is[spoiler][/spoiler]
only - $js_library: (‘mootools’ or ‘prototype’) You cannot use both library once.
- If you already loaded ‘prototype.js’ and ‘effects.js’ with current theme or activated plugins, set this to ‘prototype’.
- In case of ‘mootools’ with Wp-Scripts, select ‘mootools’ on ‘Base’ and
Fxpack.js, Fxutils.js, Fxtransitions.js
also on wp-scripts option panel. - In case of ‘prototype’ with Wp-Scripts, select ‘prototype’ on Base and
effects.js
also on wp-scripts option panel.
- $default_effect: Select ‘default effect’ for ajax-spoiler plugin. You can use
'appear', 'blind', 'apblind', 'phase', 'slide', 'simple'
effects.
Use
- Enclose your post text, images.. or something within
[spoiler] [/spoiler]
that’s all. - You can also change ‘show text’, ‘hide text’, and ‘effect type’
[spoiler 'effect type''show text''hide text'][/spoiler]
or[spoiler 'show text''hide text'][/spoiler]
- [spoiler ‘appear”show appear example”hide this example’]
Spoiler subject changed to ‘hide this example.
Click again to hide this.
[spoiler ‘apblind”show apblind example”hide this example’]
This is how apblind effect works.[/spoiler][/spoiler]
[spoiler ‘blind”show blind example”hide this example’]
This is how blind effect works.[spoiler ‘phase”show phase example”hide this example’]
This is how phase effect works.[/spoiler][/spoiler]
[spoiler ‘slide”show slide example”hide this example’]
This is how slide effect works.[spoiler ‘simple”show simple example”hide this example’]
This is how simple effect works.[/spoiler][/spoiler]
- This code is used on expample 2nd.
[spoiler 'phase''show phase example''hide this example'] This is how phase effect works. [/spoiler] [/spoiler]
- You can define show/hide speed by append number(between 2~9) to values.
[spoiler 'blind''show this''hide this''4'][/spoiler]
‘2’ is faster than ‘9’ - When you use spoiler tag nested, be sure to close spoiler tag on correct position.
- Spoilers will be showed first and hid after window loading. If you want to hide contnet by default, append ‘_hidden’ to effet name.
[spoiler 'blind_hidden''show this''hide this'][/spoiler]
This will be useful for contents related to slow down window loading such as wmv movie tags.
Style
- Edit aj-spoiler.css in
plugins/aj-spoiler/css
folder. a.spoiler-tgl, a:hover.spoiler-tgl, a.spoiler-tgl.collapsed
is spoiler link style anddiv.spoiler-body
is content wrapper style.
Adapt Ajax-Spoiler effects
- There is serveral ways to adapt. One is use onclick=”” attribute and the other is use DOM just like v0.7(hide after window load)
- Apply onclick attribute : http://082net.com/2006/763/expand-aj-spoiler-effects-1/
Apply DOM : http://082net.com/2006/764/expand-aj-spoiler-effects-2/
Please check other informations or updates for this plugin.
You better ‘Refresh’ browser or ’empty’ browser cache after upgrade this plugin.
Current version: 0.9
59 responses to “Ajax Spoiler Plugin”
Good Korean lolol
[…] © Ajax Spoiler Plugin Yazılarınıza akordion tarzı devamı linki verebilmenizi sağlar. (daha kapsamlı) (aynıysa ne […]
I got it to download but can’t open it. Help
[…] […]
[…] 102 © Ajax Spoiler Plugin […]
[…] © Ajax Spoiler Plugin Yazılarınıza akordion tarzı devamı linki verebilmenizi sağlar. (daha kapsamlı) (aynıysa ne […]
[…] © Ajax Spoiler Plugin Yazılarınıza akordion tarzı devamı linki verebilmenizi sağlar. (daha kapsamlı) (aynıysa ne […]
[…] 102 Ajax Spoiler Plugin […]
[…] 102 Ajax Spoiler Plugin […]
[…] © Ajax Spoiler Plugin Yazılarınıza akordion tarzı devamı linki verebilmenizi sağlar. (daha kapsamlı) (aynıysa ne […]
OHH Great post!! I just add this to my bookmarks. Thank You ^_^
[…] 102 Ajax Spoiler Plugin […]
[…] 102 Ajax Spoiler Plugin […]
[…] 102 Ajax Spoiler Plugin […]
[…] Ajax-Spoiler […]
i can’t download the plugin:( please help
hi there.com plugin but :
Does anybody know if tis script is compatible with WordPress 2.5?
Thanks in advance for any help on this!
turkbaron
Hi !
I’m currently using the plugin on my blog ( running on wordpress 2.3.1 ) and it goes perfectly well !!!
Thank you very much !!!
Does this plug-in work with 2.3.1 ?
Best.
[…] 95 © Ajax Spoiler Plugin […]
Thanks..
[…] Açıklamalı 232 WordPress eklentisi (Agu. 15, 2007 !!) (WordPress plugin list),[…]
[…] 151 Ajax Spoiler Plugin […]
082net//
Thank you for your response, I’ll keep it for a futur usage.
amy//
[spoiler]
tag works on Page as well as on Post.Try ‘blind’ instead of ‘blind_hidden’ and see if it does hide the text.(maybe it doesn’t…)
I think you didn’t loaded base javascript library(prototyp.js) yet.
If your WP version is greater than 2.1, try V1.0 test version and v1.0 will automatically load prototyp.js with script-loader which is included since WP 2.1
This is exactly what I was looking for but have not been able to get it to work. Does it work on a static WP page? I am using
[spoiler 'blind_hidden''show this''hide this']...[/spoiler]
and it does hide the text that is wrapped, but nothing happens when I cick on “show this.” It does not expand as I hoped. Any suggestions? (The entire aj-spoiler folder is in the plug-in directory.)[…] 151 Ajax Spoiler Plugin […]
shawf//
It’s a nice fix
Since I added _reset() feature for ‘Permalink’ of spoiler ID, I’ll apply a little different fix to next version.
It’ll be…
[code lang=”php”]
$id = “SID”.$post->ID.”_”.$this->counts;
global $comment;
if(isset($comment->comment_ID)) {// comment list loop
$id .= “c”;
}[/code]
Thanks for your nice suggestion.
I have done a small fix. If spoiler tag is used in posts and comments, they may conflict. So i have made a fix that does not reset counter.
Just i have added if block around
#before
$this->counts = 0;
#after
if ( !isset( $this->counts ) ) {
$this->counts = 0;
}
Fred//
Soryy for my late response
You can borrow init_Spoiler function.
In case your base library is prototype,
[code lang=”javascript”]function expand_Spoilers() {
$$(‘a.spoiler-tgl’).each(function(tgl) {
var el = tgl.id.replace(‘_tgl’, ”);
el = $(el);
if(el.style.display == ‘none’) {
el.style.display = ”;
}
});
}
function print_with_spoilers() {
var expand_all = expand_Spoilers();
window.setTimeout(function(){window.print();}, 300);
}[/code]
use
print_with_spoilers()
instead ofwindow.print()
First thanks a lot for this very usefull plugin
I want to have a page with a link to get a print version of the content.
For that, we must before to call window.print() function activate a method to expand all hidden content.
Do you know a simple way to get it ?
At last, you figured it out
Great great great !
How possible I couldn’t think such a simple bug.
Thank you, saved my whole day !!!
Ahh… that’s not for your comment, but for shadow, upper your comment
BTW, I checked my plugin again and I found the problem, it was my mistake.
Open
aj-spoiler.php
and replaceto
on top of the file, or download the file again.
Sorry for my such a fool mistake and thanks for your report :-)
082//
Thank you for your answers but I know to use [spoiler] firstly and after clickable text [/spoiler].
But my problem is different, when I activate plug-in, admin panel looks like http://firat.4shared.com/ Two png file describe my problem very well. One is plug-in page, one is corruptted post page.
As you told I downloaded again. But nothing changed. I think it is a problem for 2.2.1. However I tried it with 2.1.3 it was the same. Does anyone who has this problem witth 2.2.1 ?
Thank you for your key pushes
shadow//
Sorry for my too late answer.
I think you did not use spoiler tag correctly, closing tag(
[/spoiler]
) should be after starting tag([spoiler]
)Firat//
No, it’s not about javascript trouble. Seems like your downloaded file is corrupt, try re-download the file.
Hi,
I am using 2.2.1 When I activateajax Spoiler Plug-in, at the top of the admin panel lots of characters appear. I have already post it but it seems moderator did not approve those characters.
May it be about mootools or some other pug-in that I haven’t install ?
Best regards.
In the meantime I am using WP 2.2.1
Hello,
When I activate plug-in, at the top of the control panel page below text appears.
Secondly, do I have to install ‘mootools’ or ‘prototype’ ? What are they & how could I install them ?
Thanks in advance.
nevermind my prvious post above. i figured it out, i just didn’t know i had to install wp-scripts for this plugin to work.
all is good now and thank you for sharing your work!
seems like a great plugin, but the $js_library – where do i find the options panel as seen in pictures aj-spoiler-mootools.jpg and aj-spoiler-prototype.jpg??
감사합니다~~! Thanks!This is what I’ve been looking for. I hope it works.
[…] Visit […]
Hi, I have this problem with plugin…
Warning: array_pop() [function.array-pop]: The argument should be an array in elkiwi.com/wp-content/plugins/aj-spoiler/aj-spoiler.php on line 104
I installed WP-Scripts and configured it.
Thanks.
Hey, finally i can use the plug-in.
I made a tutorial in my language of the plug-in, ok?
http://soshla.com/wp/goodies/tutoriais-wordpress/ajax-spoiler/
Thank you for making this excellent plug-in!
Yogie, tigoo// Could you tell me more about your problem?
Xi// This plugin would not work when pages are loaded with Rolling Archives.
Adding some lines to “k2/js/rollingarchives.js.php” file can fix this.
About line 142 (find /* Support for Lightbox */)
/* Support for Lightbox */
if (window.initLightbox)
initLightbox();
if (window.init_Spoiler)
init_Spoiler();
Oohhhh…
i can’t use it :(²
have a bug with k2 Rolling Archives
[…] of TVs and movies, so I figured I should probably find some spoiler tag plugin. I found one made by some Korean guy that uses Ajax. Let’s give a […]
Oohhhh…
i can’t use it
@@ron//
Last part of your comment has gone away when you submitted, I think… And I modified the line you mentioned. Was that correct
Thanks
Firstly, thanks for your efforts
Just a courtesy reminder for you, there is a typo in the last point under the section titled with ‘Use’:
“Spoilers will be showed first and be hid after window load. If you hide contnet(
Arizona// That’s good. btw, I’ve posted English docs about it
[…] 082Net Based on a previously available plugin, this update add some AJAXy goodness by giving the user multiple options for hiding and displaying the “spoiler” in a post. Examples of display options with easy to follow instructions available on the author’s site. […]
Oh I think I got it!
Thanks. But I am not sure how to put it in. What would be the entire code to insert for that to work (I use prototype).
Arizona// I’ve included ‘.Collapse’ method to apply similar skill on blog. In case of using ‘prototype’ it will be Effect.Collapse else Spoiler.Collapse with ‘mootools'(Demo : check my sidebar). I’m preparing for English doc about this(Korean doc is already available).
[…] Ajax Spoiler est utile pour les grandes et petites surprises. Un outil de pour ne pas rater ses farces! Il permet de cacher un bout de texte, qui se rèvèle au clic sur un liens définis. […]
Is there a way to implement this outside of a Post (i.e. somewhere on a wordpress page)?