vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=150863

AME - Auto Media Embedding (youtube, Amazon, google, myspace, etc...)
by The Geek
28 Jun 2007 14:09

4 Attachment(s)
From the inventors of Swiss Cheese and the Egg comes AME - The Automatic Media Embedding System.

Note that Version 2.0.0 can be found here

AME is derived from GAL 6 base code but instead of linking keywords, it converts URLs that users paste or enter in their posts into inline embedded video streams.

Big credit goes out to mfyvie for the original concept that jazzed me up enough to lift code that I have been working on to radically improve his fresh idea. Though the same goal, I have taken a totally different approach to his initial release. This mod is 100% steaming fresh code straight from the Geeks oven of love.

First... the overview

AME scans new and edited posts for pre-defined patterns of URLs (i.e. youtube's). If it finds a match, it swaps the url tag for an ame tag.
When a post get parsed for bbcode and an ame tag is found, instead of hammering away at the post with umpteen bbcodes, AME quietly figures out which pre-defined embedding should be placed there and... viola', you have a pretty little embedded video like this:

Attachment 66927

This is significantly faster, has much lower overhead and is much easier to manage than loads of bbcodes or a than scanning every single post as the user views it to see if there are any conversions that need to be made.

Now for the bells and whistles

AME:
  • is lightweight as it does all of her chores without the overhead of having 1 bbcode per pattern or trying to parse a post every single time it gets displayed with a bunch of patterns. This radically reduces overhead and speeds up the processing. The only time ame will kick in is after creating a new post or after editing an existing one (or if an ame tag is found in a post)
  • is extensible. She allows you to add, edit, delete, import and export patterns. That way you can decide which services to support, how they should look and then share them with others!
  • can extract the title (requires your server to allow url wrappers with fetch_contents)
  • can extract embed code from sites whose URLs do not contain sufficient information to embed the video
  • can rebuild your old posts to convert your 'other' mediaish tags into URL tags.
  • can rebuild your old posts to convert URL tags into ame tags where needed
  • can convert her codes BACK to url codes so you're not stuffed with a bunch of dead tags if you uninstall!
  • won't uglify your site by having videos appear in quotes, php, code or html blocks (blech!)
  • can be globally disabled
  • can be excluded from forums
  • can exclude usergroups
  • can be toggled on/off per post
  • would cook dinner for you if she had arms
  • can wrap the output in a 'container' with original URL
  • has a super comprehensive admincp help system. Yes, I actually took the time to add all the info you need into vB's admincp help system. If you ask a silly question in this thread that is addressed in the help system, you will be taunted.
  • is fully phrased
  • has hooks around integral operations so you can extend it

Add ons

AME comes configured with YouTube, Myspacetv, Google Video, Bolt, iFilm, Yahoo, Dailymotion, Amazon and MetaCafe Support built in. Since the amount of providers are always changing and most sites will only need a particular amount, AME has been designed with an import and export system to allow members to easily share formats with one another. In fact, the second post of this thread is updated periodically to relflect those add ons. Currently there are over 12 more additional formats contributed by AME users. Click here to see them.

Installation
  • Upload the contents of the forums folder into your forums directory and import the product.xml file into your product manager.
  • After installation, make sure that the system is on (admincp->AME CP->Settings)
  • Then you may want to try to rebuild old URLs via the tools option.

Troubleshooting

See this post on troubleshooting

A note about support and such

I have my plate pretty full with taking care of my commercial mods and the support that comes with them. Saying that, I will help when I can - but to be honest, I have ensured that there should be little to no support needed on this mod as it is very much self contained.
Please do not PM or post asking me to give you regexp's to support additional media streams. I built the system so that you can add your own providers as well as the ability to import and export them. If you still need a pattern but are not great with regular expressions (who is?) then I suggest getting RegExpBuddy. Although I am not expert at regular expressions, I did a quick start tutorial on AME regexps here if you want to check it out. I don't mind you guys asking amongst each other for these things, but just note that I will most likely not respond to the requests.

I will reserve the first couple of posts in this thread to periodically add user contributed patterns to import and for additional information (I hate mega long first post's in the release section). So check there for up to date information.

nJoy

The Geek 28 Jun 2007 14:09

This post is for listing updates and upgrade information. The updates will appear in the latest to the oldest

1.2.0 Released 12.07.07 Major update. Discussion for this release (and important upgrade notes) starts here.
  • New features
    • Added the ability to fetch embeded video data
    • Added ability to disable fetching titles/external data both globally AND on an item by item basis
    • Added default support for yahoo, dailymotion and amazon
    • Enhanced default regexps

1.1.3 Released 11.07.07 Minor update. Discussion for this release starts here,
  • Bug Fixes
    • Fixed issue with some versions of php reporting a reference error. A manual fix was posted last week, if you applied that fix or are not having a prolem, there really isnt a reason to update. To upgrade, simply reimport the product xml.

1.1.2 Released 03.07.07 Discussion for this release starts here,
  • Bug Fixes
    • Fixed issue when titles are changed via ajax. WHen these posts do not contain bbcode, the contents of the post could be potentially emptied.
1.1.1 Released 01.07.07 Discussion for this release starts here,
  • Bug Fixes
    • Fixed issues with older versions of php not parsing code
    • Fixed rebuild posts never leaving the first page
1.1.0 Released 29.06.07 Discussion for this release starts here.
  • Bug fixes
    • Fixed annoying bug that left the package setting to 'disabled' by default.
    • Fixed single quotes being left in some bbcodes that AME skips over
    • Enhanced the regular expressions to take into account other parameters
    • Fixed bug with importing a single definition
  • New features
    • Added the ability to fetch video titles
    • Changed the replacements and container HTML to use variables rather than back references. In other words, instead of placing \1 in your replacement, you would now put $p1. You can have up to 5 back references this way ($p1, $p2, $p3, $p4 and $p5). You can also use $url and $title in the container and the replacement.
    • I had to re-wipe the default definitions to make the changes outlined above. If you had tweaked your definitions, you will need to do so again.

Note that by default, the new 'Resolve URL titles' option is on. Some servers lock down the ability to use fetch_contents with url's. If your server has this restriction, then this feature will not work and you will need to disable it (or get your host to enable it). How will you know if you need to disable it? If your posts seem to hang when creating/editing a post with a matching URL in it.

The Geek 28 Jun 2007 14:10

2 Attachment(s)
Reserved for user contributed definitions to import into AME.

User contributed:

Videotube And Liveleak -VideoTube contributed by René Kunze and the LiveLeak contributed by DaNIEL MeNTED. I contributed a couple of very minor tweaks to some of the regexps.

Other:

puertoblack2003 28 Jun 2007 14:29

thanks will try this out:up:

dinodonk 28 Jun 2007 14:32

thanks! downloaded

Error
by eurofunny
28 Jun 2007 14:59

Hi,

installed and then comes this error when i post a thread with youtube url or other contents........hack disabled at the moment........


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


The Geek 28 Jun 2007 15:06

hmmm. What version of php are you on?

eurofunny 28 Jun 2007 15:07

Quote:

Originally Posted by The Geek (Post 1278408)
hmmm. What version of php are you on?

4.4.7

Lizard King 28 Jun 2007 15:08

Perfect idea Sam :)

René Kunze 28 Jun 2007 15:25

Hello, unfortunately I get now an error if I a new topic or contribution provide:

Quote:

Warnung: Missing argument 2 for ame_prep_text(), called in /home/mars14/public_html/vb/includes/functions_newpost.php(524) : eval()'d code on line 191 and defined in /includes/ame_bbcode.php (Zeile 152)
Unfortunately I do not have notion like I these sides in chop to merge can.
http://video.google.de/
http://www.myvideo.de/
http://www.videotube.de/
http://www.clipfish.de/

Can help their me there.

The Geek 28 Jun 2007 15:26

@Euro - Can you redownload and install? str_ireplace is a PHP 5 function so I changed the code to use str_replace instead. I also took care of the other error. Let me know how you get on :)

@Liz - thanks man - it wasnt exactly mine - but I did it in a cool way ifidontmindsayingsomyself :)

The Geek 28 Jun 2007 15:27

@Rene: Redownload, sounds like the same problem as euro. Just fixed it 2 seconds ago :)

Lizard King 28 Jun 2007 15:30

Sam it is unfortunately not working. You can check here I even disabled all other media hacks to check it out. Change execution order in each plugin to 3 just to make sure not conflicting with vBSEO.

Mastar 28 Jun 2007 15:41

It didn't work for me either.. mine look like Lizard King's post.

René Kunze 28 Jun 2007 15:43

Unfortunately it does not function.

If I these left: http://www.youtube.com/watch?v=c949S08LIHY

Into a contribution copy converts it it into URL, but not into a video.


All times are GMT. The time now is 17:26.

Powered by vBulletin® Version 3.8.13
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.