bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

Plugin: YouTube in bbPress

(20 posts)
  • Started 1 year ago by Trent
  • Latest reply from chrishajer
  • This topic is not resolved
  1. First off, an example can be found here. Download the bbPress YouTube plugin! Now the disclaimer.......

    This plugin will only Key Masters and Administrators to put YouTube videos into posts. Why only those two groups you might ask? Well, because this plugin right now allows ALL embeds and objects out there to be put into your forum posts and I thought this might be a bit much for the general public! This plugin was started by myself and then mdawaffe finished it off for me. Nothing special, but the next version will have the code to only only YouTube videos in an easy way, but for now you need the entire embed code from YouTube, like this:

    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/lh5316fcit0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/lh5316fcit0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

    If you decide to take out the conditional for adminstrators, do so at your own risk! It is nothing special, but at least will do until we can get a better version!

    Enjoy!

    Trent

    Posted 1 year ago #
  2. I have managed to embed all kinds of things! Fun actually!

    http://onvertigo.com/topic/media-types-played-in-this-forum?replies=9

    Trent

    Posted 1 year ago #
  3. So in the next version like:
    <youtube>linktothevideo</youtube> ??

    Posted 1 year ago #
  4. It will be more like how wordpress.com does it:

    [youtube=videolink]

    Trent

    Posted 1 year ago #
  5. Hey Trent,

    How can I set this so Moderators can also post youtube videos.

    Thanks,
    Orion

    Posted 1 year ago #
  6. Off the top of my head, change this line:

    if (bb_current_user_can('administrate')) :

    to something like this:

    if (bb_current_user_can('moderate')) :

    That should get it working!

    Trent

    Posted 1 year ago #
  7. Beautiful! It works, thanks.

    Posted 1 year ago #
  8. scott11
    Member

    If you need to know some different ways to integrate Youtube, check out this
    site at soulcast.com [link edited by trent]

    Posted 1 year ago #
  9. How does that help integrate youtube into bbPress? That is just a site that now allows its members to integrate youtube into their site. I would recommend just using this one.

    Trent

    Posted 1 year ago #
  10. Beer
    Member

    Testing it out here:
    http://www.grindhouse.com/forums/topic/31

    Will come in handy for the site as it grows. Thanks!

    Posted 1 year ago #
  11. nolageek
    Member

    has anyone tried hacking this to limit the types of embeds.. say, make sure it's only from x-tube/youtube/etc... maybe a url check?

    Posted 10 months ago #
  12. I second nolageek's request :)

    Posted 9 months ago #
  13. Anyone have allow-youtube.zip? The link at the top is 404'ing.

    Thx

    Posted 9 months ago #
  14. i don't think it's just that link the entire plugin database seems to be down. but hopefully back up soon?

    Posted 9 months ago #
  15. I use this plugin ported from a Vanilla Extension:

    <?php
    /*
    Plugin Name: Video Tags
    Plugin URI: http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=33
    Description: Ported from SirNot's HtmlFormatter for Vanilla
    Author URI:
    Version: 0.1
    */
    
    //allow youtube and google videos to be posted, tags are:
    //<video type="google">docid</video> (google video) -or-
    //<video type="youtube">video id</video> (youtube) -or-
    
    function video_embed($texto){
                    $sReturn = preg_replace_callback(
                                    '/<video(?>\s+)type=(["\'
    ])((?>\w+))\1(?>\s*)>([A-Za-z\-_\d]+?)<\/video>/is',
    'VideoLink',
    $texto
    );
    return $sReturn;
    }

    function VideoLink($Matches)
    {
    $Type = strtolower(trim($Matches[2]));
    $ID = $Matches[3];

    switch($Type)
    {
    case 'google' : return ('<embed style="width: 400px; height: 326px;" id="VideoPlayback" '.
    'type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='.$ID.'"></embed>');

    case 'youtube' : return ('<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$ID.'"></param>'.
    '<embed src="http://www.youtube.com/v/'.$ID.'" type="application/x-shockwave-flash" width="425" height="350"></embed>'.
    '</object>');

    default : return $Matches[0];
    }
    }

    function allow_video_tags( $tags ) {
    $tags['video'] = array('type' => array('maxlen' => 10));
    return $tags;
    }

    add_filter( 'bb_allowed_tags', 'allow_video_tags' );
    add_filter( 'post_text', 'video_embed' );

    ?>
    `

    It allows you to embed video only from YT or Google Video.

    Posted 9 months ago #
  16. andrew79
    Member

    Link doesnt work. 404 error. Anyone have the plugin somewhere else?

    Posted 9 months ago #
  17. I managed to destroy this one and with a server crash and just haven't rewrote it yet, but if you head over to http://bbpress.org/plugins/topic/55?replies=8 that plugin will do the same thing ;)

    Trent

    Posted 9 months ago #
  18. andrew79
    Member

    Great , Thanks trent

    Posted 9 months ago #
  19. bboysmaster
    Member

    How to change it to all user can post embed object?

    Posted 1 month ago #
  20. If you look at the plugin, it's pretty simple. Line 12:
    if (bb_current_user_can('administrate')

    If you want to allow other users to do everything that this plugin allows, you would need to change 'administrate' to whatever permission your users have. I am not going to post exactly how to do it, since I think it could be a potential security hole, but that line right there is the key. Take a look at the plugin and see what I mean.

    http://bbpress.org/plugins/topic/admin-can-post-anything/

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.