• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[Add More Video Sites] BB Code Media

Is there a way to get an Amazon.com embedder but make it so that any amazon link from anyone will credit my amazon affiliates account? This would be a great way for any site owner to make extra cash without "advertising"...
 
Is embedding TrailerAddict video's possible with the new XF 1.1 system? I had a go at it, but I did not manage to get it working. Example video: http://www.traileraddict.com/trailer/hugo/trailer
Yup thanks to Jake I got this working today...

Upload the contents of the zip archive below to your library folder and then (add BB Code Media Site) with the following data.



Media Site ID: ta
________________________________________
Site Title: Trailer Addict
________________________________________
Site URL: http://www.traileraddict.com/
________________________________________
Match URLs: #traileraddict\.com/(?P<id>(trailer|clip)/[\-a-z0-9_]+/[\-a-z0-9_]+)(\?.*)?$#siU
________________________________________
Embed HTML: <See HTML Callback>
________________________________________
Regular Expression Matching: Checked
________________________________________
Embed HTML Callback: MediaSites_TrailerAddict::buildEmbed

PHP:
<?php
 
class MediaSites_TrailerAddict
 
{
 
    public static function buildEmbed($mediaKey, array $site)
 
    {
 
        // CAPTURE WEB PAGE
 
        $pageHtml = file_get_contents('http://traileraddict.com/' . $mediaKey );
 
        // ISOLATE THE TRAILER ID FROM THE META TAG
 
        if(preg_match('#<meta property="og:video" content="http://www\.traileraddict\.com/emd/(?P<trailerid>[0-9]+)" />#si', $pageHtml, $match))
 
        {
 
            // DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLE __MEDIAKEY__
 
            $embedHtml = '<object width="450" height="245">
 
            <param name="movie" value="http://www.traileraddict.com/emd/__MEDIAKEY__"></param>
 
            <param name="allowscriptaccess" value="always"><param name="wmode" value="transparent"></param>
 
            <param name="allowFullScreen" value="true"></param>
 
            <embed src="http://www.traileraddict.com/emd/__MEDIAKEY__" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" width="450" height="245" allowFullScreen="true"></embed>
 
            </object>';
 
            // MAKE THE REPLACEMENTS
 
            $finalHtml = str_replace('__MEDIAKEY__', $match['trailerid'], $embedHtml);
 
            // RETURN THE FINISHED HTML
 
            return $finalHtml;
 
        }
 
        // RETURN NOTHING IF NO MATCH
 
        return '';
 
    }
 
}
 

Attachments

made one small edit to the code above:
use this..

Match URLs: #http://www\.traileraddict\.com/(?P<id>trailer/[a-z0-9\-] /(trailer|blu-ray-trailer))#siU
 
made one small edit to the code above:
use this..

Match URLs: #http://www\.traileraddict\.com/(?P<id>trailer/[a-z0-9\-] /(trailer|blu-ray-trailer))#siU
Thank you, I got it working with your help.

However, I find the regular expression you used a little limiting. What about this one, it should let you embed ALL Traileraddict video's:

Match URLs: #http://www\.traileraddict\.com/(?P<id>trailer/[\-a-z0-9_]+/[\-a-z0-9_]+)(\?.*)?$#siU
 
Thank you, I got it working with your help.

However, I find the regular expression you used a little limiting. What about this one, it should let you embed ALL Traileraddict video's:

Match URLs: #http://www\.traileraddict\.com/(?P<id>trailer/[\-a-z0-9_]+/[\-a-z0-9_]+)(\?.*)?$#siU


Well it seems to work...nice.

I didn't think there was any more extensions to the trailer urls other than trailer/movie-name/trailer and trailer/movie-name/blu-ray-trailer hence why i did the trailer|blu-ray-trailer and my worry was I don't know their entire url structure so I don't know if there are any pages whos urls might get caught in there.

To your credit...I still haven't seen a url that would cause a false match so I would feel comfortable with your expression. It does look like nothing but trailer pages are prefixed with trailer/ so I would say it is safe to assume for now that your expression covers it safely with less characters.

Do you know if TrailerAddict has any other types of trailers other than trailer or blu-ray-trailer?



edit Updated Media Site
 
Do you know if TrailerAddict has any other types of trailers other than trailer or blu-ray-trailer?

Yes, they have many more, and the URLs can end in all kind of ways, like '/making-of'. They have featurettes, interviews, etc, hence the need for a more flexible regular expression. Which, btw, I adopted from this post by Jake Bunce, so credit goes to him ;)
 
Ahhh I did not know that...well great then. :-)

And it is funny isn't it....all roads seem to lead to Jake Bunce :ROFLMAO:
 
I've go a problem with one user, who permanently paste youtube links into threads.
How to disable permission to add bbcode media sites for that user?
Is it possible?
 
I noticed that XenForo only supports sites with one ID when it comes to BBCodes, is there any chance XenForo could add the functionality to have multiple ID's?

E.g. {$id} & {$id2}

Match URL: mixcloud.com/{$id}/{$id2}

Embed Code:

HTML:
<div>
<object width="100%" height="500">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}/{$id2}/&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard">
<param name="allowFullScreen" value="true"><param name="wmode" value="opaque">
<param name="allowscriptaccess" value="always">
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}/{$id2}/&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="100%" height="500"></object>

Im asking this because Mixcloud's embed code requires 2 unique IDs, the first being the Mixcloud username, the second being the title of the mix.
 
Match URL:
mixcloud.com/{$id}

Use this embed code:
Code:
<div>
<object width="100%" height="500">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard">
<param name="allowFullScreen" value="true"><param name="wmode" value="opaque">
<param name="allowscriptaccess" value="always">
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="100%" height="500"></object>

I just grabbed a song of the front page to test... here's the URL.

http://www.mixcloud.com/aboveandbeyond/above-beyond-tatw-400-live-in-beirut/

Place aboveandbeyond/above-beyond-tatw-400-live-in-beirut/ into the bbcode.

bbcode:
Code:
[media=mixcloud]aboveandbeyond/above-beyond-tatw-400-live-in-beirut/[/media]
 
I decided to try something here...anyone is welcome to try it...if no one finds problems with the copy paste I will try and catalog all the known working media site definitions and finish the interface I am working on for it.

This is the mockup...but should work for copying the values to be pasted into the fields for a media site bbcode...
http://xenxero.com/xxbB_copy/another.html
is a click to copy page for the values of the media site definition.
http://xenforo.com/community/threads/add-more-video-sites-bb-code-media.7608/page-12#post-294463

Send a msg to my inbox if you like it, love it, or hate it. It is relevant to this thread , but not enough where it warrants convo about it here.
 
Dorkly:

Match URL:
Code:
dorkly.com/video/{$id:alphanum}/

Embed HTML:
HTML:
<object id="dorkly{$id}" type="application/x-shockwave-flash" data="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={$id}&use_node_id=true&fullscreen=1" width="600" height="338"><param name="allowfullscreen" value="true"/>
    <param name="wmode" value="transparent"/>
    <param name="allowScriptAccess" value="always"/>
    <param name="movie" quality="best" value="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={$id}&use_node_id=true&fullscreen=1"/>
    <embed src="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={$id}&use_node_id=true&fullscreen=1" type="application/x-shockwave-flash" wmode="transparent" width="600" height="338" allowScriptAccess="always">
</embed>
</object>

Funny or Die:

Match URL:
Code:
funnyordie.com/videos/{$id:alphanum}/

Embed HTML:
HTML:
<iframe src="http://www.funnyordie.com/embed/{$id}" width="640" height="400" frameborder="0"></iframe>
 
Top Bottom