News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Expanding & Collapsing Spoiler Tag

Started by dougiefresh, November 30, 2014, 07:40:36 PM

Previous topic - Next topic

dougiefresh

Quote from: ?Almirena? on January 14, 2016, 06:08:26 AM
I would like to use an image (gif) instead of the word "spoiler". Presumably this is in the file index.english.php. Could you possibly let me know what I need to do?
Go into Themes/default/languages/index.english.php and replace this:
$txt['spoiler'] = "Spoiler";
with something like this:
$txt['spoiler'] = "<img src="{URL}" width=x height=y></img>
You can omit width and height if you desire, but you need to replace {URL} with the URL of the image you want to display in it's place.

?Almirena?

Hello - thank you, dougiefresh. It works beautifully.

Just for the information of others who may want to do something similar, don't forget the "; at the end...

$txt['spoiler'] = "<img src=http://www.yourdomain.com/images/spoiler.gif></img>";

or whatever URL is appropriate.

gerno

Hi, you considered add the parameter {expand} to sho the spoiler expanded by default?

It can be very useful for indexes, titles and sections on a large post.

Thanks

PD: I'm learning english

dougiefresh

I'd have to rewrite the mod for that....  Let me see what I can do.

gerno

Quote from: dougiefresh on February 12, 2016, 04:51:39 PM
I'd have to rewrite the mod for that....  Let me see what I can do.

Was just a suggestion, but I do not deserve that rewrites the mod just for my suggestion. Needs to be useful to other users and you have to consider your time and dedication.
I appreciate your work.

Thanks.

dougiefresh

Uploaded v3.0 - Febrary 13th, 2016
o Added "expand" parameter to indicate whether or not the spoiler is expanded by default.
o Rewrote spoiler validation function to support new parameter.




@gerno: Your request has been implemented.  I don't know if other people might find it useful, but there's only one way to find out!!!!  :P  Thanks for the suggestion!

EDIT: I honestly thought modifying the mod to do this would be more... problematic, I guess you would say....  It turned out to be quite easy....

spiritus_infernus

Hello there, found some strange thing using this spoiler: when placing something inside him instead of text, things making vanished. i.e. if place an image tag in spoiler- image hide. if placing somwthing within sploiler with text - only text shows all other - hides.
How possible solve it?

dougiefresh

I tried this:
[spoiler]
Blah Blah Blah
[img width=800 height=600]http://www.hispanicallyspeakingnews.com/uploads/images/article-images/black_panther_spain.jpg[/img]
[/spoiler]

and couldn't duplicate what you are seeing.  Could you provide the actual post you are using, so that I can see what is happening?  Thanks![/code]

spiritus_infernus

on my forum if I trying to use [_spoiler=with something inside him more than plain text]
for example image code: [_img]http://i.imgur.com/NIFgNqi.jpg[/img]
i will have nothing inside spoiler, except text
[_/spoiler]

as you understand, without _ this symbol
giving such results:
for preview it will show image (at screenshot 1)
for post - will not (screenshot 2)

dougiefresh

What version of this mod are you using?  Cause I've just tested with version 3.0 and it functions as expected for me....

spiritus_infernus

version 2.4, but when I've wrote a certain dimesions for included image in spoiler it shown. But I think it is not so useful and not even user on forum will diving deep in correct writing image tag in spoiler. Possible edit this by myself? or I can just upgrade version?

dougiefresh

I just tried the post contents you provided with mod version 2.4 and had the same results as version 3.0.  Please try upgrading to version 3.0 and tell me if the same thing happens.....

Darkness_Black

Good afternoon, in index.english missing $txt["debug_show"] = "SHOW";
Mod working  ;)
How do I show in button?

Translator - Brazilian

Não respondo MP de ajuda, Poste sua duvida no forum!!! Se alguém te Ajudou Agradeça!!!

dougiefresh

That's rather odd, cause the default install of SMF 2.x contains the string.  You can fix this particular bug report by adding the following line to the Themes/default/languages/index.english.php file:
$txt['debug_show'] = 'show';

Darkness_Black

Quote from: dougiefresh on February 16, 2016, 07:15:40 PM
That's rather odd, cause the default install of SMF 2.x contains the string.  You can fix this particular bug report by adding the following line to the Themes/default/languages/index.english.php file:
$txt['debug_show'] = 'show';


Already fix this, just sent you here to know they need to fix.

My question now is: How do I show in button?

Translator - Brazilian

Não respondo MP de ajuda, Poste sua duvida no forum!!! Se alguém te Ajudou Agradeça!!!

dougiefresh

You should be able to click to the word "Show" in the spoiler header in order to get the contents of the spoiler to show....

dougiefresh

Uploaded v3.1 - April 4th, 2016
o Added Spanish Latin translation by Rock Lee [BC].




@Rock Lee [BC]: Thank you for the translation.  It's been included in this version!

Kortal

Hey, thanks a lot dougiefresh for your hard work on mods.

Would it be possible to change a bit the spoiler design ? something more like quickspoiler or simplespoiler would be very nice.
(I just hate this straight line below the spoiler... lol)

Steve

I don't know Dougie's feelings on the subject but here's my unsolicited two cents worth:

Mod designers intentionally design their mods to look different and work different than other mods. Otherwise, what's the point of creating a mod that does the same basic thing as existing mods (in this case, hiding content)? My vote would be to leave it as is OR have an option to have the lines or not. :)
DO NOT pm me for support!

Kortal

Steve, I totally agree with you.

If i'm using this spoiler, it's because it has way more options than other mods. Most interesting is the option to hide or not to guests.
A good solution would be as you said, to be able to change a bit the layout, then it would be perfect (at least, for me)

Advertisement: