Expanding & Collapsing Off-Topic Tag

Started by dougiefresh, November 30, 2014, 08:33:49 PM

Previous topic - Next topic

dougiefresh

Link to Mod



EXPANDING & COLLAPSING OFFTOPIC TAG v3.2
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 offtopic in the post, which is clickable to display it to the user.

This BBCode takes the form:
[nobbc]
[offtopic]{content}[/offtopic]
[offtopic text=Blah]{content}[/offtopic]
[offtopic quote="Blah"]{content}[/offtopic]
[/nobbc]

Note that quotes are required for the quote parameter, but not for the text parameter.  These forms have no issues with other block-level tags inside the offtopic tag.

This BBCode can also take the following form:
[nobbc]
[offtopic=Some Text]{content goes here}[/offtopic]
[/nobbc]

Note that, for this form, other block-level bbcode tags are not parsed inside this offtopic tags form.

NEW FOR 2.1:
Version 2.1 introduces two optional parameters for use:
o hide parameter indicates the text to replace the default "hide" string
o show parameter indicates the text to replace the default "show" string.

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 has been removed and can be seen at XPtsp.com.

License
QuoteCopyright (c) 2015 - 2017, 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

#1
Now that's a useful mod. I can see where this would be used on a lot of boards. Great idea! :D
DO NOT pm me for support!


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: [offtopic=Some Text]Content Here[/offtopic]
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.

dougiefresh

Uploaded v1.7 - April 4th, 2015
o Updated for SMF 2.1 Beta 1


brynn

Just installed in 2.0.10 with TP.  I've been looking for an off topic tag for awhile, and I was happy to find this.  It seems to work very well!

But I have to be curious about the button itself.  Is it supposed to look like it's been sketched rather than typed, or created graphically?  Screenshot attached, in case you don't see what I see.  I think it might add a more professional touch to have the button look nice, like all the other buttons (at least anti-aliased).  Unless there's some significance to having it look like is was sketched, that I just don't get?

Congrats on the otherwise nice-working mod   :)

dougiefresh

Uploaded v1.8 - July 20th, 2015
o Fixed missing BBCode button in editor for SMF 2.1 Beta 1.
o Remade Off-topic bbcode button with different font.




@brynn:  I've attached the new bbcode button image to this post.

brynn


dougiefresh

Uploaded v2.0 - November 14th, 2015
o Changed all spoiler 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 [spoiler=text]{content}[/spoiler] 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.

villasg

I think have error .
after remove the 2.0 and install 2.1 have this

[spoiler]ssssssssss[/spoiler]


dougiefresh

 :o  Ummm....  I'm gonna throw out a guess here, but maybe you are using the wrong package?  Maybe you meant to use my Expanding & Collapsing Spoiler Tag mod...?

O:) Anyways, with this mod, try using offtopic instead of spoiler..... 

villasg

Quote from: dougiefresh on November 19, 2015, 03:59:39 AM
:o  Ummm....  I'm gonna throw out a guess here, but maybe you are using the wrong package?  Maybe you meant to use my Expanding & Collapsing Spoiler Tag mod...?

O:) Anyways, with this mod, try using offtopic instead of spoiler.....

Hi .
Before update i have installed v 2.0 and work great .
I unistall and install v 2.1 and have this problem .
If i replace manual in post the spoiler with offtopic mod showing good ! ! !
But my forum users ......... cannot and confused ! ! ! ! !

AND

I remove v 2.1 and install the v 2.0 ( working good before )  but now have the same issue ....
Strange ! ! ! !

dougiefresh

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




@villasg:  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!

villasg


Advertisement: