Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on July 08, 2015, 07:21:10 PM

Title: SportsNet.ca Video BBCode
Post by: dougiefresh on July 08, 2015, 07:21:10 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4058)



SPORTSNET.CA VIDEO BBCODE v1.15
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4058)



Introduction
This modification adds a BBCodes to watch videos from the SportsNet.ca website.

The two BBCodes takes these forms:

[sportsnet]{sportsnet video URL}[/sportsnet]
[sportsnet width=x height=x]{sportsnet video URL}[/sportsnet]

where {sportsnet video URL} is the sportsnet video URL and the width and height parameters being optional.  If the width and height aren't specified, the video is displayed at 100% of the display post.  Please note that width and height specify the maximum size that the video may take up on the screen.

Admin Settings
The default width and height parameters can be specified in the Admin -> Configuration -> Modification Settings area.

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

This mod should be installed after Tapatalk mod (https://www.tapatalk.com/download_SimpleMachines.php), if you want to use it with Tapatalk.

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/sportsnet-video-bbcode/?tab=1).

License
Copyright (c) 2015 - 2019, 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.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on July 08, 2015, 10:22:21 PM
Uploaded v1.1 - July 8th, 2015
o Made sure URLs were trimmed of spaces and began with either "http://" or "https://".
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on July 18, 2015, 08:32:47 AM
Uploaded v1.2 - July 18th, 2015
o Added responsive video display elements to this mod.
o Fixed width and height parameters so that they work correctly as expected.
o When specifying width and height parameters, they are now treated as maximum display size.
o Changed default width and height from 640x400 to 100% of post display area.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on August 08, 2015, 12:05:20 PM
Uploaded v1.3 - August 8th, 2015
o Removed support for SMF 2.1 Beta 1
o Added support for SMF 2.1 Beta 2
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on August 12, 2015, 05:09:06 PM
Uploaded v1.4 - August 12th, 2015
o Added settings to allow admin to set default size of the SportsNet video.
o Altered code to use new default size settings when width and/or height isn't specified.
o Added "frameborder" parameter to the bbcode.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on October 02, 2015, 09:01:34 PM
Uploaded v1.5 - October 2nd, 2015
o Modified validation function to check to make sure URL is actually a NHL video URL.
o Added "Invalid SportsNet URL" message for use with invalid SportsNet URLs (duh)....
o Added ability to auto-embed SportsNet URLs to the mod.
o Added code to remove auto-embedded NHL videos from within code tags.
o Fixed language strings so that they appear in the Modifications Settings area.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on October 03, 2015, 03:47:51 PM
Uploaded v1.6 - October 3rd, 2015
o SMF 2.1: Added ability to auto-embed SportsNet URLs to the mod.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on November 30, 2015, 07:30:06 PM
Uploaded v1.7 - November 30th, 2015
o Corrected auto-embed code so that URLs not surrounded by tags are converted to SportsNet tags.
o Modified existing auto-embed capability as hook for SMF 2.1
o Fixed some validation issues with SportsNet.ca URLs.
Title: Re: SportsNet.ca Video BBCode
Post by: Bigguy on December 23, 2015, 09:49:08 AM
I have this installed with 2.1 and when I put the url in I get:

Invalid SportsNet URL

What part of the url is supposed to be enbedded all of it or part of it or what. I would really like to get this working so any help would be great.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on December 23, 2015, 06:34:17 PM
The mod will pick up on URLs that look like this:
http://www.sportsnet.ca/hockey/nhl/engels-dont-believe-canadiens-have-faith-in-tokarski/?row=0&row_id=1617293
If you find a different format that needs to work, post the URL so that I can fix the mod to work with that URL. 

Hope this helps!
Title: Re: SportsNet.ca Video BBCode
Post by: Bigguy on December 23, 2015, 06:57:04 PM
No, that looks exactly like the link I tried. I am using the wysiwyg editor and have another embed mod installed but that is not effecting anything. This is what I tried:

[sportsnet]http://www.sportsnet.ca/hockey/nhl/nhl-morning-catch-up-flames-win-10th-straight-at-home/?row=0&row_id=1617477[/sportsnet]
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on December 23, 2015, 07:21:22 PM
Uploaded v1.8 - December 23rd, 2015
o Fixed auto-embed code (again) so that URLs are embedded correctly.




@Bigguy: It was the auto-embed code that was screwing things up.  This update fixes this issue.  Thanks for the bug report!
Title: Re: SportsNet.ca Video BBCode
Post by: Bigguy on December 23, 2015, 07:24:05 PM
Hey not a problem, glad I could help out. :)
Title: Re: SportsNet.ca Video BBCode
Post by: Bigguy on December 23, 2015, 07:30:19 PM
I may have another, sorry. I don't get an eror now but I don't see anything either. I'll look in Edge. It's the same in edge and I don't see errors anywhere.
Title: Re: SportsNet.ca Video BBCode
Post by: Bigguy on December 23, 2015, 07:32:05 PM
Wait, I do get an error:

file_get_contents(http://www.sportsnet.ca/hockey/nhl/nhl-morning-catch-up-flames-win-10th-straight-at-home/?row=0&row_id=1617477): failed to open stream: no suitable wrapper could be found

This one could be my fault.

file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0
Title: Re: SportsNet.ca Video BBCode
Post by: Bigguy on December 23, 2015, 07:49:25 PM
The second error was the problem. It works fine now. Thank you for your time. Good work on the mod. :)
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on March 07, 2016, 02:31:45 PM
Uploaded v1.9 - March 7th, 2016
o Modified auto-embed code so that SportsNet URLs in signature are embedded as [url]{link}[/url].
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on July 17, 2017, 10:03:58 AM
Uploaded v1.10 - July 16th, 2017
o Added ability for user to full-screen the video.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on December 08, 2017, 09:50:48 PM
Uploaded v1.11 - December 8th, 2017
o Added URL embedding code for the Tapatalk mod.
Title: Re: SportsNet.ca Video BBCode
Post by: -Rock Lee- on December 14, 2017, 08:57:16 PM
This never had heard about it seems interesting the page itself ... while I see how the site works, I leave the translation into Latin Spanish.


Regards!
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on December 15, 2017, 02:44:18 PM
Uploaded v1.12 - December 15th, 2017
o Added Spanish Latin translation, courtsey of Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)!




@Rock Lee:  Thank you for the translation!  It's been included in this version!
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on March 04, 2018, 10:12:54 PM
Uploaded v1.13 - March 4th, 2018
o Fixed an issue that prevents BBC manager from showing bbcodes.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on November 08, 2018, 09:22:20 PM
Uploaded v1.14 - November 8th, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: SportsNet.ca Video BBCode
Post by: dougiefresh on May 22, 2019, 10:23:56 AM
Uploaded v1.15 - May 22nd, 2019
o Fixed Spanish Latin language file to properly skip missing file.