MetaCafe BBCode

Started by N3RVE, July 10, 2008, 08:54:58 AM

Previous topic - Next topic

N3RVE

Link to Mod



MetaCafe BBCodev1.5
By [n3rve]



Compatibility
o SMF 1.1.4
o SMF 1.1.5
o SMF 2.0 Beta 3 Public
o SMF 2.0 Beta 3.1 Public

Introduction
A modification for the use of [metacafe][/metacafe] bbcode to embed MetaCafe videos into posts.

Its the ultimate friendly Metacafe mod, supporting various link formats, safely and securely parsing the information for the piece of mind of forum admins.

Features
o Adds a BBCode Button to Insert [metacafe][/metacafe] bbcode.
o Supports various formats
- Page url
- Direct Embed url
- ID only

o Specify sizes (Optional)
- eg [metacafe=400,345][/metacafe]
- Defaulting to default MetaCafe 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 Languages
- English/English-utf8
- English_British/English_British-utf8
- Brazilian/Brazilian-utf8 (Thanks to Softcore)
- German/German-utf8
- Italian/Italian-utf8 (Thanks to Edi67)
- Polish/Polish-utf8 (Thanks to Nolt)
- Portuguese/Portuguese-utf8 (Thanks to Softcore)
- Spanish/Spanish-utf8 (Thanks to EgAr)
- Spanish_es/Spanish_es-utf8 (Thanks to EgAr)
- Swedish/Swedish-utf8 (Thanks to Hobox)
- Turkish/Turkish-utf8 (Thanks to Cakal93)
I welcome translations for other languages. Please post the translated language strings in the Support Topic.

Installation

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/1.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.

Find
'flash' => array('code' => 'flash',
Add before 'metacafe' => array('code' => 'metacafe', 'before' => '[metacafe]', 'after' => '[/metacafe]', 'description' => $txt['metacafe']),

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

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
?>
Add before (and translate as necessary the language strings)
$txt['metacafe'] = 'MetaCafe';
$txt['metacafe_invalid'] = '#Invalid MetaCafe Link#';


SMF 2.0 Beta 2/2.1/3/3 Public
From 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 metacafe.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
?>
ADD BEFORE (and translate as necessary the language strings)
$txt['metacafe'] = 'MetaCafe';
$txt['metacafe_invalid'] = '#Invalid MetaCafe Link#';


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

Support
Please use the modification thread for support with this modification.

Changelog
1.3 - 9th February 2008
o Optimized preg and rewrote regex
o Changed max size supported to 780px
o Now builds the object based on browser
1.4 - 21st March 2008
o Ensured compatible with SMF 2.0 Beta 3 Public
o Added Polish language strings (Thanks to Nolt)
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

Hoochie Coochie Man

Thanks for the mod, but "auto embed video/audio clips" make this job anyway  ::)
İnadına SMF 1.1.X

N3RVE

Quote from: Hoochie Coochie Man on July 11, 2008, 01:59:04 PM
Thanks for the mod, but "auto embed video/audio clips" make this job anyway  ::)

Yes it does, but they're people who just want to embed MetaCafe videos.
Took this over from Karl for active dev. as he had to many to handle.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

karlbenson

There can be a use for this is you like to specify different sizes.

jayc7176

Many Many thanks for this nice and quick mod
I cannot teach anybody anything, I can only make them think -  Socrates™ 469 BC

SMF- 1.1.5

Apllicmz




brion

Every time I put in a video url, I get the invalid url error. What exactly am I suppose to put in it?

Advertisement: