Advertisement:

Author Topic: Yet Another Spoiler Mod  (Read 826 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,502
    • XPtsp.com Community
Yet Another Spoiler Mod
« on: December 21, 2017, 09:38:22 AM »
Link to Mod


YET ANOTHER SPOILER MOD v1.1
By Dougiefresh -> Link to Mod


Introduction
This modification adds 3 BBCodes to the forum: spoiler, changelog and offtopic.  These bbcodes allows the post author to hide content in the post, which is clickable to display it to the user.

These 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.
o log - Flag to enable/disable logging of who viewed the spoiler.
o log_id - DO NOT EDIT!  Automatically replaces log parameter with number of spoiler we are tracking.

Admin Settings
Each bbcode has settings in Admin => Configuration => Modification Settings => YASM:
o {tag_name} style to use:
o Replace button text "{tag_name}" with:
o Replace button text "Show" with:
o Replace button text "Hide" with:
o Default to expanded status?
o Disable {tag_name} for guests globally?
o Disable line beneath {tag_name} text?
o Show which members viewed the {tag_name}?
o Number of members to show that viewed the {tag_name}

These BBCodes 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 them.

Mod Install Notes
This mod REPLACES and expands upon the functionality in the following mods:
o Expanding & Collapsing Changelog Tag
o Expanding & Collapsing Off-Topic Tag
o Expanding & Collapsing Spoiler Tag

These mods NEED TO BE removed prior to installation of this mod, as the installer will not permit this mod to be installed alongside those mods!  I will not be supporting those mods once this mod is approved!

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

Related Discussions
o Kortal's request for spoiler redesign
o WellWisher's changes to the design
o Spoilers
o [FREE/PAID] - Spoiler tag with user record
o [FREE] Spoiler Mod Tweaks

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 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.
« Last Edit: December 31, 2017, 11:23:22 AM by Steve »
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline SaltedWeb

  • Sr. Member
  • ****
  • Posts: 739
  • Why do we use the Internet...Hayes 1200 Thats Why
Re: Yet Another Spoiler Mod
« Reply #1 on: December 22, 2017, 08:22:38 PM »
Cool idea have seen this i other forums nice.
Multi-Linking, like a Boss.

Offline stoneageman

  • Semi-Newbie
  • *
  • Posts: 11
Re: Yet Another Spoiler Mod
« Reply #2 on: December 23, 2017, 04:59:08 AM »
Is the logging feature working?  I've ticked the check boxes but nothing is showing in the posts.  This is on SMF 2.0.15 with PHP 7.0.26
Thanks for this very useful mod Douglas  :)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,502
    • XPtsp.com Community
Re: Yet Another Spoiler Mod
« Reply #3 on: December 23, 2017, 10:54:51 AM »
Is the logging feature working?  I've ticked the check boxes but nothing is showing in the posts.  This is on SMF 2.0.15 with PHP 7.0.26
Thanks for this very useful mod Douglas  :)
An automatic "force logging" option is planned for the future, however, it is not available at the moment.  For now, you must start the spoiler using something like this:
Code: [Select]
[spoiler log=y]Once you submit the post, the log=y portion of the spoiler declaration will be replaced by the spoiler ID, which is generated by the mod.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline stoneageman

  • Semi-Newbie
  • *
  • Posts: 11
Re: Yet Another Spoiler Mod
« Reply #4 on: December 23, 2017, 02:38:55 PM »
Hi Doug, I've tried as you suggested with log=y log=true etc but it's not generating a spoiler ID.  I have no errors in my logs. It just acts like the regular spoiler. Thanks

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 375
  • Gender: Male
Re: Yet Another Spoiler Mod
« Reply #5 on: December 23, 2017, 06:17:17 PM »
@dougiefresh, just tested this on my local. I love how easy to manage the plugin is.

Incredible, incredible plugin!  ;D

For people running the older version, some good news:
I uninstalled the older version without a problem, and installed the new version and it saved my old spoiler tags so this was a very pleasant surprise.

Also adding the URL link works, I even manage to add font-awesome icon (as seen on the gif below) works like a charm! I did this through the plugin panel. I didn't have to modify any files - which was amazing; saved me a bunch of time! Really happy with that. :laugh:

I learnt this by playing around (maybe I set something up incorrectly), the "Hide" button wasn't there any more and the Spoiler button disappeared after you clicked on "Show" once:

Plus the URL link disappears which you click on show, but for my purposes, it's not an issue.

  :P

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,502
    • XPtsp.com Community
Re: Yet Another Spoiler Mod
« Reply #6 on: December 23, 2017, 07:41:38 PM »
Uploaded v1.1 - December 23rd, 2017
o Fixed issue showing/hiding proper links within the JavaScript code.
o Fixed database insertion issue within Subs-YASM.php code.



@Wellwisher:  I think I've taken care of the issue you pointed out.... *(Hell, I thought I took care of it before, too....)  The issue involved was a matter of focusing on the proper link elements....

@stoneageman:  Please try this version.  I think I've fixed the issue, but I'm not sure....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline stoneageman

  • Semi-Newbie
  • *
  • Posts: 11
Re: Yet Another Spoiler Mod
« Reply #7 on: December 23, 2017, 09:17:04 PM »
That's sorted it Doug. When using log=yes now works as expected. Much appreciated  ;)

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 375
  • Gender: Male
Re: Yet Another Spoiler Mod
« Reply #8 on: December 24, 2017, 12:55:35 AM »
@dougiefresh it's perfect 10/10 bud.

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Yet Another Spoiler Mod
« Reply #9 on: December 26, 2017, 04:36:13 AM »
Thank you

Offline Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,024
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Yet Another Spoiler Mod
« Reply #10 on: December 29, 2017, 07:26:09 PM »
Hey Dougie, you've duplicated what this mod replaces in the first post:

Mod Install Notes
This mod REPLACES and expands upon the functionality in the following mods:
o Expanding & Collapsing Spoiler Tag
o Expanding & Collapsing Off-Topic Tag
o Expanding & Collapsing Spoiler Tag
Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,502
    • XPtsp.com Community
Re: Yet Another Spoiler Mod
« Reply #11 on: December 29, 2017, 10:28:32 PM »
@Steve:  Sorry, I don't see the duplication, not in this version nor in the previous versions I have in my possession....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,024
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Yet Another Spoiler Mod
« Reply #12 on: December 30, 2017, 01:44:34 PM »
Not in the mod, in the first post of this thread.
Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,502
    • XPtsp.com Community
Re: Yet Another Spoiler Mod
« Reply #13 on: December 30, 2017, 09:57:11 PM »
 :o Okay, I see it now!   If I told you it was intentional, would you believe me?    ::) Nah, didn't think so, either....   8)
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,024
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Yet Another Spoiler Mod
« Reply #14 on: December 31, 2017, 11:23:47 AM »
Fixed it for you. ;)
Please do not PM me for support.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,502
    • XPtsp.com Community
Re: Yet Another Spoiler Mod
« Reply #15 on: December 31, 2017, 09:02:41 PM »
Okay, I've made that change in the mod itself, as updating the mod description also updates the first post for the support thread....  Won't update the mod until I have something more substantial that changed....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!