Advertisement:

Author Topic: Expanding & Collapsing Spoiler Tag  (Read 26992 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Expanding & Collapsing Spoiler Tag
« on: November 30, 2014, 07:40:36 PM »
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:
Code: [Select]
[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.
« Last Edit: January 16, 2015, 07:59:11 PM by dougiefresh »

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,413
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Expanding & Collapsing Spoiler Tag
« Reply #1 on: November 30, 2014, 09:26:11 PM »
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.?
Online Manual

Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #2 on: December 01, 2014, 05:36:39 PM »
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...

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,413
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Expanding & Collapsing Spoiler Tag
« Reply #3 on: December 01, 2014, 07:32:32 PM »
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.
Online Manual

Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #4 on: December 02, 2014, 07:08:04 PM »
 :P I wasn't trying to be defensive.....  Just stating facts.   ::) Thanks!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #5 on: December 05, 2014, 08:01:40 AM »
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.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #6 on: December 06, 2014, 04:18:01 PM »
Uploaded v1.2 - December 6th, 2014
o Added code to disable creation of the validation code if BBCode is disabled.

Offline 420Connect.co.uk

  • Full Member
  • ***
  • Posts: 413
    • 420connect.info on Facebook
    • @4twentyconnect on Twitter
    • 420 Connect
Re: Expanding & Collapsing Spoiler Tag
« Reply #7 on: December 10, 2014, 05:02:08 AM »
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" ;)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Expanding & Collapsing Spoiler Tag
« Reply #8 on: December 10, 2014, 09:35:41 AM »
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

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

Offline 420Connect.co.uk

  • Full Member
  • ***
  • Posts: 413
    • 420connect.info on Facebook
    • @4twentyconnect on Twitter
    • 420 Connect
Re: Expanding & Collapsing Spoiler Tag
« Reply #9 on: December 10, 2014, 12:51:30 PM »
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" ;)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Expanding & Collapsing Spoiler Tag
« Reply #10 on: December 10, 2014, 01:11:03 PM »
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

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

Offline 420Connect.co.uk

  • Full Member
  • ***
  • Posts: 413
    • 420connect.info on Facebook
    • @4twentyconnect on Twitter
    • 420 Connect
Re: Expanding & Collapsing Spoiler Tag
« Reply #11 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
(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.
« Last Edit: December 11, 2014, 12:15:14 PM by Kindred »
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #12 on: December 10, 2014, 06:28:10 PM »
Uploaded v1.3 - December 10th, 2014
o Added button for the bbcode.

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,413
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Expanding & Collapsing Spoiler Tag
« Reply #13 on: December 11, 2014, 09:05:10 AM »
(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
« Last Edit: December 11, 2014, 12:15:30 PM by Kindred »
Online Manual

Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #14 on: December 11, 2014, 11:53:14 AM »
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....
« Last Edit: December 11, 2014, 12:15:57 PM by Kindred »

Offline 420Connect.co.uk

  • Full Member
  • ***
  • Posts: 413
    • 420connect.info on Facebook
    • @4twentyconnect on Twitter
    • 420 Connect
Re: Expanding & Collapsing Spoiler Tag
« Reply #15 on: December 11, 2014, 01:22:26 PM »
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" ;)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #16 on: December 11, 2014, 07:27:04 PM »
@   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!
« Last Edit: December 11, 2014, 07:47:04 PM by dougiefresh »

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #17 on: December 29, 2014, 06:16:02 PM »
Uploaded v1.4 - December 29th, 2014
o Fixed image install locations within package-info.xml.

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,413
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Expanding & Collapsing Spoiler Tag
« Reply #18 on: December 29, 2014, 08:40:17 PM »
Question. Are you considering adding this function?

[spoiler=some text here]{content goes here}[/spoiler]
Online Manual

Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Expanding & Collapsing Spoiler Tag
« Reply #19 on: December 30, 2014, 04:00:07 AM »
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
« Last Edit: December 30, 2014, 04:21:00 AM by dougiefresh »