• Welcome to Simple Machines Community Forum. Please login or sign up.
January 17, 2022, 09:59:27 PM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


Spoiler BBCODE v1.1.1

Started by William L, January 10, 2010, 12:33:37 PM

Previous topic - Next topic

William L

January 10, 2010, 12:33:37 PM Last Edit: January 16, 2010, 09:41:55 PM by William L
Link to Mod


Spoiler BBCODE v1.1.1

Demo

Compatibility
For SMF 1.1.x
For SMF 2.0 RC2

Description
This mod adds a new bbcode tag that'll hide what you wrap with it. It works with text and images. Clicking on the spoiler link, reveals the block. You can optionally add a text to the link too, ie: [spoiler=My Title]Spoiler goes here[/spoiler].

Translation
Quote from: Bugo on January 15, 2010, 06:34:21 AM
Russian translation:

// Spoiler
$txt['spoiler'] = 'Спойлер';
$txt['spoiler_default_for'] = 'Заголовок';
$txt['spoiler_for'] = '';
$txt['spoiler_hide_button'] = 'Скрыть';
$txt['spoiler_show_button'] = 'Показать';


Screnshot
SMF : 1.1.11


SMF : 2.0 RC2


Donation




If you like my modification packages, please donate to support their continued development.
Any amount will be greatly appreciated. Thank you!
Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

JBlaze

Congrats on your approved mod!
Jason Clemons
Former Team Member 2009 - 2012

William L

Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

Bugo

Russian translation:

// Spoiler
$txt['spoiler'] = 'Спойлер';
$txt['spoiler_default_for'] = 'Заголовок';
$txt['spoiler_for'] = '';
$txt['spoiler_hide_button'] = 'Скрыть';
$txt['spoiler_show_button'] = 'Показать';

Lia Sophie

Thanks a lot for this mod, I just installes it on my german forum (1.1.11) and it works fine.
The only thing is, that I don't know what german word I have to put in here ---->
$txt['spoiler'] = 'Spoiler';
$txt['spoiler_default_for'] = 'Hiden';
$txt['spoiler_for'] = 'for';
$txt['spoiler_hide_button'] = 'Hide';
$txt['spoiler_show_button'] = 'Show';

for the english one.

William L

Quote from: Lia Sophie on January 15, 2010, 05:20:30 PM
Thanks a lot for this mod, I just installes it on my german forum (1.1.11) and it works fine.
The only thing is, that I don't know what german word I have to put in here ---->
$txt['spoiler'] = 'Spoiler';
$txt['spoiler_default_for'] = 'Hiden';
$txt['spoiler_for'] = 'for';
$txt['spoiler_hide_button'] = 'Hide';
$txt['spoiler_show_button'] = 'Show';

for the english one.

Heheheh... sorry, my english not good....
Hidden = verborgen

;D
Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

Bugo

Quote from: Lia Sophie on January 15, 2010, 05:20:30 PM
Thanks a lot for this mod, I just installes it on my german forum (1.1.11) and it works fine.
The only thing is, that I don't know what german word I have to put in here ---->
$txt['spoiler'] = 'Spoiler';
$txt['spoiler_default_for'] = 'Hiden';
$txt['spoiler_for'] = 'for';
$txt['spoiler_hide_button'] = 'Hide';
$txt['spoiler_show_button'] = 'Show';

for the english one.

$txt['spoiler_default_for'] = 'Verdeckt';
Although this word can not even translate :) ($txt['spoiler_default_for'] = '')

Darthx

sorry to ask, but why didn't you tried to contribute and improve this project, since its very similar. You could try to contact the author and join forces together.

just wondering  ::)

William L

Quote from: Darthx on January 17, 2010, 09:41:55 PM
sorry to ask, but why didn't you tried to contribute and improve this project, since its very similar. You could try to contact the author and join forces together.

just wondering  ::)
Because I just wanted to make something different for the SMF, and anyway I do not speak English very well, I was just using google tranlator to communicate with you ;D
Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

Darthx

Quote from: William L on January 18, 2010, 07:11:30 AM
Because I just wanted to make something different for the SMF, and anyway I do not speak English very well, I was just using google tranlator to communicate with you ;D
)
Seems similar to me...
and about your English, that's not an excuse. ;)

Portuguese (European and Brazilian) translation:

Quote
$txt['spoiler'] = 'Spoiler';
$txt['spoiler_default_for'] = 'Escondido';
$txt['spoiler_for'] = '-';
$txt['spoiler_hide_button'] = 'Esconder';
$txt['spoiler_show_button'] = 'Mostrar';

Btw, "Spoil for [title] hidden" doesn't sound well, at least for me. Try change it for a dash (-) like i did in the translation.
(I know that you mean something like "spoil for [movie/game/story]" but there are more subjects and uses for the spoiler tag that "for" do not fit in)

Lia Sophie

Hy there, it's me again.
Thanks for helping with the translation. I have another question today.
My Board shows me this:
8: Undefined index: spoiler_for
Datei: /var/www/web454/html/Sources/Subs.php
Zeile: 1646

and this:
8: Undefined index: spoiler_for
Datei: /var/www/web454/html/Sources/Subs.php
Zeile: 1640

always! What does this mean, and how can I "repair" this?

The Code for this
array(
'tag' => 'spoiler',
'before' => '<div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>' . $txt['spoiler'] . '</b> ' . $txt['spoiler_for'] . ' <i>' . $txt['spoiler_default_for'] . '</i>: <input type="button" value="' . $txt['spoiler_show_button'] . '" style="width:60px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName(' . "'div'" . ')[1].getElementsByTagName(' . "'div'" . ')[0].style.display != ' . "''" . ') { this.parentNode.parentNode.getElementsByTagName(' . "'div'" . ')[1].getElementsByTagName(' . "'div'" . ')[0].style.display = ' . "''" . ';        this.innerText = ' . "''" . '; this.value = ' . "'$txt[spoiler_hide_button]'" . '; } else { this.parentNode.parentNode.getElementsByTagName(' . "'div'" . ')[1].getElementsByTagName(' . "'div'" . ')[0].style.display = ' . "'none'" . '; this.innerText = ' . "''" . '; this.value = ' . "'$txt[spoiler_show_button]'" . '; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;">',
'after' => '</div></div></div>',
            ),
array(
'tag' => 'spoiler',
'type' => 'unparsed_equals',
'before' => '<div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>' . $txt['spoiler'] . '</b> ' . $txt['spoiler_for'] .' <i>$1</i>: <input type="button" value="' . $txt['spoiler_show_button'] . '" style="width:60px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName(' . "'div'" . ')[1].getElementsByTagName(' . "'div'" . ')[0].style.display != ' . "''" . ') { this.parentNode.parentNode.getElementsByTagName(' . "'div'" . ')[1].getElementsByTagName(' . "'div'" . ')[0].style.display = ' . "''" . ';        this.innerText = ' . "''" . '; this.value = ' . "'$txt[spoiler_hide_button]'" . '; } else { this.parentNode.parentNode.getElementsByTagName(' . "'div'" . ')[1].getElementsByTagName(' . "'div'" . ')[0].style.display = ' . "'none'" . '; this.innerText = ' . "''" . '; this.value = ' . "'$txt[spoiler_show_button]'" . '; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;">',
'after' => '</div></div></div>',
            ),

);


the "before" is "Zeile" 1640 und Zeile 1646

Hope anyone can help me with this. Thanks

William L

I think This is because you do not define $ txt [ 'spoiler_for'] in your language file
Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

Lia Sophie

January 26, 2010, 11:02:52 PM #12 Last Edit: January 26, 2010, 11:22:15 PM by Lia Sophie
Quote from: William L on January 26, 2010, 01:11:33 PM
I think This is because you do not define $ txt [ 'spoiler_for'] in your language file
Hy William L
can you please tell me what I have to do? I'm not very good at this.




Lia Sophie

I think I got it now
I erased this $ txt [ 'spoiler_for']  when I installed this mod. Now I put it in again like this
$txt['spoiler'] = 'Spoiler';
$txt['spoiler_default_for'] = 'zum spickeln';
$txt['spoiler_for'] = ' ';
$txt['spoiler_hide_button'] = '-';
$txt['spoiler_show_button'] = 'klick';

and there are no more such messages.

Great! Thanks for the hint!   :-*

FragaCampos

Thanks for the mod William L, it works fine, but there's one "problem"... it doesn't work with code and quote tags inside...

Can you make this possible?

William L

February 24, 2010, 09:56:25 AM #15 Last Edit: February 24, 2010, 10:16:59 AM by William L
Quote from: FragaCampos on February 23, 2010, 07:03:19 PM
Thanks for the mod William L, it works fine, but there's one "problem"... it doesn't work with code and quote tags inside...

Can you make this possible?

Okay thanks for your report.

I want to upgrade my mood Soon :)

Sorry my english not good >,<

To Fix This problem, please upgrade your mod Spoiler BBCODE v1.1.2
Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

FragaCampos

Great! It works 8)

Thanks a lot William L!

Membre

Spanish_es / Spanish_latin / Spanish ( add utf8 also please :) )

$txt['spoiler'] = 'Spoiler';
$txt['spoiler_default_for'] = 'Escondido';
$txt['spoiler_for'] = '-';
$txt['spoiler_hide_button'] = 'Esconder';
$txt['spoiler_show_button'] = 'Mostrar';

tanshin

Hi there, do you know how this works in RC3?

William L

Mods:
1. Spoiler BBCODE v1.1.1 [Topic  || Download]
2. Yahoo Messenger BBCODE v1.1.1 [Topic  || Download]

Advertisement: