Customizing SMF > Modifications and Packages

[Deprecated, use Aeva] YouTube BBCode v2.6

(1/104) > >>

Nao 尚:
Link to Mod

THIS MOD IS DEPRECATED. USE AEVA INSTEAD.

YOUTUBE BBCODE v2.6
Updated by Nao
Created By Karl Benson
Support Topic | Donate
Compatibility
For SMF 1.1.x and SMF 2.x (MySQL only)

Introduction
Embed Youtube videos into posts with the use of [youtube][/youtube] bbcode.

It's the ultimate friendly YouTube mod for BBCode addicts, supporting various link formats (including Playlist links), safely and securely parsing the information for the piece of mind of forum admins.
It is, however, severely outdated when compared with its successor, Aeva, which has support for many more video websites and many more options.

So, if you want to be able to directly post YouTube URLs without tags and still have them embedded, I would recommend upgrading to Aeva or Aeva Media. Check its package file to find a conversion script inside it. It also converts tags from many other older mods such as [ytplaylist] or Google Video BBCode, etc.
Just extract the conversion script via FTP to your directory where SMF runs from. Put your forum in maintenance mode, and then point to it in your browser.

Features
o Adds a BBCode Button to Insert [youtube][/youtube] bbcode.
o Supports standard YouTube videos and YouTube playlists
- Standard: eg http://www.youtube.com/watch?v=FJ2UzCZiKgT
- Playlist: eg http://www.youtube.com/view_play_list?p=595A40209CB17411
o Supports links from YouTube's global site, and several localized sites (if you need support for all localised sites, use Aeva instead)
 > Global (with or without www.) | Brasil | France | India | Ireland | Israel | Italia | Japan | Nederland | Polska | Espana | United Kingdom
 > Australia | Hong Kong | Mexico | New Zealand | Deutsche | Canada | Russia | Taiwan | South Korea
o Supports various formats
- YouTube Page url
- Direct Embed url
- ID only
o Specify sizes (Optional)
- eg [youtube=425,350][/youtube]
- Defaulting to default YouTube sizes if not specified
- Size Protection to prevent embedding videos larger than 780px or less than 100px
o Safe from a security standpoint
- Properly validates/sanitizes/parses the video id before including it in the url
- Disables script access (allowScriptAccess="never")
o Alternative link and/or text provided for
- Invalid video id/links
- Printer friendly versions
- Disabled bbcoded
- Disabled flash
o Supports the following languages (both in ISO and UTF modes)
- English, British, Brazilian, French, German, Italian, Polish, Portuguese, Spanish, Swedish and Turkish.

Installation

Any previous versions of this mod need to be uninstalled prior to installing this version.

Installation slightly varies depending on SMF version.

SMF 1.1.1 to 1.1.4 & SMF 2.0 Beta 1
Installing the mod will only fully install the mod on the SMF Default Core Theme.
For all other themes which have a custom Post.template.php a manual edit will be required to add the BBCode Button.
(SMF 2.0 Beta 1 Only) You can choose to have the SMF Package Manager attempt* to perform the manual edit on all themes.

FIND

--- Code: --- 'flash' => array('code' => 'flash',
--- End code ---
ADD BEFORE

--- Code: --- 'youtube' => array('code' => 'youtube', 'before' => '[youtube]', 'after' => '[/youtube]', 'description' => $txt['youtube']),
--- End code ---

You will also need to place a copy of the youtube.gif in each of your themes bbc image folders (eg Themes/{themename}/images/bbc)

If you're using a language different than the ones supported this mod (listed above), then you will need to add the following to the Modifications.{language}.php for each theme (The language folder can be found eg Themes/{themename}/languages/)

FIND

--- Code: ---?>
--- End code ---
ADD BEFORE (and translate as necessary the language strings)

--- Code: ---$txt['youtube'] = 'YouTube';
$txt['youtube_invalid'] = '#Invalid YouTube Link#';
--- End code ---

SMF 2.0 Beta 2 / Beta 3 / Beta 3 Public / RC 1
Since SMF 2.0 Beta 2, the BBCode buttons have been moved from the templates and into the source files.
Therefore no manual edits will normally be required. Installing the mod will automatically install it on ALL themes.

However you will still need to place a copy of the youtube.gif in each of your themes bbc image folders (eg Themes/{themename}/images/bbc)

And if your using a language different than the ones supported this mod (listed above), then you will need to add the following to the Modifications.{language}.php for each theme (The language folder can be found eg Themes/{themename}/languages/)

FIND

--- Code: ---?>
--- End code ---
ADD BEFORE (and translate as necessary the language strings)

--- Code: ---$txt['youtube'] = 'YouTube';
$txt['youtube_invalid'] = '#Invalid YouTube Link#';
--- End code ---

Useful Links
Manual Installation Of Mods
How Do I Modify Files?

Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Changelog
2.6 - 5th February 2010
o Ownership given to Nao
o Updated readme and description
o Added French Language (translated by Nao)
o Added support for SMF 2.0 RC2 (eh, finally...?)
2.5 - 24th April 2009
o Ownership given to Runic
o Added Dutch Language (translated by Tom Te Selle)
2.4 - 5th October 2008
o Ensured compatible with SMF 2.0 Beta 4 and SMF 1.1.6
o Added YouTube FullScreen parameter (so player shows full screen button)
o Fixed encoded ampersands as &
o Added Support for YouTube India (in), South Korea (kr) and Israel (il)
o Moved all language strings into a single file [languagestrings.xml] (save repetition) in the package
2.3 - 18th March 2008
o Ensured compatible with SMF 2.0 Beta 3 Public
o Added Polish language strings (Thanks to Nolt)
2.2 - 21st February 2008
o Added &rel=1 to all embed links as YouTube seesm to require it now.
2.1 - 31st January 2008
o Support for YouTube Playlist links
o Optimized preg and rewrote regex
o Changed max size supported to 780px
o Now builds the object based on browser

karlbenson:
Troubleshooting
Blank Button - The Icon is Missing
Are you using the SMF default core theme? If the answer is NO.
You will also need to place a copy of the youtube.gif in each of your themes bbc image folders (eg Themes/{themename}/images/bbc)

No YouTube Button whatsoever
Are you using the SMF default core theme? If the answer is NO.
This mod only installs onto the SMF default core theme (and any theme without a custom Post.template.php)
You need to perform a manual edits listed by the mod (listed under Manual Edits)

Text is Appearing at the top of the page
The language strings were not inserted correctly by SMF due to a possiblel issue with the language file.
Its easy to fix.
open Themes/default/languages/Modifications.english.php

Move ?> to the very bottom (nothing below, not even a newline or space)
Move <?php to the very top (nothing above, not even a newline or space)

(make sure there are no spaces or new lines before or after those bits)
If your using utf8 language set you may also need to do it for Themes/default/languages/Modifications.english-utf8.php

"The message body was left empty." Error Message
Note: Due to a problem/bug in SMF.  If you make a post with only a [youtube] video in it, you will get an "empty message" error because there is no actual content to the post.
However I have posted a Mod to Fix the issue for ALL other video clip embed/type mods.

Already have an old YouTube mod installed?
If you currently use the old YouTube mods by Yakuza, Marlon, Gantman or Daniel Marquard, you are recommended to uninstall those and install this mod instead because those older mods have a 'potential' xss vulnerabilty as they don't validate/parse the data.
Most likely until that old mod is uninstalled, it will prevent this mod automatically installing via the package manager.

Undefined index: youtube
You are missing the language strings for that theme and/or language.

You need to add to your Modifications.{language}.php in each Themes language files

--- Code: ---$txt['youtube'] = 'YouTube';
$txt['youtube_invalid'] = '#Invalid YouTube Link#';

--- End code ---
If your using utf8, you may also need to add the strings to Modifications.{language}-utf8.php

Sakae:
Wonderful job, Karl. Running great in my SMF 1.1.4.

This mod does exactly what a Youtube BBCode should do - no numbers at bbcode ("youtube,420,510" or something like that - I never paid attention at those numbers) and works with http://br.youtube.com.

Here's the translation to brazilian-utf8.


--- Code: ---$txt['youtube'] = 'YouTube';
$txt['youtube_invalid'] = '#Link do Youtube inv&aacute;lido!#';
--- End code ---

Also portuguese and brazilian:


--- Code: ---$txt['youtube'] = 'YouTube';
$txt['youtube_invalid'] = '#Link Youtube inválido!#';
--- End code ---

Best regards

Haunted:
EXCELLENT mod!  Thank you!

tsmalmbe:
Dpenst work for me. Installs OK, but when I use the tag, I just get an "empty" player. If I click the player, it tkaes me to youtube and says video not availanle. I I press reply, Iget the previre pciture of the vidfeo - immediately. Cannot play it thogh.

Navigation

[0] Message Index

[#] Next page

Go to full version