News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Expanding & Collapsing Spoiler Tag

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

Previous topic - Next topic

dougiefresh

Link to Mod



EXPANDING & COLLAPSING SPOILER TAG v3.2B
By Dougiefresh -> Link to Mod



Notice
This mod is no longer being supported.  You are strongly encouraged to use Yet Another Spoiler Mod instead...

Introduction
This modification adds a BBCode to the forum that allows the post author to hide a spoiler in the post, which is clickable to display it to the user.

This BBCode takes the forms:
[nobbc]
[nobbc][spoiler]{content}[/spoiler][/nobbc]
[nobbc][spoiler {params}]{content}[/spoiler][/nobbc]
[nobbc][spoiler=Some Text]{content goes here}[/spoiler][/nobbc]
[/nobbc]


The {params} section may be any of the following parameters:
o text - Replaces default "Spoiler" text in the header.
o quote - Text that follows the "Spoiler" text in the header.  Must be in quotes.
o show - Replaces default "Show" text in the header.
o hide - Replaces default "Hide" text in the header.
o guests - Flag to show spoiler to guests or not.  May be n, no, false, y, yes, or true.

Note that the form (#3) with the equal sign does not parse other block-level bbcode tags inside the spoiler.  Empty form or form with parameters does not have this restriction.

Admin Settings
This BBCode may be disabled by going into the Admin => Forum => Posts and Topics => Bulletin Board Code and unchecking the bbcodes you don't want to use.  You may also be uninstall this mod in order to disable it.

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 Beta 1, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2015 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Steve

Don't take this wrong because I love your mods and have some installed but I have a question ...

How is this different than http://custom.simplemachines.org/mods/index.php?mod=195 ?

Up-to-date code, etc.?
DO NOT pm me for support!

dougiefresh

That mod looks like it supports 3 different types of spoilers, configurable per theme.  If I had been aware of that mod, I probably wouldn't have written up this one....  But I needed a simple spoiler bbcode for our site, and thought other people might appreciate this mod.  It also has the benefit of being localize-able...

Steve

Okies ... I didn't mean to make you defensive ... the mod I pointed out may be overkill for some folks so your mod is a good addition.
DO NOT pm me for support!

dougiefresh

 :P I wasn't trying to be defensive.....  Just stating facts.   ::) Thanks!

dougiefresh

Uploaded v1.1 - December 5th, 2014
o Made the "show" and "hide" strings localizable.
o Modified code to replace the strings once per page load, instead of every use of the BBCode.

dougiefresh

Uploaded v1.2 - December 6th, 2014
o Added code to disable creation of the validation code if BBCode is disabled.

420Connect.co.uk

I've just installed this mod; however I can't see any new buttons added to use the [spoiler] tags although I can type them manually and use them?
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

margarett

Yes, most BBC mods don't really add a button to it, just the functionality.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

420Connect.co.uk

Oh...  :P

Do you know if it would it be easy enough to add in a custom button?
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

margarett

Yes, it is ;) But it's up to dougiefresh to do it or not ;)
It only requires another hook, a function and an image.
Check, eg, this MOD or other BBC-kind MODs to see how it's done ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

420Connect.co.uk

#11
Thank you for the reply margarett,
I've since found a similar mod that does what I was looking for
(http://custom.simplemachines.org/mods/index.php?mod=2330) (for anyone in the future)
but good to know for future ideas! :D

margarett to the rescue as always! lol



kindred edit---
edited to remove the d/l link -- 420 - please do not link directly to downloads. Link to the mod page if you must -- and linking to ANOTHER mod in the support thread for this mod is bad manners anyway.
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

dougiefresh

Uploaded v1.3 - December 10th, 2014
o Added button for the bbcode.

Steve

#13
Quote from: 420connect.info on December 10, 2014, 02:04:17 PM(link removed)

That wasn't nice. I clicked the link without realizing it would download automatically instead of taking me to the mod page to see it first.

And dougie is EXTREMELY good at what he does and will bend over backward to add functionality to his mods.

Awesome work as always dougie. :D
DO NOT pm me for support!

dougiefresh

#14
Quote from: 420connect.info on December 10, 2014, 02:04:17 PM
Thank you for the reply margarett,
I've since found a similar mod that does what I was looking for
(link removed) (for anyone in the future)
but good to know for future ideas! :D

margarett to the rescue as always! lol
I've been working 11+ hour workdays lately....  next time please give me a chance to implement a new idea/suggestion before giving up....

420Connect.co.uk

I apologize!
I was looking for a quick fix and solved my issue but I thank you for the update and mod! :)
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

dougiefresh

#16
@   420connect.info: Kinda annoyed, but no offense taken!  :P  Yesterday, you had posted right around the time I started my shift.  I got home about an hour or so before I posted the new version....  Today I did a longer shift....  Looking forward to the next 2 days off....

Btw, you're welcome!




@Kindred: Thank you!

dougiefresh

Uploaded v1.4 - December 29th, 2014
o Fixed image install locations within package-info.xml.

Steve

Question. Are you considering adding this function?

[spoiler=some text here]{content goes here}[/spoiler]
DO NOT pm me for support!

dougiefresh

#19
Quote from: Steve on December 29, 2014, 08:40:17 PM
Question. Are you considering adding this function?

[spoiler=some text here]{content goes here}[/spoiler]
And what form would the "some text here" take?  Do you want it similar to the code bbcode, where this:
Quote[code=Find]Blah Blah Blah[/code]
would produce this:
Quote
Code (Find) Select
Blah Blah Blah

Advertisement: