Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on December 10, 2014, 06:09:01 PM

Title: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 10, 2014, 06:09:01 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3982)



YET ANOTHER YOUTUBE BBCODE TAG v4.14
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3982)



Introduction
This modification adds a BBCode to the forum that shows a YouTube video in your post.

These BBCode takes these forms:

[youtube]{youtube link}[/youtube]
[youtube width=x height=y]{youtube link}[/youtube]
[yt]{youtube ID}[/yt]
[yt {parameters}]{youtube ID}[/yt]
[yt_user]{username}[/yt_user]
[yt_user {parameters}]{username}[/yt_user]
[yt_search]{search query}[/yt_search]
[yt_search {parameters}]{search query}[/yt_search]

where width and height is specified by x and y.  If width and height aren't specified, width is 100% of the post display area and height in a 16:9 ratio to the width.

The yt_user bbcode will show videos by the specified YouTube username.

The yt_search bbcode will show videos matching the provided search phrase.

This mod should be able to display a valid YouTube video when passing URLs.  For example, all of the following will display the YouTube video at http://www.youtube.com/v/fA4cphzsjn8 (http://www.youtube.com/v/fA4cphzsjn8).
Quote
For YouTube Videos:
fA4cphzsjn8
http://www.youtube.com/fA4cphzsjn8
http://www.youtube.com/embed/fA4cphzsjn8
http://www.youtube.com/embed?v=fA4cphzsjn8
http://www.youtube.com/embed?feature=player_embedded&v=fA4cphzsjn8
http://www.youtube.com/watch?v=fA4cphzsjn8
http://www.youtube.com/v/fA4cphzsjn8
http://www.youtube.com/e/fA4cphzsjn8
http://www.youtube.com/?v=fA4cphzsjn8
http://www.youtube.com/user/username#p/u/11/fA4cphzsjn8
http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/fA4cphzsjn8
http://www.youtube.com/watch?feature=player_embedded&v=fA4cphzsjn8
http://www.youtube.com/?feature=player_embedded&v=fA4cphzsjn8

For YouTube PlayLists:
PL55713C70BA91BD6E
PLquckZj9TVRFKWqM6LJI4a_dgvN48jZGk
http://www.youtube.com/e/PL55713C70BA91BD6E
http://www.youtube.com/p/PL55713C70BA91BD6E
http://www.youtube.com/embed/PL55713C70BA91BD6E
http://www.youtube.com/embed?list=PL55713C70BA91BD6E
http://www.youtube.com/embed?feature=player_embedded&list=PL55713C70BA91BD6E
http://www.youtube.com/watch?v=OPf0YbXqDm0&list=PL55713C70BA91BD6E
http://www.youtube.com/?list=PL55713C70BA91BD6E
http://www.youtube.com/?feature=player_embedded&list=PL55713C70BA91BD6E
https://www.youtube.com/embed/videoseries?list=PLquckZj9TVRFKWqM6LJI4a_dgvN48jZGk
https://www.youtube.com/watch?v=Ni4ZclaiOtY&list=PLquckZj9TVRFKWqM6LJI4a_dgvN48jZGk
Substituting http://youtube.com, http://www.youtube-nocookies.com, http://youtu.be, and http://www.youtu.be also works.  https:// works instead of http://.  Please note any other parameters specified in the URL are ignored.

Optional parameters and values for all YouTube bbcodes are:
o width = Specifies the width of the iframe area.
o height = Specifies the height of the iframe area.
o start = Specifies how far into the video to start at.  Valid formats: "Seconds" or "Minutes:Seconds"
o end = Specifies how far into the video to stop at.  Valid formats: "Seconds" or "Minutes:Seconds"
o autoplay = 1, yes, on or true
o color = red or white
o theme = dark or light
o loop = 1, yes, on or true
o controls = 0, no, off, hide or false
o showinfo = 0, no, off, hide or false
o privacy = 1, yes, on or true

Profile Settings
There is a new option under Profile => Look and Layout called Show YouTube videos as a link.  Checking this box makes the mod create links instead of embedded videos in your post.

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.

Related Discussions
o Adding option to stop mod from displaying YouTube video's as a video (http://www.simplemachines.org/community/index.php?topic=522345.msg3695157#msg3695157)
o Youtube I.D parsing for new URL formats (http://stackoverflow.com/questions/2936467/parse-youtube-video-id-using-preg-match)
o Need help with a Regular Expression for YouTube links.... (http://www.simplemachines.org/community/index.php?topic=533748.0)

Extra Credits Go Out To:
o Sapozhnik (http://www.simplemachines.org/community/index.php?action=profile;u=317117) for code assistance
o karavan2 (http://www.simplemachines.org/community/index.php?action=profile;u=308325) for providing code assistance
o kelvincool (http://www.simplemachines.org/community/index.php?action=profile;u=303481) for Regular Expression assistance

Translators
o Spanish Latin: Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597)

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

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

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.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 10, 2014, 06:37:12 PM
Uploaded v1.1 - December 10th, 2014
o Added button for the bbcode.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 11, 2014, 04:18:48 AM
Uploaded v1.2 - December 11th, 2014
o Fixed incorrect strings added by the mod.
Title: Re: Yet Another YouTube BBCode Tag
Post by: lordrene on December 12, 2014, 04:15:06 AM
Quote from: dougiefresh on December 11, 2014, 04:18:48 AM
Uploaded v1.2 - December 11th, 2014
o Fixed incorrect strings added by the mod.
I have the default 2.9 theme and when I try to install the mod, It give me this error
Title: Re: Yet Another YouTube BBCode Tag
Post by: kat on December 12, 2014, 06:12:56 AM
http://wiki.simplemachines.org/smf/Error_in_mod_installation

The link might fail, a few times, coz the wiki's crap, at the moment, for some reason. Keep trying, though, and it'll load, eventually.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 12, 2014, 08:26:43 AM
Quote from: lordrene on December 12, 2014, 04:15:06 AM
Quote from: dougiefresh on December 11, 2014, 04:18:48 AM
Uploaded v1.2 - December 11th, 2014
o Fixed incorrect strings added by the mod.
I have the default 2.9 theme and when I try to install the mod, It give me this error

Okay, these lines have to do with the parsers' ability to accept only the youtube bbcode (and contents) as the only content in the post.  In other words, you put this in your post:
[youtube]{some id here}[/youtube]
and that's all and the editor will accept it.  If you have another mod that makes the same alteration to these areas, then you should be fine skipping those operations.  Although, I find it weird that the first operation works and the second doesn't.....
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 16, 2014, 06:31:22 AM
Does this mod display "link invalid" when it's actually invalid?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 16, 2014, 04:48:36 PM
At present time, entering an invalid link only gets you a blank square....  I'll figure out something to make this work correctly for that situation....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 17, 2014, 06:44:22 PM
Uploaded v1.3 - December 17th, 2014
o Rewrote mod to use one validation function for all bbcodes forms in this mod.
o Modified code to return "Invalid YouTube Link" if the link isn't valid...

Quote from: NekoJonez on December 16, 2014, 06:31:22 AM
Does this mod display "link invalid" when it's actually invalid?
@NekoJonez: This update provides this additional functionality.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 19, 2014, 08:11:23 PM
Uploaded v1.4 - December 19th, 2014
o Fixed typo that resulted in errors being logged in the admin panel...
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 21, 2014, 04:58:38 PM
Awesome, my next site update will replace the mod I had with this one :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dream of Omnimaga on December 27, 2014, 12:26:37 AM
Does this support https links or just http?
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 27, 2014, 09:30:10 AM
Feature request: could you add an option for users so that when they have eg a slow internet they can load the vids as links?

This topic could help: http://www.simplemachines.org/community/index.php?topic=522345.msg3695157#msg3695157
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 27, 2014, 07:02:09 PM
Quote from: DJ Omnimaga on December 27, 2014, 12:26:37 AM
Does this support https links or just http?
Yes, this mod also supports the https form of the YouTube links.

Quote from: NekoJonez on December 27, 2014, 09:30:10 AM
Feature request: could you add an option for users so that when they have eg a slow internet they can load the vids as links?

This topic could help: http://www.simplemachines.org/community/index.php?topic=522345.msg3695157#msg3695157
Yes, I can do that for you.  And thanks for the helpful link to the solution....
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 28, 2014, 06:07:04 AM
Awesome. I can't wait until you get the option working :D. Would mean a great deal to me.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 28, 2014, 04:59:38 PM
Uploaded v1.5 - December 28th, 2014
o Added yt bbcode, which uses same syntax as the youtube bbcode.
o Added option to disable the embedding of YouTube videos on a per-user basis.
o Modified to use link provided when YouTube bbcode is disabled.
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 29, 2014, 09:37:52 AM
Is there already a feature to install the picture of the button into other themes?
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 29, 2014, 11:03:58 AM
Bug report:

Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 29, 2014, 05:59:11 PM
Quote from: NekoJonez on December 29, 2014, 11:03:58 AM
  • The mod doesn't look for other themes to place the img for the button in.
I've got this bug report fixed for the next version....

Quote from: NekoJonez on December 29, 2014, 11:03:58 AM
  • When v1.5 is installed, the bbc codes get messed up. I couldn't get color to work and ALL my url tags where displayed as links.
Crap....  I messed up in the package-info.xml file and replace instead of after....  I've fixed this bug report for the next version....  Sorry about that!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 29, 2014, 06:02:08 PM
Uploaded v1.6 - December 29th, 2014
o Fixed image install locations within package-info.xml.
o Replaced replace with after in install.xml for new code in v1.5...
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on December 30, 2014, 04:30:29 AM
Score!

Man, I feel like your personal plug-in testing friend :3.

If you need anything to test, you know where I am. ;)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on January 09, 2015, 06:02:50 AM
Another nice mod Doug  8)
Observation: If I click the youtube button on a bare post it only adds the front part of the code [youtube] and not the end code.  If I paste the URL into a post, then highlight the url and then click the youtube button it does wrap the url properly.

Thanks again Doug.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Geor'G on January 09, 2015, 06:20:52 AM
Not all links work.
These work:
[youtube]fA4cphzsjn8[/youtube]
[youtube]http://youtu.be/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/embed/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/watch?v=fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/v/fA4cphzsjn8[/youtube]


Do not work:
[youtube]http://www.youtube.com/?v=fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/e/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/user/username#p/u/11/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/watch?feature=player_embedded&v=fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/?feature=player_embedded&v=fA4cphzsjn8[/youtube]
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on January 09, 2015, 07:59:39 PM
Thanks Geor'G,  I'll post those in the thread I have going .
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 09, 2015, 08:12:58 PM
Quote from: Geor'G on January 09, 2015, 06:20:52 AM
Not all links work.
These work:
[youtube]fA4cphzsjn8[/youtube]
[youtube]http://youtu.be/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/embed/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/watch?v=fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/v/fA4cphzsjn8[/youtube]


Do not work:
[youtube]http://www.youtube.com/?v=fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/e/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/user/username#p/u/11/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/watch?feature=player_embedded&v=fA4cphzsjn8[/youtube]
[youtube]http://www.youtube.com/?feature=player_embedded&v=fA4cphzsjn8[/youtube]

Thank you for reporting this.  I will investigate these issues.....




Quote from: Rk2910 on January 09, 2015, 07:59:39 PM
Thanks Geor'G,  I'll post those in the thread I have going .
Um....  THIS is the support topic here at Simple Machines for this mod.  I don't look other places for support issues....

That having been said, where is the thread you have going?  Links would be helpful....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on January 10, 2015, 07:15:49 AM
Quote from: dougiefresh on January 09, 2015, 08:12:58 PM
Quote from: Rk2910 on January 09, 2015, 07:59:39 PM
Thanks Geor'G,  I'll post those in the thread I have going .
Um....  THIS is the support topic here at Simple Machines for this mod.  I don't look other places for support issues....

That having been said, where is the thread you have going?  Links would be helpful....
No other thread here - I have a thread on my site that explains how to use the youtube bbc so my members can take advantage of it.
Keep up the good work Doug.  Thx.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 10, 2015, 08:44:15 AM
 :o OH!!  Cool!  Sorry, I had misunderstood the purpose of the thread.  Thanks, Rk2910!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 19, 2015, 09:50:37 AM
Uploaded v1.7 - January 19th, 2015
o License change to Simplified BSD.  No functionality change.
Title: Re: Yet Another YouTube BBCode Tag
Post by: bsnooch on January 19, 2015, 10:01:51 PM
great plugin, many thanks.
could you please add support for embedding playlists?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Ataru Moroboshi on January 23, 2015, 04:38:28 AM
Is there any easy way to change the position of bbc button in the editor?
Title: Re: Yet Another YouTube BBCode Tag
Post by: karavan2 on January 25, 2015, 03:11:43 PM
Lincs type http://www.youtube.com/watch?feature=player_embedded&v=WlobIDJyyOs and https://www.youtube.com/watch?v=Yvb3O42dDLQ&feature=player_embedded&x-yt-ts=1421914688&x-yt-cl=84503534 not work, get the message  [ Invalid YouTube link ].
Title: Re: Yet Another YouTube BBCode Tag
Post by: Wkr on January 25, 2015, 03:17:28 PM
Is it possible in the future set the bbcode what only appears on a board?
For example: on a board called video or a id_board = XX
Thanks.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 13, 2015, 09:55:13 AM
I'm looking into these bug reports....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 13, 2015, 06:35:03 PM
Quote from: bsnooch on January 19, 2015, 10:01:51 PM
could you please add support for embedding playlists?
Let me see what I can do about this....

Quote from: Ataru Moroboshi on January 23, 2015, 04:38:28 AM
Is there any easy way to change the position of bbc button in the editor?
Not without editing the Subs-BBCode-YouTube.php file....  The ability to adjust the bccode buttons would be nice....

Quote from: Wkr on January 25, 2015, 03:17:28 PM
Is it possible in the future set the bbcode what only appears on a board?
For example: on a board called video or a id_board = XX
Thanks.
I can look into adding this feature, but bbcodes are generally available across the board on a forum.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 13, 2015, 06:46:37 PM
:o OMG!  Everybody, I'm so sorry about releasing this mod with clearly an erroneous statement that the regex expression for preg_match will covert the listed formats.  I took the statement about what it will cover from the Youtube I.D parsing for new URL formats (http://stackoverflow.com/questions/2936467/parse-youtube-video-id-using-preg-match) page and did not look closely at the expression.  I want to apologize to everybody about this, and hope that you forgive me....

After some fighting with the regex expression, I have gotten my personal copy supports the following forms:
http://youtu.be/fA4cphzsjn8
http://www.youtube.com/embed/fA4cphzsjn8
http://www.youtube.com/watch?v=fA4cphzsjn8
http://www.youtube.com/v/fA4cphzsjn8
http://www.youtube.com/e/fA4cphzsjn8
http://www.youtube.com/p/fA4cphzsjn8
http://www.youtube.com/?v=fA4cphzsjn8

These currently do not work:
http://www.youtube.com/user/username#p/u/11/fA4cphzsjn8
http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/fA4cphzsjn8
http://www.youtube.com/watch?feature=player_embedded&v=fA4cphzsjn8
http://www.youtube.com/?feature=player_embedded&v=fA4cphzsjn8


I am continuing to test the changes I am making to the mod in order to get the last two forms to play, however, I'm not sure how I will get first two forms to work correctly....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 17, 2015, 08:10:28 PM
UPDATE: This mod has been updated so that it correctly validates the specified forms.  I don't have time to release the new version tonight, but I will release it tomorrow.  It's bedtime here....

REGARDING PLAYLISTS:  I haven't had time to figure out the correct forms for playlists yet.  It'll be part of the version after this next version.  I apologize if this inconveniences anybody....  but regular expressions are HARD!!!  :P
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 18, 2015, 05:09:49 AM
Uploaded v1.8 - February 18th, 2015
o Updated Regular Expression used to validate the last few reported forms of the YouTube URL.
o Added some backup code in the event that the Regular Expression doesn't catch a valid URL.
Title: Re: Yet Another YouTube BBCode Tag
Post by: karavan2 on February 18, 2015, 10:40:09 AM
Good news, thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on February 18, 2015, 06:25:12 PM
Thanks for all your hard work Doug  8)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 18, 2015, 07:09:43 PM
Y'all are welcome!




UPDATE: The next version of this mod will a fairly major update.  It will support YouTube playlist IDs, and will support at least 5 new parameters for the YouTube and YT bbcodes: autoplay, color, theme, start and end.  It may support YouTube videos uploaded by a specific user, as well as YouTube videos as part of a search query, each being part of a different bbcode....  More information will be forthcoming when the mod is released into the wild....
Title: Re: Yet Another YouTube BBCode Tag
Post by: karavan2 on February 19, 2015, 01:41:39 AM
Quote from: dougiefresh on February 18, 2015, 07:09:43 PMUPDATE: The next version of this mod will a fairly major update.  It will support YouTube playlist IDs, and will support at least 5 new parameters for the YouTube and YT bbcodes: autoplay, color, theme, start and end.  It may support YouTube videos uploaded by a specific user, as well as YouTube videos as part of a search query, each being part of a different bbcode....  More information will be forthcoming when the mod is released into the wild....
This is a very significant change functionality, offer to call it version 2.0 and the current version 1.8 does not remove and leave also available for download.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 19, 2015, 07:58:17 AM
Uploaded v2.0 - February 19th, 2015
o YouTube videos are now displayed using the iframe tag for HTML5 compatibility.
o http://www.youtube-nocookie.com is now a valid URL to specify in the bbcode.
o Added yt_user bbcode to create a playlist of YouTube videos by a specific user.
o Added yt_search bbcode to create a playlist based on specified search results.
o Added support for YouTube playlist IDs as part of the youtube and yt bbcodes.
o Modification made to BBCode hook to define all bbcode parameters only ONCE for uniformity.
o Fixed a bug in the validation function that didn't set width/height parameters correctly.
o Modified validation function to work properly for all known YouTube video/playlist URLs with IDs.
o Parameters width and height are now optional instead of mandatory.
o Fixed an issue where the video's aspect ratio is screwed up if width or height isn't specified.
o Added autoplay parameter to the bbcodes.  1, yes, on and true are supported.
o Added color parameter to the bbcodes.  red and white are supported by YouTube.
o Added theme parameter to the bbcodes.  dark and light are supported by YouTube.
o Added loop parameter to the bbcodes.  1, yes, on and true are supported.
o Added start parameter to the bbcodes, specifying the number of seconds into the video to start at.
o Added end parameter to the bbcodess, specifying the number of seconds into the video to stop at.
o Added controls parameter to the bbcodes.  0, no, off, hide and false are supported.
o Added showinfo parameter to the bbcodes.  0, no, off, hide and false are supported.
o Added privacy parameter to the bbcodes.  1, yes, on and true are supported.
o http://www.youtube-nocookie.com is used in privacy mode, as supported by YouTube.




EDIT: I can't update the first post of this thread, so look at the mod description here (http://custom.simplemachines.org/mods/index.php?mod=3982) for the latest information on the mod.  Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 19, 2015, 07:13:28 PM
Uploaded v2.1 - February 19th, 2015
o Readded code segment from v1.8 that dealt with "method of last resort" video ID.

@Everybody: I got a bug report via PM that some forms of the YouTube video URLs aren't being picked up like they were with the new code introduced by v1.8 (which was removed from v2.0).  That code has been reintroduced into v2.1.  I apologize about this issue!  Thank you for understanding....
Title: Re: Yet Another YouTube BBCode Tag
Post by: karavan2 on February 20, 2015, 02:08:13 AM
Excellent, thank you, both available versions (1.8 and 2.1) are installed correctly and work perfectly.
Title: Re: Yet Another YouTube BBCode Tag
Post by: akbora on February 20, 2015, 03:14:33 PM
This program has made the revolution about Youtube videos. Spectacular and amazing features thanks.

I want only ask a question  how can we use the <iframe>codes with this mod?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 20, 2015, 04:55:00 PM
Quote from: akbora on February 20, 2015, 03:14:33 PM
how can we use the <iframe>codes with this mod?
When the statement was made that the mod now displays the videos using an iframe, it isn't something that the user actually has to worry about using.  The mod was using <object> and <embed> in the v1.x series, but everything I could find on the net said nothing about using playlists with <object> and <embed>....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on February 20, 2015, 06:56:45 PM
I have 1.8 installed.  I tried to install 2.1 and it is failing on the '<img>' to '<img><iframe>' part twice in the post.php file.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 22, 2015, 07:26:17 PM
@Rk2910:  I apologize about the lateness of my reply.  You will probably have make a manual edit, as another mod has probably changed those lines of code.  For example, if the line contains <img><object><embed>, you would just add <iframe> to that statement.  I could probably find the area of code to change if you attach your Sources/Post.php file, however, it will probably be about 24 hours later that I'll be able to return it to you because I just worked 12 hours and am expecting to work 12 hour shifts for a while....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on February 23, 2015, 05:41:16 AM
Here ya go Doug.  No hurry, whenever you get a chance.
Title: Re: Yet Another YouTube BBCode Tag
Post by: akbora on February 23, 2015, 10:51:33 AM
same, I've got two <img><iframe>. but  I installed while error. this better be corrected,
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 23, 2015, 07:32:03 PM
Quote from: Rk2910 on February 20, 2015, 06:56:45 PM
I have 1.8 installed.  I tried to install 2.1 and it is failing on the '<img>' to '<img><iframe>' part twice in the post.php file.
Attached is the modified Post.php file for you.  You have another mod installed that makes changes to the same lines as my mod.  This should work for ya....

Quote from: akbora on February 23, 2015, 10:51:33 AM
same, I've got two <img><iframe>. but  I installed while error. this better be corrected,
I'm going to ASSUME that you are ASKING for assistance and not DEMANDING this issue be corrected, even though it sure doesn't sound like a request for assistance.....  If this is the case, attach your Sources/Post.php file and I'll modify it for you.
Title: Re: Yet Another YouTube BBCode Tag
Post by: akbora on February 23, 2015, 08:02:53 PM
Here you are post.php thanks
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 24, 2015, 04:00:50 AM
@akbora: Your Post.php is already good to go for this mod.  No further modification is needed.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on February 24, 2015, 05:38:50 AM
Quote from: dougiefresh on February 23, 2015, 07:32:03 PM
Quote from: Rk2910 on February 20, 2015, 06:56:45 PM
I have 1.8 installed.  I tried to install 2.1 and it is failing on the '<img>' to '<img><iframe>' part twice in the post.php file.
Attached is the modified Post.php file for you.  You have another mod installed that makes changes to the same lines as my mod.  This should work for ya....

Thanks Doug.  I did not complete the install due to the errors.  Should I install and then copy this file in?
Title: Re: Yet Another YouTube BBCode Tag
Post by: NekoJonez on February 24, 2015, 01:56:54 PM
So do I need to install 1.8 and 2.1?
Title: Re: Yet Another YouTube BBCode Tag
Post by: karavan2 on February 24, 2015, 02:52:37 PM
No, it is necessary to choose one of them. For simple use the youtube is enough version 1.8
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 25, 2015, 04:19:01 AM
@Rk2910:  You are correct.  Just complete the install, then copy the new file into your installation, and it SHOULD work.

@NekoJones:  karavan2 is correct.  Version 2.1 has more features, version 1.8 supports only videos.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Rk2910 on February 25, 2015, 05:09:51 AM
I guess I should have asked this also - should I uninstall 1.8 or install over it?  Will installing over it leave both versions installed? I uninstalled the previous version before installing 1.8.
Title: Re: Yet Another YouTube BBCode Tag
Post by: karavan2 on February 25, 2015, 05:35:48 AM
Before you install a higher version, previous to remove. At the same time should be set only one version.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on April 06, 2015, 05:14:47 PM
Uploaded v2.2 - April 6th, 2015
o Updated for SMF 2.1 Beta 1
Title: Re: Yet Another YouTube BBCode Tag
Post by: MastoDon on April 13, 2015, 10:40:40 PM
Has this been tested on mobile devices? I'm running a fresh install of SMF 2.0.9 and added this, videos work wonderfully on desktop but results in a blank post on my mobile devices. This affects default theme and modded themes.

Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on April 14, 2015, 07:30:14 PM
No, I didn't test on a mobile device prior to releasing this mod.  Today, I did use the FireFox app on my Samsung Galaxy S3 to browse my forum at http://www.xptsp.com to look at the few videos that are posted on my forum.  They did show up, even though they didn't play.  Strangely, they didn't play on my desktop version, either....

That having been said, can you send me a link so that I can try using my cellphone?  Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Walks Tall on April 30, 2015, 02:39:42 PM
With 2.1 Beta1 the BBCode posting icon image is not visible in the editor.

I checked using firebug and I see that a message is there saying failed to open the image file but if I navigate to the image files address it is there.

I have tried finding how to edit this to try to remedy it myself but cannot seem to find it in the css files any where.

Could I be a terrible nuisance and ask you to see if you can verify this on your test site please, thank you so very much for your time and patience.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 01, 2015, 10:44:11 AM
DOH!!  Verified this bug report!  I dug into the Sources/Subs-Editor.php and found that it's not referring to .gif files anymore, but .png files for bbcodes integrated via hooks.  I'll make the necessary corrections and upload the new version....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 01, 2015, 08:51:02 PM
Uploaded v2.3 - May 1st, 2015
o Fixed missing BBCode button in editor for SMF 2.1 Beta 1.
o Fixed a bug where using YouTube ID instead of URL showed error message.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Walks Tall on May 02, 2015, 04:22:44 AM
I must be doing something wrong chap, still not showing using the default style..

It's looking for the right image but still failing to load it, the image is there on the server where it is supposed to be..

For some odd reason the code for the youtube BBCode doesn't look right when checking with firebug, I have no idea what it's telling me so I took a screenshot so you can see what I am talking about.

Attachment 1 shows the image failed
Attachment 2 shows the code not looking right

What could I be doing wrong, any ideas chap!?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 02, 2015, 04:42:31 PM
Have you tried a forced reload using CTRL-F5?  It may be that the image is cached by the browser and the browser isn't picking up on the fact that the image may have changed.....  Happens plenty of times with CSS files....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Walks Tall on May 03, 2015, 02:57:20 AM
Quote from: dougiefresh on May 02, 2015, 04:42:31 PM
Have you tried a forced reload using CTRL-F5?  It may be that the image is cached by the browser and the browser isn't picking up on the fact that the image may have changed.....  Happens plenty of times with CSS files....

I have tried that, I have also tried uninstalling and re-installing 3 times now but to no avail, I am still seeing the same thing through firebug where the code for the youtube BBCode isn't 'active' for lack of a better term. All the other BBCode code are dark but the youtube BBCode is grey, not entirely sure what that means.
Title: Re: Yet Another YouTube BBCode Tag
Post by: savicmi on May 04, 2015, 07:00:56 PM
Does this mod support playlists? According to the description of the mod, it seems to support this, but if I insert a link in the following way

https://www.youtube.com/watch?v=OPf0YbXqDm0&list=PL55713C70BA91BD6E

it will display only one video, not playlist.

Also, full screen button is there, in the lower right corner of the player, but it's not clickable and can not be open full-screen video. How to fix it?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Walks Tall on May 07, 2015, 03:28:46 AM
Quote from: Stogie Dog on May 03, 2015, 02:57:20 AM
Quote from: dougiefresh on May 02, 2015, 04:42:31 PM
Have you tried a forced reload using CTRL-F5?  It may be that the image is cached by the browser and the browser isn't picking up on the fact that the image may have changed.....  Happens plenty of times with CSS files....

I have tried that, I have also tried uninstalling and re-installing 3 times now but to no avail, I am still seeing the same thing through firebug where the code for the youtube BBCode isn't 'active' for lack of a better term. All the other BBCode code are dark but the youtube BBCode is grey, not entirely sure what that means.

Found the problem, oddly the image float bbcode mod was disrupting things, I uninstalled the image float mod and the youtube button shows now then re-installed the image float mod and they show again and the youtube button is there also.

No idea why it should be so but with the float image mod already installed there were problems for this mod but installed the other way around all was well.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 08, 2015, 07:51:01 AM
That is really weird....  There shouldn't be anything between the mods that should interfere with each other.  I'll look into the issue....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Walks Tall on May 11, 2015, 05:16:24 AM
Quote from: dougiefresh on May 08, 2015, 07:51:01 AM
That is really weird....  There shouldn't be anything between the mods that should interfere with each other.  I'll look into the issue....

Hmmm, it 'seems' to be browser specific Dougie, haven't had time to look into this properly just yet but there seems to be no problem using Google Chrome but the problem persists through FF, not entirely sure what is going on there but when I have time to investigate further I shall be sure to let you know what I find.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sapozhnik on May 12, 2015, 12:25:17 AM
Quote from: dougiefresh on April 14, 2015, 07:30:14 PM
No, I didn't test on a mobile device prior to releasing this mod.  Today, I did use the FireFox app on my Samsung Galaxy S3 to browse my forum at http://www.xptsp.com to look at the few videos that are posted on my forum.  They did show up, even though they didn't play.  Strangely, they didn't play on my desktop version, either....

That having been said, can you send me a link so that I can try using my cellphone?  Thanks!
Hello!

Check video from this link by mobile device: http://new-aveo.com.ua/index.php?topic=484.msg25180#msg25180
I use Chrome and have some problems. When I open page, browser tries to download different files with name of videos and swf extentions. I don't have any problem when I use PC
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sapozhnik on May 12, 2015, 05:48:01 AM
Can't update my last post.

Problem with /v/ in code:
<iframe class="youtube-player" type="text/html" width="640" height="400" src="http://www.youtube.com/v/sKd9VqxrC8I" allowfullscreen frameborder="0"></iframe>
When I change /v/ on /embed/ all works good and I don't have problem on mobile and tab.
<iframe class="youtube-player" type="text/html" width="640" height="400" src="http://www.youtube.com/embed/sKd9VqxrC8I" allowfullscreen frameborder="0"></iframe>

Now I've inserted string str_replace () in the build html string code:
// Build the HTML string that we are going to display to the user:
$data = str_replace("/v/", "/embed/", $data);
$data = '<iframe class="youtube-player" type="text/html" width="' . $width . '" height="' . $height . '" src="' . $data . '" allowfullscreen frameborder="0"></iframe>';
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 12, 2015, 06:12:04 PM
Uploaded v2.4 - April 12th, 2015
o Fixed YouTube URLs used for mobile devices.

@Sapozhnik:  If desired, you should be able to replace the Subs-BBCode-YouTube.php file with the fixed file from the new version....  Thanks for finding the solution, Sapozhnik!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sapozhnik on May 13, 2015, 02:27:15 AM
Quote from: dougiefresh on May 12, 2015, 06:12:04 PM
Uploaded v2.4 - April 12th, 2015
o Fixed YouTube URLs used for mobile devices.

@Sapozhnik:  If desired, you should be able to replace the Subs-BBCode-YouTube.php file with the fixed file from the new version....  Thanks for finding the solution, Sapozhnik!
Doesn't work in both versions (pc+mobile) :(
Look link: example (http://speech-power.info/index.php?topic=24655.msg41819#msg41819)

You inserted 'embed' twice  (original link: http://www.youtube.com/watch?v=Hu3LdtU9-l4):
<iframe class="youtube-player" type="text/html" width="640" height="400" src="http://www.youtube.com/embed/embed/Hu3LdtU9-l4" allowfullscreen frameborder="0"></iframe>
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on May 13, 2015, 03:03:06 AM
Hello!

Installed this a few days ago and it works great!

Only problem I've found: in Firefox (37, 38 at least) if you press the BB button without having selected any text, it only inserts the opening tag...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 13, 2015, 04:56:08 PM
Uploaded v2.5 - April 13th, 2015
o Fixed mistake introduced in v2.4 regarding YouTube links.

Quote from: Sapozhnik on May 13, 2015, 02:27:15 AM
You inserted 'embed' twice  (original link: http://www.youtube.com/watch?v=Hu3LdtU9-l4):
@Sapozhnik:  WHOOPS!!!  Damn, I can't believe I missed that....  This update fixes this problem...

Quote from: Gryzor on May 13, 2015, 03:03:06 AM
Only problem I've found: in Firefox (37, 38 at least) if you press the BB button without having selected any text, it only inserts the opening tag...
@Gryzor:  I can't reproduce this report.  On a clean forum copy, the YouTube button inserts the tags just fine....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sapozhnik on May 14, 2015, 12:27:53 AM
Quote from: dougiefresh on May 13, 2015, 04:56:08 PM
Uploaded v2.5 - April 13th, 2015
o Fixed mistake introduced in v2.4 regarding YouTube links.

@Sapozhnik:  WHOOPS!!!  Damn, I can't believe I missed that....  This update fixes this problem...
Thanks. It works good!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on May 14, 2015, 02:08:09 AM
Quote from: dougiefresh on May 13, 2015, 04:56:08 PM
@Gryzor:  I can't reproduce this report.  On a clean forum copy, the YouTube button inserts the tags just fine....

Thanks mate, might be something else on my forum. It's just weird that it works ok on other browsers :D
Title: Re: Yet Another YouTube BBCode Tag
Post by: JaGuR on June 20, 2015, 01:25:47 AM
Quote from: dougiefresh on May 13, 2015, 04:56:08 PM
Uploaded v2.5 - April 13th, 2015
o Fixed mistake introduced in v2.4 regarding YouTube links.

Quote from: Sapozhnik on May 13, 2015, 02:27:15 AM
You inserted 'embed' twice  (original link: http://www.youtube.com/watch?v=Hu3LdtU9-l4):
@Sapozhnik:  WHOOPS!!!  Damn, I can't believe I missed that....  This update fixes this problem...

Quote from: Gryzor on May 13, 2015, 03:03:06 AM
Only problem I've found: in Firefox (37, 38 at least) if you press the BB button without having selected any text, it only inserts the opening tag...
@Gryzor:  I can't reproduce this report.  On a clean forum copy, the YouTube button inserts the tags just fine....

I was having the same issue, seems to have something to do with the "toggle view" button in the wysiwig editor :(

Spent about two hours trying to figure out why the custom bbcode mod wasn't working properly, had the same issue of not closing the tags.

When I saw your post after installing the youtube mod, I realised I had been playing the the toggle view button, not knowing what it actually did.

seems it stuffs the bbcode buttons :(
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on June 20, 2015, 02:27:47 AM
Hm, good to know...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 18, 2015, 07:56:05 AM
Uploaded v3.0 - July 17th, 2015
o CrescentEclipse added responsive video display elements to this mod.  Thanks, CrescentEclipse!
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.
o Modified "start" and "end" parameters to use "minutes:seconds" format in addition to "seconds".

Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 30, 2015, 05:45:40 PM
UPDATE: Yesterday, I was notified of a potentially "fatal flaw" in SMF's bbcode parser function.  The parser generates an array with all possible permutations of the parameters, and thus can run out of memory when dealing with a bbcode tag with a large number of parameters.  I've solved this problem in my Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod, and I'm going to attempt to solve it for this mod as well....  It's a little more complicated because of the "alt" parameter in the mess of things....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 01, 2015, 03:22:25 PM
Uploaded v3.1 - August 1st, 2015
o Performance increase due to modification of parse_bbc function to deal with memory issue found.
Title: Re: Yet Another YouTube BBCode Tag
Post by: spijker46 on August 04, 2015, 02:49:05 AM
First of all, I'd like to compliment you with the hard work you provide. Well done!

Now my question . I use the plugin on my website where I find it very annoying that use videos 100 % of the available space . Now I understand that this is manually updated by specifying the height and width. Only then Tapatalk not understand this and let the videos do not see anymore.

Is there a possibility , from the code itself to adjust it manually, and if so , where should I look for it in that case?

I'm curious about your reaction .

Keep up the good work!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 04, 2015, 03:55:55 AM
Use something like this:
[youtube width=640 width=480]{url goes here}[/youtube]
That SHOULD (and hopefully) solves your problem.
Title: Re: Yet Another YouTube BBCode Tag
Post by: spijker46 on August 04, 2015, 04:14:18 AM
Do you mean I should change that here:

function BBCode_YouTube_Button(&$buttons)
{
        global $txt;

        $buttons[count($buttons) - 1][] = array(
                'image' => 'youtube',
                'code' => 'youtube',
                'description' => $txt['youtube'],
                'before' => '[youtube]',
                'after' => '[/youtube]',
        );
}


Or should I change it somewhere else in the code?

The above part I allready tried. It does work, but the output in the messages will be something like you recommend: [youtube width=640 width=480]{url goes here}[/youtube]
In my forum, you see the vids at width: 640 and height: 480, but in Tapatalk you still see: [youtube width=640 width=480]{url goes here}[/youtube] ;)

What I am looking for is to show in the messages on my forum:
whereby in the code somewhere the 100% is changed to : [youtube width=640 width=480]{url goes here}[/youtube]

I hope you do understand me :-)
Title: Re: Yet Another YouTube BBCode Tag
Post by: spijker46 on August 04, 2015, 04:19:05 AM
What I mean to say , I would like the default which is now at 100% of the code , want to put on a default of 640/480 .
In the message on the forum should be thus shown: [ youtube] { url} [/ youtube] Tapatalk so that it can handle . :-)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 04, 2015, 04:24:34 AM
Oh, I understand what you are asking now.  In Subs-BBCode-YouTube.php, you should change this:
Code (Find) Select
'before' => '[youtube]',
to this:
Code (Replace) Select
'before' => '[youtube width=640 height=480]',
Hopefully, that'll do what you need....
Title: Re: Yet Another YouTube BBCode Tag
Post by: spijker46 on August 04, 2015, 04:32:07 AM
Quote from: dougiefresh on August 04, 2015, 04:24:34 AM
Oh, I understand what you are asking now.  In Subs-BBCode-YouTube.php, you should change this:
Code (Find) Select
'before' => '[youtube]',
to this:
Code (Replace) Select
'before' => '[youtube width=640 height=480]',
Hopefully, that'll do what you need....

Thanks for the reply. I have tried to change that, but it didn't work out for me. In the forum in my browser on the PC it does work now, but in Tapatalk it still doesn't.

But!!!

I have looked further in the code of Subs-BBCode-YouTube.php and I found the next setting:


        // Set width or height with respect to aspect ratio if just one is set.  Set both if neither:
        if (!isset($context['bbc_youtube']['width']) && isset($context['bbc_youtube']['height']))
                $context['bbc_youtube']['width'] = floor($context['bbc_youtube']['height'] * 1.6);
        elseif (isset($context['bbc_youtube']['width']) && !isset($context['bbc_youtube']['height']))
                $context['bbc_youtube']['height'] = floor($context['bbc_youtube']['width'] * 0.625);
        $width = (isset($context['bbc_youtube']['width']) ? $context['bbc_youtube']['width'] : 0);
        $height = (isset($context['bbc_youtube']['height']) ? $context['bbc_youtube']['height'] : 0);


Whereby I changed the last two lines into:


        $width = (isset($context['bbc_youtube']['width']) ? $context['bbc_youtube']['width'] : 640);
        $height = (isset($context['bbc_youtube']['height']) ? $context['bbc_youtube']['height'] : 480);


And now it does work! :-) Thanks for thinking and pointing me to the right direction.

-edit-
The problem with Tapatalk (app for android/iphone); it does understand code like:
[youtube]{ur}[/youtube]
but it doesnt understand code like:
[youtube width=640 height=480]{ur}[/youtube]

Now with the change I made, the mainly code still remains:
[youtube]{ur}[/youtube]
so Tapatalk still understands :)


Like I said before, keep up the good work! :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 08, 2015, 12:27:12 PM
Uploaded v3.2 - August 8th, 2015
o Removed support for SMF 2.1 Beta 1
o Added support for SMF 2.1 Beta 2
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 11, 2015, 02:32:37 AM
This is an awesome mod, however for some reason some videos lately have started appearing huge.

Since my users probably won't go to any lengths to set the height and width of the video manually, could there be a setting for the default size? Supposedly the default is 640x480 but it doesn't always work...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 11, 2015, 07:38:47 PM
I can do one of two things.  I can make the mod respect the maximum image size specified in the admin area, or make a completely new setting under Modifications for this new setting.  The first option would be easiest, but the second wouldn't be much more difficult....  Any opinions?

Btw, I still have to work through Thursday, and my wife and I have stuff planned for Friday.  My computer is also getting repaired this weekend (Fri/Sat), so it may not be "fixed" this week....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 12, 2015, 02:28:26 AM
Hello mate,

Thanks for getting back.

Having a separate setting would be much preferred; on my forum, for instance, we discuss hardware so sometimes we post large photos (large zoom factors) of boards, components etc, so the same limit for photos and videos would not be practical.

But that's my 2 cents. Do take your time :) I can maybe roll back for the time being!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 12, 2015, 04:01:33 PM
Uploaded v3.3 - August 12th, 2015
o Added settings to allow admin to set default size of the YouTube video.
o Altered code to use new default size settings when width and/or height isn't specified.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 13, 2015, 02:44:46 AM
Oh man, you rule! Just installed, did a test, worked perfectly. Thanks so much :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 21, 2015, 05:29:18 AM
I think YT may have changed something. Now, most (if not all?) my videos have a "! No longer available" beneath them... the vids show fine though.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 21, 2015, 09:01:14 AM
Quote from: Gryzor on August 21, 2015, 05:29:18 AM
I think YT may have changed something. Now, most (if not all?) my videos have a "! No longer available" beneath them... the vids show fine though.
Link, please!  I just looked at my localhost forum with this mod installed and am not seeing that message....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 26, 2015, 04:27:37 AM
Nah, Aeva was probably messing it up, I think it's fine after I removed it... thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 27, 2015, 03:19:07 PM
Quote from: Gryzor on August 26, 2015, 04:27:37 AM
Nah, Aeva was probably messing it up, I think it's fine after I removed it... thanks!
Good to know!!  Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 28, 2015, 03:04:42 AM
My pleasure man, thanks for your great work!
Title: Re: Yet Another YouTube BBCode Tag
Post by: firepatriot on September 03, 2015, 08:37:46 PM
hey love the code. and it looks great.  wondering something?     the line        $orders = permute($preg);  no longer exists in 2.1 beta 2 so i dont know where to put the code.
  im uploading my subs.php file for your to look at if you want.
trying to figure it out on my own but if someone could help me would love your forever
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 04, 2015, 07:47:35 AM
In the nightly version found on GitHub, the SMF team has reworked that section of the parse_bbc function so that it no longer needs the permute function, instead relying on a complete different implementation to address the issue brought up in the REPORT: Potentially "Fatal Flaw" in SMF's bbcode parser (http://www.simplemachines.org/community/index.php?topic=538611.0) thread.....  In the next few days, I will release an update that will make that particular operation optional....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on September 04, 2015, 12:44:07 PM
Ah, I had read that and I think I have understood most of it :D

Hopefully the fix won't break support for older versions...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 04, 2015, 01:22:20 PM
Making this change won't break support for SMF 2.0.x and SMF 2.1 Betas 1 and 2 from the SMF website.  It'll just make it so that the operation is ignored if the operation isn't found.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Geor'G on September 04, 2015, 04:26:31 PM
Quote from: dougiefresh on September 04, 2015, 07:47:35 AM
In the nightly version found on GitHub, the SMF team has reworked that section of the parse_bbc function so that it no longer needs the permute function, instead relying on a complete different implementation to address the issue brought up in the REPORT: Potentially "Fatal Flaw" in SMF's bbcode parser (http://www.simplemachines.org/community/index.php?topic=538611.0) thread.....  In the next few days, I will release an update that will make that particular operation optional....
This mode is the same?
http://custom.simplemachines.org/mods/index.php?mod=4069
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 04, 2015, 06:51:02 PM
The solution that my mods with too many parameters has is to rearrange the parameters so that they are in the proper order before it gets checked for validity.  The mod you referenced (v1.x) does essentially the same thing for all bbcodes, however, my mod suffers from several different issues that may break the expected output of the parser.  SMF 2.1 Beta 2 Nightly's solution, while different than mine, solves many of the problems that I have not been able to figure out before being notified of the nightly's code change.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 04, 2015, 08:38:02 PM
Uploaded v3.4 - August 21st, 2015
o Fixed issue where necessary tag cannot be added if other mods have modified same lines.
o Rewrote the "fix parameter order" function to be called only when necessary.
o Operation that calls "fix parameter order" function now skipped for nightly SMF 2.1 Beta 2.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dreep on September 21, 2015, 04:19:55 AM
Hi,

I have installed this mod on my forum, but when i post a link with, i have that :

Can you help me ?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 03, 2015, 10:28:41 AM
@dreep:  I apologize about getting back to you so late.  I've been working multiple mandatory 12+ shifts over the last 2 weeks and haven't had time or energy to do much.

Quote from: dreep on September 21, 2015, 04:19:55 AM
I have installed this mod on my forum, but when i post a link with, i have that :
I need an actual link to work with, so if I can duplicate it, I can see for myself what is happening....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dreep on October 09, 2015, 05:49:37 AM
Quote from: dougiefresh on October 03, 2015, 10:28:41 AM
@dreep:  I apologize about getting back to you so late.  I've been working multiple mandatory 12+ shifts over the last 2 weeks and haven't had time or energy to do much.

Quote from: dreep on September 21, 2015, 04:19:55 AM
I have installed this mod on my forum, but when i post a link with, i have that :
I need an actual link to work with, so if I can duplicate it, I can see for myself what is happening....

no pb for time...
this is youtube link i try to insert in my example : https://youtu.be/ou1VO6yM3Xc
Title: Re: Yet Another YouTube BBCode Tag
Post by: PaulKet on November 04, 2015, 07:44:27 AM
First, thank you for this mod.

I'm using 2.1 beta 2 and can't get the size of the videos to change no matter what I do, they are all being shown at 300 by 150 pixels, adding to the default settings in my ACP does nothing and adjusting [youtube width=x height=y] to [youtube width=560 height=315] does nothing either. Is this just a problem with 2.1 beta 2 or am I overlooking something?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on November 04, 2015, 05:20:23 PM
Uploaded v3.5 - November 4th, 2015
o SMF 2.1: Fixed BBCode-YouTube.css install location.




@PaulKet: Thank you for the bug report.  It's been fixed.

@dreep:  I apologize about the lateness of this reply.  I tested the link that you sent and I am not seeing the result you are seeing.  Can you post a link with the YouTube URL being used so that I can see if I can track down the cause of this issue?  Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: natcip on November 15, 2015, 11:36:16 AM
For some reason the align-tags get ignored.

[center][youtube]https://www.youtube.com/watch?v=q8eHo5QHlTA[/youtube][/center]

The video is embedded and works fine but it's not centered. :-\

I have Version 3.5 installed.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on November 15, 2015, 12:35:25 PM
I just used the code provided and it was properly centered within the post area. Unless you change the maximum width in the Modification Settings, the default size is to take up the entire post area.   I had set a maximum width of 640 in the Modification Settings area so that it doesn't take up the entire post area. 

To specify a width on a post-by-post basis, use this form:
[center][youtube width=640]https://www.youtube.com/watch?v=q8eHo5QHlTA[/youtube][/center]

Hope this helps you.
Title: Re: Yet Another YouTube BBCode Tag
Post by: natcip on November 15, 2015, 01:38:50 PM
Whoops my bad, I didn't see the Modification Settings. I changed the width in the BBCode-YouTube.css file. I guess that's why the align didn't work.
Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on November 18, 2015, 07:12:22 PM
 O:) Yeah, the stuff in the BBCode-YouTube.css is to make the video stuff responsive to the post area size.  It shouldn't be messed with.  ;D
Title: Re: Yet Another YouTube BBCode Tag
Post by: PavelK on November 27, 2015, 11:12:07 AM
Very good mod, better than others.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on November 30, 2015, 07:57:53 PM
Uploaded v3.6 - November 30th, 2015
o Added auto-embed for YouTube URLs.
Title: Re: Yet Another YouTube BBCode Tag
Post by: BeatsMe on December 07, 2015, 10:50:52 PM
Sorry if this has already been stated, too many pages to go through in three of your mods.

I have been experimenting with three of your mods, this one plus the Facebook and the Instagram one, on a test copy of my forum.  Well I have found that I am getting "Test Fail" errors when attempting to uninstall them.

Then I noticed that you have to uninstall them in the correct order so you don't get any errors... I think in the reverse order that they were installed does work.

Is this an expected behaviour with your mods ???
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 08, 2015, 03:56:36 AM
Quote from: BeatsMe on December 07, 2015, 10:50:52 PM
Sorry if this has already been stated, too many pages to go through in three of your mods.

I have been experimenting with three of your mods, this one plus the Facebook and the Instagram one, on a test copy of my forum.  Well I have found that I am getting "Test Fail" errors when attempting to uninstall them.

Then I noticed that you have to uninstall them in the correct order so you don't get any errors... I think in the reverse order that they were installed does work.

Is this an expected behaviour with your mods ???
No problem.  My mods are written to co-exist and install nicely together, not only with my other mods but with other people's mods....  This "behaviour" you mentioned is an unfortunate side-effect of installing any kind of mods that modify the same area of code.  Each of the three mods modify a specific line in the bbcode parser so that when you use ONLY the bbcode tag with a URL in a post, it doesn't report an empty message....
Title: Re: Yet Another YouTube BBCode Tag
Post by: BeatsMe on December 11, 2015, 05:27:27 PM
Quote from: dougiefresh on December 08, 2015, 03:56:36 AM
Quote from: BeatsMe on December 07, 2015, 10:50:52 PM
Sorry if this has already been stated, too many pages to go through in three of your mods.

I have been experimenting with three of your mods, this one plus the Facebook and the Instagram one, on a test copy of my forum.  Well I have found that I am getting "Test Fail" errors when attempting to uninstall them.

Then I noticed that you have to uninstall them in the correct order so you don't get any errors... I think in the reverse order that they were installed does work.

Is this an expected behaviour with your mods ???
No problem.  My mods are written to co-exist and install nicely together, not only with my other mods but with other people's mods....  This "behaviour" you mentioned is an unfortunate side-effect of installing any kind of mods that modify the same area of code.  Each of the three mods modify a specific line in the bbcode parser so that when you use ONLY the bbcode tag with a URL in a post, it doesn't report an empty message....

Sorry if i was a little too direct with my post.... i just hate having to manually remove mods that will no longer uninstall, as i have to with another mod, not one of yours.

Your mods that i have tested seem to be working well, looking to switch to yours as the other embedding mod just doesn't seem to be working with FB links for me. I guess it's no big deal if your mods need to be uninstalled in a particular order.

Anyway, great work mate  :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 11, 2015, 07:55:28 PM
Quote from: BeatsMe on December 11, 2015, 05:27:27 PM
Sorry if i was a little too direct with my post.... i just hate having to manually remove mods that will no longer uninstall, as i have to with another mod, not one of yours.

Your mods that i have tested seem to be working well, looking to switch to yours as the other embedding mod just doesn't seem to be working with FB links for me. I guess it's no big deal if your mods need to be uninstalled in a particular order.

Anyway, great work mate  :)
Thanks!  Regarding manual installs: Believe me, I do understand!  I personally have 167 mods installed on my forum at XPtsp.com (http://www.xptsp.com)....  One mod that really helps me is the Sortable Packages (and Installed Times) (http://custom.simplemachines.org/mods/index.php?mod=2323) mod.  You can list your mods by name or install date and is a BIG help, especially when you need to figure out which mod to uninstall first.... :-p
Title: Re: Yet Another YouTube BBCode Tag
Post by: BeatsMe on December 11, 2015, 08:47:12 PM
Quote from: dougiefresh on December 11, 2015, 07:55:28 PM
Quote from: BeatsMe on December 11, 2015, 05:27:27 PM
Sorry if i was a little too direct with my post.... i just hate having to manually remove mods that will no longer uninstall, as i have to with another mod, not one of yours.

Your mods that i have tested seem to be working well, looking to switch to yours as the other embedding mod just doesn't seem to be working with FB links for me. I guess it's no big deal if your mods need to be uninstalled in a particular order.

Anyway, great work mate  :)
Thanks!  Regarding manual installs: Believe me, I do understand!  I personally have 167 mods installed on my forum at XPtsp.com (http://www.xptsp.com)....  One mod that really helps me is the Sortable Packages (and Installed Times) (http://custom.simplemachines.org/mods/index.php?mod=2323) mod.  You can list your mods by name or install date and is a BIG help, especially when you need to figure out which mod to uninstall first.... :-p

Hey didn't know about that one, will look into it for sure.... thanks for the tip.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dermot on January 22, 2016, 10:58:29 PM
will this mod get support for the new playlist urls?

eg: https://www.youtube.com/embed/videoseries?list=PLquckZj9TVRFKWqM6LJI4a_dgvN48jZGk

eg: https://www.youtube.com/watch?v=Ni4ZclaiOtY&list=PLquckZj9TVRFKWqM6LJI4a_dgvN48jZGk
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 23, 2016, 09:49:14 AM
Uploaded v3.7 - January 23rd, 2015
o Added support for the new YouTube video playlist URLs.
o Changed regular expression to make sure "?list=", "&list=", "?v=" and "&v=" are found first.




@Dermot: Oh boy, those regular expressions were a b#$@h to modify to support those URLs!!!!  Anyways, the mod has been updated to support those YouTube URLs.  Thanks for the request!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dermot on January 23, 2016, 02:58:00 PM
Quote from: dougiefresh on January 23, 2016, 09:49:14 AM
Uploaded v3.7 - January 23rd, 2015
o Added support for the new YouTube video playlist URLs.
o Changed regular expression to make sure "?list=", "&list=", "?v=" and "&v=" are found first.




@Dermot: Oh boy, those regular expressions were a b#$@h to modify to support those URLs!!!!  Anyways, the mod has been updated to support those YouTube URLs.  Thanks for the request!

Thanks for the prompt update, will check out the new build when i get home from work.

Yeah i'd say they were a regex nightmare, they don't seem to be a static number of characters either.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 23, 2016, 03:45:20 PM
The new playlist ID format looks like it's a 23 character string, followed by an underscore, then another 10 character string, with no spaces in between.  It differs from the 18 character string that I had found.  If there are other formats, please let me know so I can adjust the mod to attempt to properly recognize the various formats!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dermot on January 23, 2016, 05:35:11 PM

Seems the list id is always 34 characters, while the start video id's are 11 which include underscores and dashes and characters can occur more than once.

Playlist ids seem to all start with PL also

some other examples


https://www.youtube.com/embed/fRh_vgS2dFE?list=PLx0sYbCqOb8Q_CLZC2BdBSKEEB59BOPUM

https://www.youtube.com/embed/oyEuk8j8imI?list=PLywWGW4ILrvpqqkgKRV8jpZMaUPohQipP

https://www.youtube.com/watch?v=09R8_2nJtjg&list=PL3VywZ6q4-UvA4PM2V-tbOdnUsmj-HLqE

https://www.youtube.com/watch?v=0KSOMA3QBU0&list=PLMC9KNkIncKtPzgY-5rmhvj7fax8fdxoj


If i come across any other variations, I'll let you know.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dermot on January 23, 2016, 06:04:36 PM
speaking of regexp, perhaps this will help?


(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((?:\w|-|_){11})(?:(?:\?|\&)index=((?:\d){1,3}))?(?:(?:\?|\&)list=((?:\w|-|_){34}))?(?:\S+)?

or

(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+(?:&|&#38;);v=))((?:\w|-|_){11})(?:(?:\?|&|&#38;)index=((?:\d){1,3}))?(?:(?:\?|&|&#38;)list=((?:\w|-|_){34}))?(?:\S+)?


offers index support also to the playlist url like below

https://www.youtube.com/watch?v=OPf0YbXqDm0&index=3&list=PLRBqtmUVTq9rAXBf4-j2UxDkvqt66XJP5

Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 23, 2016, 07:11:49 PM
Uploaded v3.8 - January 23rd, 2016
o Modified new YouTube video playlist URLs support for better coverage.




Okay, I modified the code so that it recognizes any 34-character string that starts with a "PL" as the video playlist ID OR the 18-character string that was used as the video playlist ID....  The 34 character string is examined using a "PL[\w-]{32}" regex expression, so it should pick up on them regardless of where they drop the "-" in the ID....  Hopefully it will solve this particular problem, and yes, the new code does work with the examples given!

Regarding the "index" parameter request, I've tested with the example you gave without modifying the code and the auto-embed code already picks up on it.  I've modified the code to include the "index" parameter within the resulting HTML displayed, even though I removed it and saw no difference in the outcome....  So I'm not sure if it matters if the "index" parameter is included, but it is now anyways....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dermot on January 23, 2016, 08:01:56 PM

So i finally got to installing the new build.

Playlists working fine now, great job.

one issue i noticed was the dimensions bbcode, it seems to work fine but it looks like the css for the frame div has a position issue, it's showing over the text in the post.

like i tried [youtube width=540 height=250]W54z1hwa8yM[/youtube] and video shows over the post text, absolute/relative css issue?

Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 24, 2016, 09:18:40 AM
I duplicated your bug report with the following post:
Blegh Blegh
[youtube width=540 height=250]W54z1hwa8yM[/youtube]
Blegh Blegh

Let me investigate what's going on there....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 24, 2016, 01:07:17 PM
Uploaded v3.9 - January 24th, 2016
o Added code to make YouTube bbcode recognize content as 34-character playlist.
o Added code to force aspect ratio of width to height to be 16:9.
o Modified CSS file so that there isn't a 25px gap at the top of the video.




@Dermot: Thanks for the bug report!  There are two issues at fault for this particular bug report.  The first is that the dimensions specified weren't in a 16:9 ratio.  I've fixed this particular issue by forcing the aspect ratio into a 16:9 ratio, which is what the CSS formats the video to.  The second issue is the 25 pixel black bar above the video, which once the ratio was fixed, still caused on overlap over the text.  That issue has been taken care of, too.....
Title: Re: Yet Another YouTube BBCode Tag
Post by: SaltedWeb on February 07, 2016, 11:05:26 AM
installed fine no errors when you click on it it only puts  [youtube] nothing else.
I have no mods on the site and its running a fresh install 2.0.11 .
Removing mod for now.

Hope your surgery went well.

SW
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 07, 2016, 06:35:56 PM
Quote from: SaltedW on February 07, 2016, 11:05:26 AM
installed fine no errors when you click on it it only puts  [youtube] nothing else.
I have no mods on the site and its running a fresh install 2.0.11 .
Hmmm.... Just installed the v3.9 mod package and it works properly, putting "[youtube][/youtube]" in the post area.....  If you have another YouTube mod installed, then this mod may conflict with that other one....

Quote from: SaltedW on February 07, 2016, 11:05:26 AM
Hope your surgery went well.
Thank you very much!  Yeah, this pain in my leg is really a non-proverbial pain...  :'(
Title: Re: Yet Another YouTube BBCode Tag
Post by: SaltedWeb on February 07, 2016, 11:23:02 PM
Nope no mods what so ever actually only gives the  [youtube]
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 09, 2016, 09:26:23 PM
I had to change the editor view mode to the WYSIWYG mode, but I did manage to duplicate the bug report.  I'm not sure what I can do about this, but let me see what I can do....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 11, 2016, 03:10:49 PM
UPDATE: I'm not sure that I've been helpful, but this is what I've found.....

When you are in WYSIWYG mode in SMF 2.0.x, you must put the URL of the YouTube video you want to embed in, highlight it, then press the YouTube button.  Then it will correctly surround the YouTube URL with the YouTube tags.  I'm almost sure that this is only one of the notorious WYSIWYG bugs in the SMF 2.0.x versions.

However, just for giggles, I did test under SMF 2.1, and it seems to work correctly there, so this suggests to me that using the SCEditor4SMF (http://custom.simplemachines.org/mods/index.php?mod=3594) mod, which replaces the editor with the SCEditor code, might also solve this problem.  However, I installing that mod seems to remove any custom bbcode buttons that are added through hooks, so it may or may not be an acceptable solution to this bug report.....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on February 16, 2016, 08:00:03 AM
Hello!

We switched servers a short time ago and it seems I came upon a bug, described here: http://www.simplemachines.org/community/index.php?topic=543430.0

Basically it seems like the mod wants to chmod something outside the forum path... I didn't have this problem on my other server, but I was wondering if you have any idea? Would be more than happy to provide any info necessary! Otherwise I'll ask for some help with manual installation (I tried it and I brought the forum down :D )...

Thanks - this is probably my community's fav mod!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 16, 2016, 07:11:08 PM
Quote from: Gryzor on February 16, 2016, 08:00:03 AM
Basically it seems like the mod wants to chmod something outside the forum path... I didn't have this problem on my other server, but I was wondering if you have any idea? Would be more than happy to provide any info necessary! Otherwise I'll ask for some help with manual installation (I tried it and I brought the forum down :D )...
This mod contains no "chmod" commands, so it wouldn't be responsible for said bug....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on February 17, 2016, 02:47:52 AM
Yeah, as stated in the other thread, it's probably not the mod's fault but an arcane bug. I was just wondering if you could help out. Really, really weird...
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on February 17, 2016, 03:00:48 AM
So, I'll try to install it manually again. What I'd like to know is this:

I understand all the modifications, except for the part that says:
Quote
add_remove_hooks.php
This file should be able to execute standalone.

...what do I do with add_remove_hooks? Where is it placed, and should I call it somehow?

Thanks again!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 17, 2016, 09:18:43 AM
MANUAL INSTALL ONLY: You should place it in the forum's root folder (where the Sources and Themes folders are), then call it directly.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on February 17, 2016, 09:23:17 AM
Ah, ok. That's what I did last time and the forum disappeared, but maybe I did something wrong with the edits. Will try again! Thanks :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on March 07, 2016, 02:36:30 PM
Uploaded v3.10 - March 7th, 2016
o Modified auto-embed code so that YouTube URLs in signature are embedded as [url]{link}[/url].
o Merged English and English UTF8 language files together.
Title: Re: Yet Another YouTube BBCode Tag
Post by: izotz on April 07, 2016, 07:55:41 AM
Hi all,

I came up with the same issue that Gryzor described. When installing the mod, I am asked for the FTP account details. I click on the install mod feature, and then my server home folder gets its permissions changed from 711 to 755. For this reason the whole forum along with other sites I have there installed will return a 500 error.

I understand this mod is not necessarily the culprit, but I'm curious about what Gryzor needed to do in order to install this, as I can't afford this to happen again.

Thanks for your time.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on April 07, 2016, 08:02:23 AM
Nah... as it seems, it's a (serious, for me) issue with SMF. Look at my other posts (sorry, must leave and can't look now) and you'll see, for the time being I just did the edits manually and have given up on the entire problem until I convince my system admin to relax the server restrictions so SMF can do its job...
Title: Re: Yet Another YouTube BBCode Tag
Post by: -Rock Lee- on April 07, 2016, 10:36:17 AM
I had not seen this modification very good job @dougiefresh As usual I leave the translation to the Latin Spanish.

index.spanish_latin.php

$txt['youtube'] = "Youtube";
$txt['youtube_link_invalid'] = '[ V&iacute;nculo no v&aacute;lido YouTube ]';
$txt['youtube_no_embed'] = 'Mostrar v&iacute;deos de YouTube como un enlace.';

// Locale (strftime, pspell_new) and spelling. (pspell_new, can be left as '' normally.)


and index.spanish_latin-utf8.php

$txt['youtube'] = "Youtube";
$txt['youtube_link_invalid'] = '[ Vínculo no válido YouTube ]';
$txt['youtube_no_embed'] = 'Mostrar vídeos de YouTube como un enlace.';

// Locale (strftime, pspell_new) and spelling. (pspell_new, can be left as '' normally.)



ManageSettings.spanish_latin.php


$txt['youtube_default_width'] = 'El ancho predeterminado utilizado para YouTube BBCode cuando no se especifica <div class="smalltext">Use <strong>0</strong> para utilizar la pantalla de v&iacute;deo responsive</div>';
$txt['youtube_default_height'] = ''El alto predeterminado utilizado para YouTube BBCode cuando no se especifica<div class="smalltext">Use <strong>0</strong>para utilizar la pantalla de v&iacute;deo sensible</div>';


ManageSettings.spanish_latin-utf8.php


$txt['youtube_default_width'] = 'El ancho predeterminado utilizado para YouTube BBCode cuando no se especifica <div class="smalltext">Use <strong>0</strong> para utilizar la pantalla de vídeo responsive</div>';
$txt['youtube_default_height'] = ''El alto predeterminado utilizado para YouTube BBCode cuando no se especifica<div class="smalltext">Use <strong>0</strong>para utilizar la pantalla de vídeo sensible</div>';


Regards!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on April 07, 2016, 06:28:35 PM
Uploaded v3.11 - April 7th, 2016
o Added Spanish Latin translation by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@Rock Lee [BC]:  Thank you for the translation!  It's been included in this version!
Title: Re: Yet Another YouTube BBCode Tag
Post by: guyfriendly on April 18, 2016, 08:59:43 PM
Works good here, but the default video size is too big and covers the whole thread.  Any idea how to make them default?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on April 19, 2016, 02:44:36 AM
Quote from: guyfriendly on April 18, 2016, 08:59:43 PM
Works good here, but the default video size is too big and covers the whole thread.  Any idea how to make them default?

Go to the settings in the Admin panel, you can set the width and height there (default is 'responsive')
Title: Re: Yet Another YouTube BBCode Tag
Post by: Bruz on June 18, 2016, 01:23:43 PM
Hello!

I only can see one BBCode button. This mod have one or more?

Thank you!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on June 18, 2016, 01:34:07 PM
One, I guess, why would there be more?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Bruz on June 18, 2016, 01:42:55 PM
Quote from: Gryzor on June 18, 2016, 01:34:07 PM
One, I guess, why would there be more?

Oh, sorry, I understand wrong (my english is'nt very good  ;) )

I think that every BBCode in "Admin => Forum => Posts and Topics => Bulletin Board Code" have his own button (for yt_search etc).

Thank you!!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on June 18, 2016, 01:47:28 PM
Oh yes, I see what you mean, there are other functions too. But I guess you have to insert those manually...
Title: Re: Yet Another YouTube BBCode Tag
Post by: Bruz on June 18, 2016, 01:49:57 PM
Quote from: Gryzor on June 18, 2016, 01:47:28 PM
Oh yes, I see what you mean, there are other functions too. But I guess you have to insert those manually...

No problem! I thought that was installed wrong, but all is OK!!

Thank you very much.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on June 18, 2016, 01:50:57 PM
Actually I had forgotten it also supports other tags than the basic one until your post :D
Title: Re: Yet Another YouTube BBCode Tag
Post by: FilipEL on June 18, 2016, 02:32:08 PM
Great job, thanks so much for this mod :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Grammy on July 12, 2016, 08:25:57 AM
Quote from: Gryzor on April 19, 2016, 02:44:36 AM
Quote from: guyfriendly on April 18, 2016, 08:59:43 PM
Works good here, but the default video size is too big and covers the whole thread.  Any idea how to make them default?

Go to the settings in the Admin panel, you can set the width and height there (default is 'responsive')


Where are these settings, please?   :-\
Title: Re: Yet Another YouTube BBCode Tag
Post by: Grammy on July 12, 2016, 01:23:42 PM
Quote from: Grammy on July 12, 2016, 08:25:57 AM

Where are these settings, please?   :-\


Never mind...  I was trying to find them while on my iPhone, sitting in a doctor's office.  Not exactly optimal viewing.  I'm back now, and found them. 
Title: Re: Yet Another YouTube BBCode Tag
Post by: CiTyBlUe on August 12, 2016, 05:32:12 PM
Hi, hope you can help, we have your mod installed and it's embedding youtube vids fine but custom start and end times aren't working?

We are running on smf 2.0.11
Title: Re: Yet Another YouTube BBCode Tag
Post by: petb on August 13, 2016, 11:35:32 AM
Hello,

got no error/warning while installing at 2.0.11.

But curious,
it works as long as i am in post edit mode and preview the post.
But after saving the post i will see:
QuoteNot Found

The requested URL /
was not found on this server.
...instead of the video.

Open the post for edit again and preview it,
the video is shown and can be played :o
...saving again... only showing the error message within the post.

Hope somebody can help investigating.

Maybe it was a conflict with another mod, but i cant find out which one.
....i don't know at which specific smf file i have to look at to investigate.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 29, 2016, 10:16:52 PM
Quote from: CiTyBlUe on August 12, 2016, 05:32:12 PM
Hi, hope you can help, we have your mod installed and it's embedding youtube vids fine but custom start and end times aren't working?
I've tested both the start and end parameters to see if they work.  They work fine for me.  You can use either the numeric seconds format, for example 60 to start/end at 60 seconds into the video; or you can use the minutes:seconds format, for example 1:00...

Quote from: petb on August 13, 2016, 11:35:32 AM
Hello,

got no error/warning while installing at 2.0.11.

But curious,
it works as long as i am in post edit mode and preview the post.
But after saving the post i will see:
QuoteNot Found

The requested URL /
was not found on this server.
...instead of the video.

Open the post for edit again and preview it,
the video is shown and can be played :o
...saving again... only showing the error message within the post.

Hope somebody can help investigating.

Maybe it was a conflict with another mod, but i cant find out which one.
....i don't know at which specific smf file i have to look at to investigate.
I can't reproduce this bug report.....
Title: Re: Yet Another YouTube BBCode Tag
Post by: petb on August 30, 2016, 06:43:18 AM
Thank you for the answer.

Can you tell me the differnece between the preview in post/edit mode and the normal view?

Which php files are involved in the two different views?
Maybe i can find an issue with an other mod.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 30, 2016, 08:58:55 AM
I believe the normal posting view happens in Display.php and Display.template.php, while the Post Preview happens in Post.php and Post.template.php.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 14, 2016, 06:11:14 PM
Uploaded v4.0 - September 14th, 2016
o Added buttons for the yt_user and yt_search bbcodes.
o Added minute:second validation to start and end parameters.
Title: Re: Yet Another YouTube BBCode Tag
Post by: benf on September 15, 2016, 03:32:53 AM
Hi, i have a blank page after update of the mod and the forum is always visible but unusable. i have reinstall it manually but same problem.
website adress : frenchenigmaforum.com
smf version: 2.0.11
mod used :    Tinyportal 1.2R3
                    Ultimate menu 1.0
                    Freichat 1.0
                    Embed Facebook BBCode 3.3
                    Soundcloud BBcode 1.7
                    Voter Visibility 2.1
                    Stop Spammer 2.3.9
                    Yet Another YouTube BBCode Tag 3.11
Title: Re: Yet Another YouTube BBCode Tag
Post by: benf on September 16, 2016, 02:11:08 AM
I reinstall SMF, thanks anyway.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 16, 2016, 08:32:46 PM
@benf: Sorry, just saw your post!  I couldn't duplicate your bug report, so I'm almost sure that it isn't this mod....  However, could you share the YouTube URL that you were using?  I might be able to duplicate it if I had that....
Title: Re: Yet Another YouTube BBCode Tag
Post by: WallyM on September 21, 2016, 06:11:19 PM
Hi, does this mod support HTML 5? Will browsers that have ditched Flash, like Opera on Android, be able to display videos with this mod?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 21, 2016, 09:19:07 PM
Quote from: WallyM on September 21, 2016, 06:11:19 PM
Hi, does this mod support HTML 5? Will browsers that have ditched Flash, like Opera on Android, be able to display videos with this mod?
This mod uses an iframe to load the YouTube video URL.  This mod does not use Flash explicitly, nor does it use the <video> html tag.  However, your browser SHOULD decide whether to use Flash (if present) or HTML5 to play the video.  I have no control over which one it uses to play the video.
Title: Re: Yet Another YouTube BBCode Tag
Post by: WallyM on September 22, 2016, 05:24:49 PM
Quote from: dougiefresh on September 21, 2016, 09:19:07 PM
Quote from: WallyM on September 21, 2016, 06:11:19 PM
Hi, does this mod support HTML 5? Will browsers that have ditched Flash, like Opera on Android, be able to display videos with this mod?
This mod uses an iframe to load the YouTube video URL.  This mod does not use Flash explicitly, nor does it use the <video> html tag.  However, your browser SHOULD decide whether to use Flash (if present) or HTML5 to play the video.  I have no control over which one it uses to play the video.
Can you point me to some web sites that use your mod,  so I  can see?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on September 22, 2016, 06:54:12 PM
Quote from: WallyM on September 22, 2016, 05:24:49 PM
Quote from: dougiefresh on September 21, 2016, 09:19:07 PM
Quote from: WallyM on September 21, 2016, 06:11:19 PM
Hi, does this mod support HTML 5? Will browsers that have ditched Flash, like Opera on Android, be able to display videos with this mod?
This mod uses an iframe to load the YouTube video URL.  This mod does not use Flash explicitly, nor does it use the <video> html tag.  However, your browser SHOULD decide whether to use Flash (if present) or HTML5 to play the video.  I have no control over which one it uses to play the video.
Can you point me to some web sites that use your mod,  so I  can see?
I personally cannot, primarily because I don't know (or care) who uses my mod.  My personal website is down at the moment.  Anybody out there wanna volunteer?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Jeare on October 24, 2016, 12:14:20 AM
Hello,

First of all, great mod, and thank you for making it.

I have a bit of a problem that I could use some help with. When I have this mod installed, anyone who posts a link to youtube in my site's shoutbox gets the
. Without the mod installed, it would just have the word Link, and it would link to the url posted. Currently, it does not show the video, nor does it convert it to a link. Is there a way to have this mod ignore the shoutbox completely?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 24, 2016, 08:32:50 AM
Quote from: Jeare on October 24, 2016, 12:14:20 AM
I have a bit of a problem that I could use some help with. When I have this mod installed, anyone who posts a link to youtube in my site's shoutbox gets the
. Without the mod installed, it would just have the word Link, and it would link to the url posted. Currently, it does not show the video, nor does it convert it to a link. Is there a way to have this mod ignore the shoutbox completely?
Which mod runs your shoutbox?  Is it a paid or free mod?  Or is a custom work?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Jeare on October 24, 2016, 07:20:59 PM
I believe it is the one that comes with SimplePortal.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 24, 2016, 08:37:31 PM
I added a little bit of code to skip the embedding stuff for the SimplePortal shoutbox.  Try the attached version and tell me if it solves the problem.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Jeare on October 25, 2016, 01:32:02 AM
It seems to have worked. Thank you so much!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 25, 2016, 06:48:29 AM
Uploaded v4.1 - October 24th, 2016
o Added code to SimplePortal code to skip embedding links for shoutboxes.



Quote from: Jeare on October 25, 2016, 01:32:02 AM
It seems to have worked. Thank you so much!
You're welcome!  It's now the new official version....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on October 25, 2016, 08:20:18 AM
Thanks for the update!

Now, I know that this may well be outside the scope of the mod, but how easy/possible would it be to auto-parse links and embed vids? If at all...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 25, 2016, 01:42:29 PM
Quote from: Gryzor on October 25, 2016, 08:20:18 AM
Now, I know that this may well be outside the scope of the mod, but how easy/possible would it be to auto-parse links and embed vids? If at all...
Already done.
Title: Re: Yet Another YouTube BBCode Tag
Post by: petb on October 25, 2016, 03:21:42 PM
I tried to investigate a bit more about my problem:

In the Post there is a Link:  http://www.youtube.com/watch?v=WHgcs5vEzVI

If the Mod was active it builds this html code:
<iframe class="youtube-player" type="text/html" src="[youtube]http://www.youtube.com/embed/WHgcs5vEzVI[/youtube]" allowfullscreen frameborder="0"></iframe>

But this Code wont work, because of the
</a>[/code]
Link works, but logical no iframe video embed code.

If i uninstall the Mod the Forum produce this code:
<a href="http://www.youtube.com/watch?v=WHgcs5vEzVI" class="bbc_link" target="_blank"><a href="http://www.youtube.com/watch?v=WHgcs5vEzVI" class="bbc_link" target="_blank">http://www.youtube.com/watch?v=WHgcs5vEzVI</a></a>
Don't know why it produce a link within a link?
But if i deactivate the Option "Automatically link posted URLs" the Forum itself only shows the basic text:     http://www.youtube.com/watch?v=WHgcs5vEzVI  without a href html tag.

But this has no effect on the mod, after install the mod again it still produce this html code:
<iframe class="youtube-player" type="text/html" src="[youtube]http://www.youtube.com/embed/WHgcs5vEzVI[/youtube]" allowfullscreen frameborder="0"></iframe>

I am using smf 2.0.12 with 4.1 of the mod.
In Hope that you might get an idea about that... :)
Petb
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on October 26, 2016, 02:51:49 AM
Quote from: dougiefresh on October 25, 2016, 01:42:29 PM
Quote from: Gryzor on October 25, 2016, 08:20:18 AM
Now, I know that this may well be outside the scope of the mod, but how easy/possible would it be to auto-parse links and embed vids? If at all...
Already done.

Really? Which version? (page with changelog returns a 404 for me). I'm running 4.0 and I contantly have to edit user posts because it doesn't, on my installation...
Title: Re: Yet Another YouTube BBCode Tag
Post by: richardwbb on November 14, 2016, 10:18:10 PM
I've searched this topic for 'database' and 'MySQL' and saw no results.

I just installed this, I find, must-have mod.

It did this quite well for all themes, even a very old and heavily modified, which is a plus to me.

But, I noticed some akward things with the installing of modifications, themes. This isn't this plugin related, so I will post that somewhere else when I get to this.

To keep it short;

This plugin modifies the database, and I wasn't made aware of this.

This I find strange. I don't know other people's opinion on this for modifications in general, but after five year Site Admin, this is the first time I run in to this.

It would be most helpful if somehow this is notified, because ->

I test the modifications. I decided to prepare a 2.0.12 fresh install. This is modification #8 for me. Every modification I copy the hole SMF directory [this mainly has to do with what I just wrote; '
But, I noticed some akward things with the installing of modifications, themes. This isn't this plugin related, so I will post that somewhere else when I get to this.
'.
Can someone explain why this is necessary, and please, make Site Admin's aware of this, because;

It is not possible for me to do a fresh install without a testing environment. In the past the running forum borked here and there and I felt back then my luck with restoring ends somewhere.

Also, I don't like this as a surprise, I view modifications as files only, in such a way that I rename the running forum directory and change the name of the testing directory to the running name.

Coincidentally I replaced the database to a version pre modification #1, this because I had white screen of death somehow [I was able to fix that]

But how can I revert on running forum, with new posts in it.

If I notice at modification #8, that modification #1 [hypothetically, this modification], borked something. How can I replace that on a database.

If I know this, [please let me know if I should be able to see this somehow beforehand, willing to learn here], I would install this plugin as a last one, switching from test forum to running forum, then wait a couple of days, back everything up, and install it and see how that works out.

I see no other way then starting this in this topic, five years is a long time. This is the first one that did this;

QuotePHP Fatal error:  Call to undefined function BBCode_YouTube_Embed() in /var/www/html/smf/Sources/Subs.php on line 1714

I use PrettyURL's for example, I knew it has to use the database beforehand. It borked two times. The help at code.google.com solved this.

If people find that I am whining, then, #1 say so, and #2 explain to me; how to proceed with any modification for always?
Title: Re: Yet Another YouTube BBCode Tag
Post by: petb on November 15, 2016, 03:20:24 AM
Quote from: richardwbb on November 14, 2016, 10:18:10 PM
...This plugin modifies the database, and I wasn't made aware of this. ...
To see more clearly about this..., what was changed?
Did the change made any Problem?
Any Problem after deinstall the mod?
Title: Re: Yet Another YouTube BBCode Tag
Post by: richardwbb on November 15, 2016, 02:36:26 PM
Well, I posted the error and I am not aware how I can track changes to the database and I am a little puzzled on why this specific plugin requires something of the database and it would be great if it escaped once it's code to re-call it's database requirement, however, I recently learned that 'install.php means SQL and I was used to reading only the middle column of the modification installer [type - action -description] and I viewed type as uninteresting or to be opened for the code difference if the right column said failed and the middle column I regarded as the column that is the interesting part]

On the other hand this plugin has no install.php

Where or how can I tell what [might be] changed to the database, that would be helpful already.

I hope I have cleared things up. Also if someone can tell me how to search for this in a plugin that is relatively compact or how to see beforehand it's the database.

This I would like to learn, I don't see where to go else besides reading a manual I feel that is this forum and it's pretty quick with helpful answers by it's people.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on November 15, 2016, 08:51:05 PM
@richardwbb: Okay, let me respond to both posts that you have made:

First, the only modification this mod does to the database is to add hooks to it.  The hooks add the functionality of the mod to the forum in such a way that minimal edits are required.  All changes take place in the {db_prefix}settings table.

Second, if you are looking for the changes this mod makes, look in the {db_prefix}settings table, specifically at these entries:
o integrate_pre_include => tells the forum what file to load
o integrate_load_theme => adds a CSS file to the forum.
o integrate_bbc_codes => adds bbcodes to the forum.
o integrate_bbc_buttons => adds bbcode buttons to the forum.
o integrate_general_mod_settings => admin settings

Third, this mod doesn't contain any install.php files, which makes me wonder if you are in the right topic.  And no, install.php doesn't necessarily mean that it does SQL commands, but it is most commonly used to do so....

Fourth, modifications aren't intended to viewed as a "file only" situation.  It's intended as a package deal.  If you manually make the changes to the files, then you are responsible for executing the PHP portion of the mod, because 99.9% of the time, the mod won't work without those changes.  If you don't want database changes on your forum, this mod isn't for you PERIOD!.

Lastly, what exactly is your complaint?  Both messages are vague about the problem (if any) you are encountering.  You say a operation (or more) has failed, yet you don't provide any details as to what happened.  All I see are complaints without substance, and without substance (something to go on), I can't fix whatever problem you are having.

I will try to help you if you are attempting to install the mod through the Package Manager and it won't complete without errors, and most of the time, minor manual changes are required in order to make everything co-exist.  However, I'm not going to support situations where completely manual installations aren't completed as directed by the package-info.xml file, which sounds like what has happened....
Title: Re: Yet Another YouTube BBCode Tag
Post by: richardwbb on November 15, 2016, 10:06:45 PM
Hey Dougiefresh, thanks for clearin that up already. I mean with already, I don't feel like I am able to respond right now, I am not PHP-savvy and that is because I'm no programmer. I always am able to learn a few commands and an hour later, I don't remember any longer and it is hard to explain, but; I'm no β.

Now I will respond mainly to what petb wrote and possibly this is overdone by me, but it isn't clear to me what is expected from me, and, I am after the true facts or relevant information about something.

I will do my best on understanding what you wrote, and I already view your response, as a valuable one.

What I am doing is to find may way in not two, but, three factors;

1. files
2. database
3. a live forum that is posted on

I'm able to manange 1. and 2. With 3., I need my time for 1. and 2., meaning that when I finished something, I'll notice that there are new posts on the live forum. I believe I shouldn't close a live forum for too long and when I started being Site Admin, I did modifications and all sorts of my bads formed, but now it got harder. I don't feel that reading a manual is my best option, this is because I'm not good at memorizing things by reading about it, but doing.

Now, I can grep the forum, notice string values, so I go to the translation, find the related string and then search the code for it. I can't read PHP. You gave me several handholds, You even used [strong] with that, haha.

I did follow the installation procedure, my constraint is that I'm not able to find on my own, what is going on. I understand that a testing server is for testing purposes, but I see difficulty with the roll-out of my changes, and am wondering how other people do this.

Would you be so kind to answer for all the people, how they implement their roll-out to the production server. I would be most grateful.

And I'll take in account that this can happen, and that it is so [you made me see that]. What just wrote I can see from your words[at this moment in time]. Lesson learned. I see that I did answer to your post, but I'll look in to this, again. And probably, you guessed, again.
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 21, 2017, 12:14:38 AM
HI I'm VERY new at all this so please forgive stupid questions...

How do I actually install this mod?
Do I have to make the manual file edits mentioned here (http://custom.simplemachines.org/mods/index.php?action=parse) as well as do the install?  What about the file operations also mentioned on that page?

Thanks
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on January 21, 2017, 09:15:28 AM
Quote from: landyvlad on January 21, 2017, 12:14:38 AM
How do I actually install this mod?
Do I have to make the manual file edits mentioned here (http://custom.simplemachines.org/mods/index.php?action=parse) as well as do the install?  What about the file operations also mentioned on that page?
This mod is intended to be installed through Package Manager.  If you choose to manually install the mod, you must make all file edits and file copies as dictated by package-info.xml.
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 22, 2017, 07:51:12 PM
Thank you.
Title: Re: Yet Another YouTube BBCode Tag
Post by: GL700Wing on March 13, 2017, 07:13:54 PM
Thought I'd let you know the options for setting the width and height are not being added to the Modification settings menu in version 4.1.

In the file ./Sources/ManageSettings.php
Find:
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!

Replace with:
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
array('int', 'youtube_default_width'),
array('int', 'youtube_default_height'),
'',




Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on March 13, 2017, 08:58:09 PM
Quote from: GL700Wing on March 13, 2017, 07:13:54 PM
Thought I'd let you know the options for setting the width and height are not being added to the Modification settings menu in version 4.1.
The settings are provided via a hook, which is added during installation of the mod in add_remove_hooks.php.  I've installed the mod on a clean SMF 2.0 localhost forum and can see the settings.
Title: Re: Yet Another YouTube BBCode Tag
Post by: GL700Wing on March 14, 2017, 12:41:09 AM
Quote from: dougiefresh on March 13, 2017, 08:58:09 PM
Quote from: GL700Wing on March 13, 2017, 07:13:54 PM
Thought I'd let you know the options for setting the width and height are not being added to the Modification settings menu in version 4.1.
The settings are provided via a hook, which is added during installation of the mod in add_remove_hooks.php.  I've installed the mod on a clean SMF 2.0 localhost forum and can see the settings.
Ah - ok - must be a conflict with another mod I have installed.
Title: Re: Yet Another YouTube BBCode Tag
Post by: MULITRI on March 25, 2017, 05:53:54 PM
Thanks again for another fine Mod dougiefresh, i had tried another Mod and it was giving me viewing problems, yours works perfectly for now at least with the three videos i've just embedded.

Great Job one more time.... Regards
Title: Re: Yet Another YouTube BBCode Tag
Post by: jsx on May 16, 2017, 05:41:21 AM
I'm lacking in settings on/off this modification. Such a function has a Ohara YouTube Embed modification.

Also I'm lacking the possibility of set position of the film in this modification, automatically the film is shown on the left side, would be great if it was possible to set the film in the middle. Should be choice.

Automatically long links from yt are exchanging on built films, but short links youtu.be stay as links, so here is some bug I think.

I'm lacking in function on or off automatic changing links into built films. Such a option is in Ohara YouTube Embed modification.

I think that taking the example from the other modification isn't bad.

Is there a chance of adding these suggestions to the modification?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Steve on May 16, 2017, 09:02:00 AM
Why not just use the Ohara mod?
Title: Re: Yet Another YouTube BBCode Tag
Post by: jsx on May 17, 2017, 04:36:38 PM
Quote from: Steve on May 16, 2017, 09:02:00 AM
Why not just use the Ohara mod?

Because is lacking these functions which about I wrote.

@Steve

Automatically long links from yt are exchanging on built films, but short links youtu.be stay as links, so here is some bug I think.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 18, 2017, 09:54:11 AM
@jsgrom: Let me see what I can do about that feature request and/or bug reports....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 05, 2017, 07:26:36 PM
Quote from: jsgrom on May 16, 2017, 05:41:21 AM
I'm lacking in settings on/off this modification. Such a function has a Ohara YouTube Embed modification.

Also I'm lacking the possibility of set position of the film in this modification, automatically the film is shown on the left side, would be great if it was possible to set the film in the middle. Should be choice.

Automatically long links from yt are exchanging on built films, but short links youtu.be stay as links, so here is some bug I think.

I'm lacking in function on or off automatic changing links into built films. Such a option is in Ohara YouTube Embed modification.

I think that taking the example from the other modification isn't bad.

Is there a chance of adding these suggestions to the modification?
Quote from: dougiefresh on May 18, 2017, 09:54:11 AM
@jsgrom: Let me see what I can do about that feature request and/or bug reports....
@jsgrom: Can you provide me with some examples of links that don't work for you?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 06, 2017, 11:35:33 AM
Uploaded v4.2 - July 6th, 2017
o Reorganized file edits to support SMF 2.1 Beta 3 properly.
o Removed support for SMF 2.1 Beta 2.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on July 06, 2017, 12:20:33 PM
Thanks for the continued support :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: ceekay27 on July 06, 2017, 12:45:55 PM
Quick question that I think I know the answer to but just want to double check.
Does take my bandwidth or Youtubes?

Great mod by the way, thanks.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on July 06, 2017, 12:45:10 PM
Youtube, of course. It embeds the YT player!
Title: Re: Yet Another YouTube BBCode Tag
Post by: ceekay27 on July 06, 2017, 12:49:41 PM
Lol, I thought as much, but always best to check. Thanks very much  ;)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on July 06, 2017, 12:48:54 PM
No worries :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on July 12, 2017, 09:19:04 PM
I really love this mod.  It does just what it says.
Any chance that it could be extended to handle vimeo as well?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 12, 2017, 09:27:38 PM
Quote from: landyvlad on July 12, 2017, 09:19:04 PM
I really love this mod.  It does just what it says.
Any chance that it could be extended to handle vimeo as well?
This mod covers only YouTube.  I won't alter it to include other video sites.  But I can probably whip something up for Vimeo using one of my other video embed mods as a template....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 12, 2017, 09:54:45 PM
Quote from: dougiefresh on July 12, 2017, 09:27:38 PM
Quote from: landyvlad on July 12, 2017, 09:19:04 PM
I really love this mod.  It does just what it says.
Any chance that it could be extended to handle vimeo as well?
This mod covers only YouTube.  I won't alter it to include other video sites.  But I can probably whip something up for Vimeo using one of my other video embed mods as a template....
Send ya a PM....
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on July 17, 2017, 10:09:54 AM
Uploaded v4.3 - July 16th, 2017
o Added ability for user to full-screen the video.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Colin on July 17, 2017, 04:52:36 PM
Thanks for your work on this, Dougiefresh.
Title: Re: Yet Another YouTube BBCode Tag
Post by: LadyLike on August 11, 2017, 08:02:18 AM
Does this mod not support the BBC code in signatures? I made sure the BBC code is enabled yet it's not working for me. When I add it to my signature it parses it as a link.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 11, 2017, 09:57:44 AM
Quote from: LadyLike on August 11, 2017, 08:02:18 AM
Does this mod not support the BBC code in signatures? I made sure the BBC code is enabled yet it's not working for me. When I add it to my signature it parses it as a link.
This is done on purpose and will not be changed.  Large signatures are irritating, and video signatures even more so....

If you want that functionality, then comment out or remove lines 410 and 411 in Sources/Subs-BBCode-YouTube.php.  They are:
if (strpos($cache_id, 'sig') !== false)
$message = preg_replace('#\[youtube.*\](.*)\[\/youtube\]#i', '[url]$1[/url]', $message);
Title: Re: Yet Another YouTube BBCode Tag
Post by: jsx on August 24, 2017, 09:06:49 AM
Quote from: dougiefresh on May 18, 2017, 09:54:11 AM
@jsgrom: Can you provide me with some examples of links that don't work for you?

While creating the new post in the editor of writing when I will put for example link like this:

https://www.youtube.com/watch?v=RkZkekS8NQU

It automatically will pose itself film built in, and if I add the shortened link to it video:

https://youtu.be/RkZkekS8NQU

It will not-pose itself film built in. If only a film built in was formed of a shortened link it is necessary to tag this link with youtube tag. Do you understand? So you have some bug in this modification.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 24, 2017, 10:34:40 AM
Uploaded v4.4 - August 24th, 2017
o Fixed auto-embed so that youtu.be/RkZkekS8NQU will embed itself properly.
o Added option to allow to embed YouTube videos in signatures. (BAD IDEA!!)




@jsgrom:  This update should fix the bug you reported.  Thank you!

@LadyLike:  I've decided (against my better judgement) to include an option to allow YouTube videos in signatures.  I hope this solves the issue you brought up....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 24, 2017, 10:37:50 AM
Thanks for the update!

Can I ask for a little help? I don't understand how auto-embed works... if my users just type a YT URL, it just turns into a URL (as per SMF), it never auto-embeds, and I see no such option... Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 24, 2017, 11:10:30 AM
Quote from: Gryzor on August 24, 2017, 10:37:50 AM
Thanks for the update!

Can I ask for a little help? I don't understand how auto-embed works... if my users just type a YT URL, it just turns into a URL (as per SMF), it never auto-embeds, and I see no such option... Thanks!
Link, please.....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 24, 2017, 11:34:04 AM
Ok, weird thing. I often have to edit my users' posts to add the BBcode. I now tried just pasting a YT link and it was auto-embedded!! Are there special permissions?

Right now I can't find a simple link because as I said I edit them, but let me know if you want me to try and replicating it? I've already asked my users over at http://www.cpcwiki.eu/forum/off-topic/just-a-test-13793/msg148577/#msg148577 ...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 24, 2017, 11:58:15 PM
Quote from: Gryzor on August 24, 2017, 11:34:04 AM
Ok, weird thing. I often have to edit my users' posts to add the BBcode. I now tried just pasting a YT link and it was auto-embedded!! Are there special permissions?
No, there are no special permissions in the link.

Quote from: Gryzor on August 24, 2017, 11:34:04 AM
Right now I can't find a simple link because as I said I edit them, but let me know if you want me to try and replicating it? I've already asked my users over at http://www.cpcwiki.eu/forum/off-topic/just-a-test-13793/msg148577/#msg148577 ...
Well, I can't fix what I don't know is wrong....  Really need a sample link in order to know what I need to fix....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 25, 2017, 01:15:25 AM
In that thread they did post one, but it's a youtu.be link, not sure if the package supports those. I will try creating a normal (=long) link later, too
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 25, 2017, 10:02:09 AM
Version 4.4 does support the youtu.be link in the form you supplied properly.  Previous versions do not.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 29, 2017, 06:40:35 AM
Ohhh yes, it works now, and perfectly so!

Thanks :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Jailer on August 30, 2017, 07:08:49 PM
My error log is getting spammed with error messages since installing this mod. Merely visiting the site will cause this error. Any idea what may be causing this?

https://mlcnfriends.com/index.php?
8: Undefined index:
File: /usr/local/www/nginx/Sources/Subs-BBCode-YouTube.php
Line: 385


The line in question:

383: {
384: if (strpos($param, '=') === false)
==>385: $order[$old] .= ' ' . $param;
386: else
387: $order[$old = substr($param, 0, strpos($param, '='))] = substr($param, strpos($param, '=') + 1);
388: }
Title: Re: Yet Another YouTube BBCode Tag
Post by: peterparker on August 30, 2017, 09:04:38 PM
I wanted to upload my videos on youtube, what will I do for uploading my videos on youtube
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on August 31, 2017, 02:00:25 AM
Quote from: peterparker on August 30, 2017, 09:04:38 PM
I wanted to upload my videos on youtube, what will I do for uploading my videos on youtube

You just go and upload your videos on YouTube.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 31, 2017, 12:13:11 PM
Uploaded v4.5 - August 31st, 2017
o Fixed undefined array element error in Subs-BBCode-YouTube.php.




@Jailer:  Thank you for the bug report!  It's been fixed for version 4.5!
Title: Re: Yet Another YouTube BBCode Tag
Post by: Jailer on August 31, 2017, 01:46:47 PM
Looks like that fixed it. Thanks for the quick update!
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on September 06, 2017, 09:40:50 AM
That's certainly good service !
Title: Re: Yet Another YouTube BBCode Tag
Post by: asmith on October 05, 2017, 11:33:41 AM
@dougiefresh,

My forum (2.0.14) runs under https. I noticed youtube links starting with http get blocked and are not shown. I modified Subs-BBCode-YouTube.php to forced all youtube links to be https and it worked. Thought to let you know.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 09, 2017, 08:59:39 AM
Uploaded v4.6 - October 9th, 2017
o Added option to force using HTTPS instead of allowing HTTP in links.




@asmith:  Thank you for the bug report.  Hopefully this update will assist in solving your problem.
Title: Re: Yet Another YouTube BBCode Tag
Post by: asmith on October 09, 2017, 02:34:38 PM
Thanks for the fix.

But isn't YouTube all https now? I mean there's no http anymore in any of google products. (why the option to force?)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on October 17, 2017, 12:23:05 PM
Uploaded v4.7 - October 17th, 2017
o Removed option to force HTTPS mode.
o Modified code to force HTTPS mode in all YouTube tags.



Quote from: asmith on October 09, 2017, 02:34:38 PM
But isn't YouTube all https now? I mean there's no http anymore in any of google products. (why the option to force?)
Sorry about the delay in responding.  I just looked into the YouTube thing.  You're 100% right.  The mod has been corrected so that YouTube tags work correctly now (*at least everything that I know of....  :P )
Title: Re: Yet Another YouTube BBCode Tag
Post by: neoweb on November 24, 2017, 02:46:15 AM
Hi.. my button images weren't showing up, so I uploaded the files to the theme BBC directory, but it still is not showing up 'nice' (see attachement)

What can I do?
Title: Re: Yet Another YouTube BBCode Tag
Post by: -Rock Lee- on November 25, 2017, 07:37:21 PM
It's a very good variant :D to play in local that I'm just putting together something similar and can help me understand some things, thanks for sharing!


Regards!
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on December 18, 2017, 07:39:38 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 18, 2017, 09:07:59 AM
Quote from: landyvlad on December 18, 2017, 07:39:38 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)
First, Package Manager won't allow you to install a newer version of a mod while an older version is installed.  If the package supports upgrading, Package Manager will give you the option to upgrade to the new version.  Most of my mods do not support upgrades in that fashion, mostly because some servers have issues with multiple install XML files and aren't smart enough to make it work....

The proper way to upgrade any mod that doesn't give the option through Package Manager is to uninstall the current version of the mod, then install  the new version.  Immediately deleting the old version is not mandatory at any stage of the upgrade process, although if you are happy with the new version, deletion of the old version is recommended.

Quote from: neoweb on November 24, 2017, 02:46:15 AM
Hi.. my button images weren't showing up, so I uploaded the files to the theme BBC directory, but it still is not showing up 'nice' (see attachement)
I'll fix the installer so that the BBC button images are properly installed.

You're right, that doesn't look "nice".  If you want to redesign better button images, please feel free to share them and I'll include them.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dwev on December 28, 2017, 11:13:45 AM
I want to remove this mod and it throws two errors while trying to do this.

The test failed on ./Sources/PortalBlocks.php
It says that it should find the following code:


$context['bbc_youtube']['ignore'] = true;
$shoutbox['warning'] = parse_bbc($shoutbox['warning']);


and replace it with this one:


$shoutbox['warning'] = parse_bbc($shoutbox['warning']);


Funny thing is that in that file there's nothing that resembles that, even a search for just the word "youtube" yields no results at all.

The second error is for ./Themes/default/languages/index.english.php
It tell me that I should replace the code "?>" with nothing at all (empty field).

If I look into that file I do find the "?>" all the way at the end, just before it are 5 times that are clearly related to YouTube.

Does anyone know how I can safely remove this mod?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on December 29, 2017, 10:33:52 PM
Quote from: Dwev on December 28, 2017, 11:13:45 AM
I want to remove this mod and it throws two errors while trying to do this.

The test failed on ./Sources/PortalBlocks.php
It says that it should find the following code:


$context['bbc_youtube']['ignore'] = true;
$shoutbox['warning'] = parse_bbc($shoutbox['warning']);


and replace it with this one:


$shoutbox['warning'] = parse_bbc($shoutbox['warning']);


Funny thing is that in that file there's nothing that resembles that, even a search for just the word "youtube" yields no results at all.
Okay, you can ignore this error.  I'm thinking you aren't running the portal that this mod makes a change to, are you?  Even if you were, the line isn't in there, so you can safely ignore the error....

Quote from: Dwev on December 28, 2017, 11:13:45 AM
The second error is for ./Themes/default/languages/index.english.php
It tell me that I should replace the code "?>" with nothing at all (empty field).

If I look into that file I do find the "?>" all the way at the end, just before it are 5 times that are clearly related to YouTube.

Does anyone know how I can safely remove this mod?
Hmmm....  That's a weird issue....  :-[  I'll see if I can duplicate it.  If I can, then I will see about fixing the mod....

Go into Themes/default/languages/index.english.php and remove each of the lines that are clearly related to this mod, then proceed to ignore this error as well....
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dwev on December 30, 2017, 07:17:48 PM
@ dougiefresh: followed your instructions and it uninstalled fine.

Ironically I wanted to uninstall to try out another video-mod, but ended up reinstalling this one, because I realized I like it better.
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 17, 2018, 05:56:48 AM
I'm trying to uninstall v 4.1 from SMF 2.0.13, in order to update the mod.

Quote
I am getting this error:
9. Execute Modification   ./Themes/default/languages/index.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/index.english-utf8.php   Test failed
10.   Execute Modification   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed

I'd appreciate if you could let me know how to sort this out.  Ta.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on January 17, 2018, 06:00:32 AM
Probably another mod has changed those files already, so you'll have to check manually.
However, I see those are the utf8 versions and I've had mods failing on those too, but the utf-8 files were empty in my case, so I'm not sure it's critical?
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 17, 2018, 06:43:08 AM
I have set my forum to use UTF8, if that's relevant.
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 20, 2018, 02:15:24 AM
dougiefresh  - should I

1. Uninstall, ignoring the errors, or
2 Just install the new one over the top, or
3 Something else ?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on January 20, 2018, 02:58:32 AM
Have you checked the files? If another mod has done any changes where this one tries to change things, you could do them manually...
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 20, 2018, 07:33:33 AM
No and to be honest I wouldn't really be confident that I wouldn't muck up another mod in doing so.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on January 20, 2018, 11:12:58 AM
It doesn't mean you'll much up another mod; most often you'll find that where a mod has inserted some text, say:

insert "abcef" before "asdfg"

Another mod will have done the same:

insert "qwerty" before "asdfg"

So you end up with a section reading

abcdef
qwerty
asdfg

So, if you've installed the first mod and then the second, the uninstaller for the first mod would look for

abcdef
asdfg

but of course it can't find it. It's just a matter of manually deleting "abcdef".
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 20, 2018, 10:01:39 PM
Got it. Thanks.
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 21, 2018, 05:28:40 AM
OK super weird.

As I said I got these errors
Quote
I am getting this error:
9. Execute Modification   ./Themes/default/languages/index.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/index.english-utf8.php   Test failed
10.   Execute Modification   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed

I went ahead and uninstalled (which it did successfully, albeit with those errors acknowledged)
planning then to remove those other sections manually.

Looking at the package parser, the edits to those two files (on install) are:

./Themes/default/languages/index.english-utf8.php
Quote
Find (at the end of the file):
?>

Add Before:

$txt['youtube'] = 'Youtube';
$txt['yt_search'] = 'YouTube Search';
$txt['yt_user'] = 'YouTube User';
$txt['youtube_link_invalid'] = '[ Invalid YouTube link ]';
$txt['youtube_no_embed'] = 'Show YouTube videos as a link.';

and

./Themes/default/languages/ManageSettings.english-utf8.php
QuoteFind (at the end of the file):
?>

Add Before:

$txt['youtube_default_width'] = 'Default width used for YouTube bbcode when not specified<div class="smalltext">Use <strong>0</strong> to use responsive video display</div>';
$txt['youtube_default_height'] = 'Default height used for YouTube bbcode when not specified<div class="smalltext">Use <strong>0</strong> to use responsive video display</div>';


So I went into each of those files and did a search for youtube - nothing.
Even scrolled through manually and can't see ANY such code for removal.

So.... any reason why this might be the case?

And any reason why I shouldn't now try to instal the new version?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on January 21, 2018, 06:05:43 AM
Then probably when you first installed the mod, these modifications weren't made for any reason... maybe the utf8 files weren't there? I'm really not sure how and when the utf8 files work...
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 21, 2018, 06:25:23 AM
Ah yes that makes sense they probably wouldn't have been there at the time.  Ok cool, I just install the new version. Ta.

edit: Installed new version all good !
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on January 21, 2018, 10:52:08 AM
Cool :)

THis methodology is always valid, used it so many times...
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on January 21, 2018, 07:13:32 PM
Quote from: Gryzor on January 21, 2018, 10:52:08 AM
THis methodology is always valid, used it so many times...

By 'this methodology' I assume you mean that if there are only one or two errors then just uninstall anyway and go do the remaining changes (usually code deletions) manually in the relevant file?

If that is the case then I ought to be able to sort out the remaining mod upgrades I need to do.




( Oh and yes I realise it is POSSIBLE to do ALL the edits manually rather than using an uninstaller, but I wouldn't like too...  :)   ) 
Title: Re: Yet Another YouTube BBCode Tag
Post by: Gryzor on January 22, 2018, 05:16:16 AM
Theoretically, if you have many mods installed you can run into a newer mod that will have much difficulty being installed; in that case yes, you could do all the edits manually (especially if it's only got a few changes). If you're comfortable with the process (a couple of times doing it should be enough) then why not! I know I've been there...
Title: Re: Yet Another YouTube BBCode Tag
Post by: triode-master on February 10, 2018, 05:06:35 PM
hello my SMF 2.1 Beta 3
before install Yet Another YouTube BBCode Tag

how to remove these errors?
error in
Sources/Subs-Post.php
line: 216 2: implode(): Invalid arguments passed
line: 216 2: array_unique() expects parameter 1 to be array, null given
line: 216 8: Undefined variable: alltags
line: 212 2: Invalid argument supplied for foreach()

So it works fine, video shows
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 12, 2018, 11:08:02 AM
I'm pretty sure those errors don't have anything to do with this mod.... 

I'm guessing that the $alltags isn't declared an array by default, and nothing gets added to it for some reason...  In Subs-Post.php, find this line:
Code (Find) Select
foreach (($codes = parse_bbc(false)) as $code)
and add this above it:
Code (Add Above) Select
$alltags = array();
This may fix the issue.  If it does, then it should be reported on the SMF 2.1 Beta 3 bug reports board.
Title: Re: Yet Another YouTube BBCode Tag
Post by: triode-master on February 16, 2018, 04:14:19 PM
Thank you dougiefresh
You helped!
But there was one mistake.
/Sources/Subs-Post.php
line: 212 2: Invalid argument supplied for foreach()
This error occurs when you insert a video into the post.
In the forum logs it is repeated twice.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 17, 2018, 11:50:36 AM
Clearly, something is screwed up....  Changing the code like this SHOULD solve the errors.....
Code (Find) Select

foreach (($codes = parse_bbc(false)) as $code)
if (!in_array($code['tag'], $allowedEmpty))
$alltags[] = $code['tag'];

Code (Replace) Select

$codes = parse_bbc(false);
$codes = is_array($codes) ? $codes : array();
$alltags = array();
foreach ($codes as $code)
if (!in_array($code['tag'], $allowedEmpty))
$alltags[] = $code['tag'];
Title: Re: Yet Another YouTube BBCode Tag
Post by: Finn_958 on February 17, 2018, 04:21:19 PM
I installed as instructed but the following instruction:

// Embed YouTube URLs in the YouTube bbcode tags:
   BBCode_YouTube_Embed($message, $smileys, $cache_id, $parse_tags);

Returns the following error:
called undefined function bbccode_youtube_embed

Please however note that I did not know how to put some files:
add_remove_hooks.php
package-info.xml
install_20x.xml
install_21x.xml
language_english.xml
language_spanish_latin.xml
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 17, 2018, 05:45:37 PM
@Finn_958:  I would highly suggest using the Package Manager in the admin panel.  That's what it is there for: Installing packages....  ::)  You should also note that sometimes manually installing mods makes it harder to uninstall things properly!

Since you appear to insist on doing it manually, all language file modifications are in language_english.xml and language_spanish_latin.xmladd_remove_hooks.php must be copied to forum root (same directory as SSI.php) and called via browser.  Once executed, you can then delete the file.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Finn_958 on February 17, 2018, 08:51:00 PM
I installed the package from the admin panel and it works like a charm. I am a newbye and didn't know this functionality, thank you.
Title: Re: Yet Another YouTube BBCode Tag
Post by: triode-master on February 19, 2018, 08:42:01 AM
dougiefresh yes!
Thank you  :)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sesquipedalian on February 19, 2018, 07:34:28 PM
Quote from: dougiefresh on February 17, 2018, 11:50:36 AM
Clearly, something is screwed up....  Changing the code like this SHOULD solve the errors.....
Code (Find) Select

foreach (($codes = parse_bbc(false)) as $code)
if (!in_array($code['tag'], $allowedEmpty))
$alltags[] = $code['tag'];

Code (Replace) Select

$codes = parse_bbc(false);
$codes = is_array($codes) ? $codes : array();
$alltags = array();
foreach ($codes as $code)
if (!in_array($code['tag'], $allowedEmpty))
$alltags[] = $code['tag'];


That would just mask the real problem. Calling parse_bbc(false) should return the contents of the $codes array that is defined in that function. If instead it is returning null, which is what triode-master's reported error messages appear to indicate, then something in his forum (perhaps this mod, perhaps something else) has broken parse_bbc().

Merely masking the problem by using these proposed changes is not a proper solution, because there are many places in the codebase that use parse_bbc(false) to get the list of BBCode tags. If null is returned instead of the array, quite a few things are going to break, some in ways that may not be immediately obvious but are important.

That said, it would be good form for us to define $alltags = array(); before the foreach, so I will add that in a future PR to SMF2.1. (EDIT: Done in #4554 (https://github.com/SimpleMachines/SMF2.1/pull/4554).)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sesquipedalian on February 20, 2018, 04:28:51 AM
I took a look at the code in this mod, dougiefresh, and I suggest some changes for the 2.1 version. Specifically, you should get rid of all the file edits to Subs.php and use the hooks there instead. You can use the integrate_pre_parsebbc hook to add BBCodes to $modSettings['disabledBBC'], and integrate_bbc_codes hook to add BBCodes to the main $codes array.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 20, 2018, 10:34:48 PM
Uploaded v4.8 - February 20th, 2018
o Removed support for SMF 2.1 Beta 2.
o Added support for SMF 2.1 Beta 3.
o Moved bbcode disabling code from Sources/Subs.php to Subs-BBCode-YouTube.php.
o Added translators to the mod's README.txt file.
o Added LICENSE.txt to satisfy licensing concerns.




@Sesquipedalian:  Upon looking at the SMF 2.1 code, I couldn't agree with your suggestions more!  So, your suggestions on SMF 2.1 version have been integrated into this version!

Regarding the code changes here (https://www.simplemachines.org/community/index.php?topic=531060.0;last_msg=3962568), I didn't realize that it would mask the problem...   (Either that, or I didn't think that hard about the issues involved....)  Either way, I apologize for my oversight.  Please ignore my suggestion/"half-ass-fix"...
Title: Re: Yet Another YouTube BBCode Tag
Post by: Finn_958 on February 21, 2018, 08:43:11 AM
How do I update it without losing settings? Uninstall and/or delete and reinstall?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 21, 2018, 09:42:37 AM
Yup!  That's always the way to update my mods.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Sesquipedalian on February 21, 2018, 02:52:02 PM
Quote from: dougiefresh on February 20, 2018, 10:34:48 PM
@Sesquipedalian:  Upon looking at the SMF 2.1 code, I couldn't agree with your suggestions more!  So, your suggestions on SMF 2.1 version have been integrated into this version!

Excellent. :)

I also noticed that because the BBCodes you add with this mod have a lot of parameters, you are doing your own parameter handling. That's a good idea in 2.0, since large numbers of parameters could really bog down 2.0's version of parse_bbc(). However, 2.1 significantly improves the performance of BBC parameter parsing (see here (https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Subs.php#L1804-L1806) and here (https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Subs.php#L2319-L2385)) and adds the ability to pass the parsed parameters directly to a BBC's validate function (see, e.g., the attach BBC's validate function here (https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Subs.php#L1185-L1231)). You might want to consider changing your code to use the standard parameter parsing and validation methods in 2.1. It should make managing and debugging your code much easier in the future.

Quote
Either way, I apologize for my oversight.  Please ignore my suggestion/"half-ass-fix"...

If you are apologizing to me, there's no need. I am completely unharmed by any of this. ;)

However, I do recommend that you do some debugging on the mod to ensure it isn't causing parse_bbc(false) to return null.
Title: Re: Yet Another YouTube BBCode Tag
Post by: -Rock Lee- on February 21, 2018, 03:35:29 PM
I'm not sure at all but note 2 lines without translation, it's little but I'll leave it updated!


Regards ..
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on February 22, 2018, 10:47:02 AM
Uploaded v4.9 - February 22nd, 2018
o Updated Spanish Latin translation, courtsey of Rock Lee (http://www.simplemachines.org/community/index.php?action=profile;u=322597).
Title: Re: Yet Another YouTube BBCode Tag
Post by: alaska_guy on February 23, 2018, 04:05:44 PM
I more than likely missed it...  But where do I specify x and y for width and height so anytime someone posts a youtube video in the forum it always specifies a specific height and width shown so it doesn't take 100% of the screen/post up.

I want a way to statically set every video to this size when I use this code manually.

center][youtube width=640]https://www.youtube.com/watch?v=C0DPdy98e4c[/youtube][/center]

It looks like maybe this snippet of code from the BBCode-YouTube2.css?

{
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   position: absolute;
}
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dwev on February 24, 2018, 03:55:06 AM
Quote from: alaska_guy on February 23, 2018, 04:05:44 PM
I more than likely missed it...  But where do I specify x and y for width and height

Admin > Configuration > Modification Settings

Default width used for YouTube bbcode when not specified

and

Use 0 to use responsive video display
Title: Re: Yet Another YouTube BBCode Tag
Post by: rustava on March 04, 2018, 09:50:13 AM
dougiefresh Hi!

Install mod Yet Another YouTube BBCode Tag in the SMF 2.1 Beta 4 (and SMF 2.1 Beta 3), there are errors:



General Bulletin Board Code:


Install mods:


Any thoughts on how to fix the error?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on March 04, 2018, 10:45:43 AM
Uploaded v4.10 - March 4th, 2018
o Fixed issue where BBC manager didn't show any tags.




@rustava:  Finally located why the BBC manager wasn't showing any tags....  My auto-embedding code was screwing things up!  O:)
Title: Re: Yet Another YouTube BBCode Tag
Post by: rustava on March 06, 2018, 03:04:20 AM
Quote from: dougiefresh on March 04, 2018, 10:45:43 AM
Finally located why the BBC manager wasn't showing any tags....
Thanks, it works!
Title: Re: Yet Another YouTube BBCode Tag
Post by: aegersz on March 06, 2018, 04:15:03 AM
@dougiefresh:

you do know that many of us look to the Simple Audio and Video Embedder for this solution (that doesn't even require BBCode tags) ?

but hey, it can't hurt.

what i want is a video embedder or (BBCode) to handle what SAVE doesn't - i post countless links to US news and all but one or two actually embed.

a good example is the JW Player and i don't know if it it isn't free to use as a player only.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Dwev on March 06, 2018, 06:31:59 PM
Quote from: aegersz on March 06, 2018, 04:15:03 AMyou do know that many of us look to the Simple Audio and Video Embedder for this solution (that doesn't even require BBCode tags) ?

Yeah, but some people (like me) prefer mods like this one that use BBcode.

I tried Simple Audio and Video Embedder, but didn't like that it works on all links, also the that you don't want to show.

For instance in links under a text, because that immediately becomes a mess.
Title: Re: Yet Another YouTube BBCode Tag
Post by: butch2k on March 07, 2018, 04:47:16 AM
Quote from: aegersz on March 06, 2018, 04:15:03 AM
what i want is a video embedder or (BBCode) to handle what SAVE doesn't - i post countless links to US news and all but one or two actually embed.
I proposed a US News embed to SAVE: https://www.simplemachines.org/community/index.php?topic=395039.msg3964620#msg3964620
Title: Re: Yet Another YouTube BBCode Tag
Post by: Eventeca on March 07, 2018, 07:48:28 AM
Thanks for sharing...
Title: Re: Yet Another YouTube BBCode Tag
Post by: hannes_kann_es on March 07, 2018, 03:09:45 PM
How can I disable auto-embed? I only want it to be embedded with the bbc. Thanks in advance!
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on March 07, 2018, 07:53:30 PM
Quote from: hannes_kann_es on March 07, 2018, 03:09:45 PM
How can I disable auto-embed? I only want it to be embedded with the bbc. Thanks in advance!

Uninstall the mod.  Auto-embed is it's whole point.
Title: Re: Yet Another YouTube BBCode Tag
Post by: hannes_kann_es on March 08, 2018, 12:31:35 AM
Your comment was ... helpful. If that's the whole purpose, the mod should be named "Yet another Youtube autoembed".

Nevermind I figured it out. Remove the call to BBCode_YouTube_Embed($message, $smileys, $cache_id, $parse_tags); in Sources/Subs.php.

Inside that function i find the following
// Is message empty, OR autoembedding links disabled?  If so, return to caller:
if ($message === false || !empty($context['bbc_youtube']['ignore']))
return;

But there is no setting for it?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on March 08, 2018, 10:31:13 AM
Uploaded v4.11 - March 8th, 2018
o Added missing option to disable YouTube bbcodes amongst YouTube options.
o Added new option to disable autoembedding for YouTube links.




@hannes_kann_es: So you want an option to disable auto-embed?  Request granted!
Title: Re: Yet Another YouTube BBCode Tag
Post by: hannes_kann_es on March 08, 2018, 02:00:36 PM
Thank you  :laugh:
Title: Re: Yet Another YouTube BBCode Tag
Post by: kittonium on March 08, 2018, 04:24:04 PM
Hi, can you tell me how I can fix the centering of the video when using ADK Portal?


that's my problem

using it like this..



[center]
[size=16pt][b][color=orange]March 2:[/color][/b][/size]
New Fallout New Vegas Video!!
[youtube]https://www.youtube.com/watch?v=0D7YkLa_VdU[/youtube]
[/center]



BUT, on normal threads (not AdkPortal homepage) the stuff displays fine
Title: Re: Yet Another YouTube BBCode Tag
Post by: kittonium on March 08, 2018, 04:33:16 PM
also, seems to ignore width and height parameters if the post is in the adk portal
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on March 14, 2018, 09:44:01 PM
dougie - good on you for the update :)

kitto - that's a question you would need to ask in the support for ADK portal.
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on March 15, 2018, 05:48:25 PM
Quote from: kittonium on March 08, 2018, 04:24:04 PM
Hi, can you tell me how I can fix the centering of the video when using ADK Portal?
Quote from: kittonium on March 08, 2018, 04:33:16 PM
also, seems to ignore width and height parameters if the post is in the adk portal
I will look into both issues.
Title: Re: Yet Another YouTube BBCode Tag
Post by: kittonium on March 16, 2018, 02:22:25 PM
Quote from: dougiefresh on March 15, 2018, 05:48:25 PM
I will look into both issues.

Thank you! Can't wait  O:)
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on April 08, 2018, 10:55:01 AM
Uploaded v4.12 - April 8th, 2018
o Fixed issue with ADK Portal that prevented video from being shown at proper size.




@kittonium:  Sorry about the wait!  I believe the issue you reported is fixed.  Let me know if it rears it's ugly head again!  Thanks!
Title: Re: Yet Another YouTube BBCode Tag
Post by: kittonium on April 08, 2018, 12:24:32 PM
Quote from: dougiefresh on April 08, 2018, 10:55:01 AM
Uploaded v4.12 - April 8th, 2018
o Fixed issue with ADK Portal that prevented video from being shown at proper size.




@kittonium:  Sorry about the wait!  I believe the issue you reported is fixed.  Let me know if it rears it's ugly head again!  Thanks!

Thanks a lot :D
Title: Re: Yet Another YouTube BBCode Tag
Post by: wtfwtf on April 09, 2018, 05:47:09 AM
it is trying to embed the youtube channels how to fix that ?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on April 09, 2018, 03:07:35 PM
Surround the URL like this: [url]{url}[/url].  The mod's auto-embed code should NOT attempt to add the youtube tags to the URL.
Title: Re: Yet Another YouTube BBCode Tag
Post by: aegersz on April 30, 2018, 06:45:29 AM
i have installed this because of my "doug addiction" ... thanks mate, i have added this to my forum for anybody that wishes to tailor their youtube experience.
Title: Re: Yet Another YouTube BBCode Tag
Post by: mlaket on May 08, 2018, 07:28:21 PM
my website is having problems with this package, I don't have any backups too, please help me to fix it

it says: "Call to undefined function BBCode_YouTube_Embed()"

Edit: website just started to work again after I replaced subs.php in sources folder with original file
Title: Re: Yet Another YouTube BBCode Tag
Post by: -Rock Lee- on May 10, 2018, 09:50:09 AM
I'm going with some lag but I'll update the translations :laugh:


Regards!
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on May 21, 2018, 10:49:09 PM
Uploaded v4.13 - May 21st, 2018
o Updated Spanish Latin translation, courtsey of Rock Lee (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@Rock Lee:  Thanks for the update!  It's been included in this version!
Title: Re: Yet Another YouTube BBCode Tag
Post by: StarredSkies on June 19, 2018, 08:52:46 PM
Hello! I recently got this modification for my website and for awhile autoplay was working, but with the update recently, the autoplay option has stopped working. Any idea why?
Title: Re: Yet Another YouTube BBCode Tag
Post by: GigaWatt on June 19, 2018, 09:59:13 PM
With v4.13 ???. It's only got language files added, there are no code updates.
Title: Re: Yet Another YouTube BBCode Tag
Post by: StarredSkies on June 26, 2018, 12:45:10 PM
Actually, Google disabled autoplay from their browser, so it's no longer a thing that works. :(
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
Title: Re: Yet Another YouTube BBCode Tag
Post by: GigaWatt on June 26, 2018, 07:47:42 PM
Finally... thank god O:).
Title: Re: Yet Another YouTube BBCode Tag
Post by: alaska_guy on July 20, 2018, 01:21:25 AM
How can I set a dedicated width and height for all embedded youtube videos posted?  I do not want it to take up the entire screen.  IE:  Can i change the code somewhere so it always posts embedded videos at say 640x480?
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on August 15, 2018, 10:54:44 PM
Quote from: alaska_guy on July 20, 2018, 01:21:25 AM
How can I set a dedicated width and height for all embedded youtube videos posted?  I do not want it to take up the entire screen.  IE:  Can i change the code somewhere so it always posts embedded videos at say 640x480?
You should be able to set the default height and width for these bbcodes in Admin => Configuration => Modification Settings => Miscellaneous.

Quote from: StarredSkies on June 26, 2018, 12:45:10 PM
Actually, Google disabled autoplay from their browser, so it's no longer a thing that works. :(
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
That's unfortunate.  I'm not going to remove the parameter, as doing so will screw up any posts using that parameter.....
Title: Re: Yet Another YouTube BBCode Tag
Post by: StarredSkies on August 16, 2018, 11:45:34 PM
That's exactly why I haven't removed the parameter yet. I wish I could, but it'd definitely mess up a few things on site, sadly...
Title: Re: Yet Another YouTube BBCode Tag
Post by: dougiefresh on November 09, 2018, 04:37:15 PM
Uploaded v4.14 - November 9th, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Argon3000 on November 28, 2018, 07:33:31 AM
Quote from: dougiefresh on December 10, 2014, 06:09:01 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3982)



YET ANOTHER YOUTUBE BBCODE TAG v4.14
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3982)




Hello!

SMF 2.0.15 + Yet Another YouTube BBCode Tag 4.14 on PHP 5.6 mod work.

SMF 2.0.15 + Yet Another YouTube BBCode Tag 4.14 on PHP 7.0 mod does not work.
On-screen text Youtube: "An error occurred. Please try again later (playback ID=...)"

Please, help?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Plissken on December 04, 2018, 02:07:12 PM
[yt]s9UCRKf6IU0[/yt] Works well, but It's possible?:
[youtube]s9UCRKf6IU0[/youtube]
Title: Re: Yet Another YouTube BBCode Tag
Post by: GigaWatt on December 14, 2018, 11:48:25 PM
Yes it works. Tested it on my forum ;).
Title: Re: Yet Another YouTube BBCode Tag
Post by: petewadey on February 15, 2020, 09:36:08 AM
Whilst checking I have the latest version of this mod, I notice it should be 4.14. My installed version says it's 4.7. Any idea why this should be?
Title: Re: Yet Another YouTube BBCode Tag
Post by: big red on February 16, 2020, 12:21:31 PM
   Thanks for your efforts!

  Could anyone tell me what the last setting is as the text is missing?
Title: Re: Yet Another YouTube BBCode Tag
Post by: grandseb59 on April 17, 2020, 07:14:36 PM
Quote from: big red on February 16, 2020, 12:21:31 PM
  Could anyone tell me what the last setting is as the text is missing?

I was just wondering the same thing.
And since no one answered, I'm going back up the topic to have a chance to get an answer.  ;)
Title: Re: Yet Another YouTube BBCode Tag
Post by: Paulo.chon on August 01, 2021, 11:20:46 AM
Quote from: big red on February 16, 2020, 12:21:31 PM
    Could anyone tell me what the last setting is as the text is missing?

"Disable YouTube autoembed"

Just try!

In Themes/default/languages/index.english.php you should have

$txt['youtube'] = 'YouTube';
$txt['yt_search'] = 'YouTube Search';
$txt['yt_user'] = 'YouTube User';
$txt['youtube_link_invalid'] = '[ Invalid YouTube link ]';
$txt['youtube_no_embed'] = 'Show YouTube videos as a link.';
$txt['youtube_disable_autoembed'] = 'Disable YouTube autoembed.';
Title: Re: Yet Another YouTube BBCode Tag
Post by: Paulo.chon on August 01, 2021, 11:52:44 AM
French translation:

In Themes/default/languages/ManageSettings.french-utf8:

// Traduction de Yet Another YouTube BBCode Tag mod
$txt['youtube_default_width'] = 'Largeur par défaut utilisée pour le BBCode YouTube lorsqu\'elle n\'est pas spécifiée<div class="smalltext">Mettre <strong>0</strong> pour utiliser l\'affichage vidéo responsive</div>';
$txt['youtube_default_height'] = 'Hauteur par défaut utilisée pour le BBCode YouTube lorsqu\'elle n\'est pas spécifiée<div class="smalltext">Mettre <strong>0</strong> pour utiliser l\'affichage vidéo responsive</div>';


In Themes/default/languages/index.french-utf8.php:

// Traduction de Yet Another YouTube BBCode Tag mod
$txt['youtube'] = 'YouTube';
$txt['yt_search'] = 'Recherche YouTube';
$txt['yt_user'] = 'Utilisateur YouTube';
$txt['youtube_link_invalid'] = '[ Lien YouTube non valide ]';
$txt['youtube_no_embed'] = 'Montrer les vidéos YouTube comme des liens';
$txt['youtube_sig_embed'] = 'Autoriser les vidéos YouTube dans les signatures';
$txt['youtube_disable_autoembed'] = 'Désactiver l\'insertion automatique YouTube';


Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on September 07, 2021, 01:01:50 AM
I see this was updated for 2.1RC2 but doesn't RC2.1 now include the functionality of this mod as core?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Arantor on September 07, 2021, 05:02:24 AM
I don't think *everything* is covered, pretty sure core just does a simple video embed, not a full blown embed of playlists etc.
Title: Re: Yet Another YouTube BBCode Tag
Post by: kapt on December 25, 2021, 05:49:02 AM
When members tick this box, youtube bbcodes in the Modify section is removing. How can I solve it? I want to remove
'Show YouTube videos as a link.'
option. Members should not change this in the Look and Layout settings.







and it is not showing as a link.



Title: Re: Yet Another YouTube BBCode Tag
Post by: si-biest on January 17, 2022, 02:09:57 PM
I want to make the video window be indented to the right by one space, how to do it in which file to change the code?
Title: Re: Yet Another YouTube BBCode Tag
Post by: landyvlad on February 09, 2022, 07:33:04 PM
I see its noted as compatible with 2.1RC2

With the release now of 2.1.0 is it compatible for use with no further changes necessary?
Title: Re: Yet Another YouTube BBCode Tag
Post by: CrescentEclipse on February 10, 2022, 12:21:17 PM
Has anyone an idea what happened to Dougiefresh? Is he alright?

As of today I do not use v2.1, so unfortunately I cannot give any feedback in that direction.
But I identified some issues with the current release.
One of them, like kapt also figured out, is the broken "show as link" feature.
So I created my own bug fix release, but I am not sure if I am allowed to share it.

Nonetheless, here is the changelog:

v4.14.1 - February 10th, 2022
Title: Re: Yet Another YouTube BBCode Tag
Post by: Diego Andrés on February 10, 2022, 12:35:30 PM
Quote from: CrescentEclipse on February 10, 2022, 12:21:17 PMSo I created my own bug fix release, but I am not sure if I am allowed to share it.

I suppose you can

QuoteRedistribution 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.
Title: Re: Yet Another YouTube BBCode Tag
Post by: CrescentEclipse on February 10, 2022, 01:27:30 PM
Hm, you are right.
Now I just need to know how I can do that xD
It seems file uploads are not allowed, at least for me.
Title: Re: Yet Another YouTube BBCode Tag
Post by: Diego Andrés on February 10, 2022, 02:21:50 PM
I'm sure you can attach the files in your post
Title: Re: Yet Another YouTube BBCode Tag
Post by: CrescentEclipse on February 10, 2022, 03:09:36 PM
Hm, either I was blind or the dropdown menu was not there before o..O
Whatsoever, here is my modified version.
Please be aware that I do not give any guarantee.
Title: Re: Yet Another YouTube BBCode Tag
Post by: agagames on September 27, 2022, 06:23:55 PM
URL parsing doesn't seem to work correctly on SMF 2.1.2.  Of the following tags, only the third actually works, those with the full URL show an error message in a YouTube iFrame.


[youtube]https://www.youtube.com/watch?v=1Ml_DR76Cl4[/youtube]

[youtube]https://www.youtu.be/watch?v=1Ml_DR76Cl4[/youtube]

[youtube]1Ml_DR76Cl4[/youtube]


Exactly the same seems to happen here, so perhaps this is clashing with some new inbuilt YouTube support in v2.1?
Title: Re: Yet Another YouTube BBCode Tag
Post by: Steve on September 28, 2022, 06:09:49 AM
The mod wasn't written for 2.1.2 ... it will need to be updated to work correctly.