News:

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

Main Menu

Expanding & Collapsing Changelog Tag

Started by dougiefresh, November 30, 2014, 07:38:41 PM

Previous topic - Next topic

dougiefresh

Link to Mod



EXPANDING & COLLAPSING CHANGELOG 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 changelog in the post, which is clickable to display it to the user.

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


The {params} section may be any of the following parameters:
o text - Replaces default "changelog" text in the header.
o quote - Text that follows the "changelog" 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 changelog 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 changelog.  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.

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.

dougiefresh

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

dougiefresh

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

dougiefresh

Uploaded v1.5 - December 30th, 2014
o language.xml file renamed to english.xml
o Added new form of the bbcode: [changelog=Some Text]Content Here[/changelog]
o Changed bbcode definition code based on bbcodes defined in Sources/Subs.php...

dougiefresh

Uploaded v1.6 - January 16th, 2015
o License change to Simplified BSD.  No functionality change.

Uploaded v1.7 - April 4th, 2015
o Updated for SMF 2.1 Beta 1
o Fixed image upload location within package-info.xml

dougiefresh

Uploaded v1.8 - July 20th, 2015
o Fixed missing BBCode button in editor for SMF 2.1 Beta 1.
o Replaced the changelog button with a more "professional" image.

dougiefresh

Uploaded v2.0 - November 14th, 2015
o Changed all changelog tags to block-level tags.
o Changed bbcode tag types so that a validation function can be used to parse content inside tags.
o Changed the [changelog=text]{content}[/changelog] form to not parse other block-level tags.
o Moved all language modifications to the end of the language file.

dougiefresh

Uploaded v2.1 - November 18th, 2015
o Added "show" and "hide" parameters to replace default "show"/"hide" text with user specified text.

dougiefresh

Uploaded v2.2 - November 19th, 2015
o Fixed issue where bbcode button outputted wrong bbcode when pressed.




@Everybody:  When I released v2.0 of the changelog, offtopic and spoiler bbcode mods, I copied the code from one mod to another and replaced spoiler with the correct tag.  Somehow, I missed the bbcode tag ones for changelog and offtopic.....  It's fixed now.  Anyways, thanks for the bug report!

dougiefresh

Uploaded v2.3 - December 9th, 2015
o Added "guests" parameter to show/hide the spoiler to guests.  Accepts n, no, false, y, yes, true.
o Added global default setting to hide spoilers from guests.

dougiefresh

Uploaded v2.4 - December 30th, 2015
o Fixed minor visual issue with Changelog tag without parameters.

dougiefresh

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

dougiefresh

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

dougiefresh

Uploaded v3.2 - February 10th, 2017
o Added code so that the border underneath the "Changelog" text could be removed.
o Fixed code where guests are not allowed to view changelogs, but could anyways.
o Fixed code where guests were allowed to view changelogs, but couldn't.

dougiefresh

All development of this mod has been discontinued.  Any further development of this spoiler will take place in the Yet Another Spoiler Mod.  Please note you must uninstall this mod in order to install Yet Another Spoiler Mod.

Advertisement: