English: Converts Video-Links in your forum posts to embedded Video-Players.
Deutsch: Wandelt Video-Links in den Forenbeiträgen in Video-Player um.
Supports: Youtube, Dailymotion, MyVideo Google Video and many more ...
Author: Naden Badalgogtapeh
Author URI: http://www.naden.de/blog
Version: 0.24
*/
/**
* class BBPressBBVideo
*/
class BBPressPluginBBVideo
{
/**
* list of supported video providers
*/
var $provider;
/**
* plugin version
*/
var $version;
/**
* plugin options
*/
var $options;
/**
* plugin id for filter hooks
*/
var $wp_filter_id;
/**
* global index for embedding
*/
var $index;
/**
* public constructor
*/
function BBPressPluginBBVideo()
{
$this->version = '0.24';
$this->wp_filter_id = 'bbvideo';
$this->index = 0;
$this->options = bb_get_option( 'bbvideo_options' );
if( is_null( $this->options ) )
{
$this->SaveOptions( array( 'embed' => 1 ), false );
}
if( !array_key_exists( 'download', $this->options ) )
{
$this->options[ 'download' ] = 1;
$this->SaveOptions( $this->options, false );
}
$this->provider = array();
// include list of video providers
if( @include_once( dirname( __FILE__ ) . '/provider.inc.php' ) )
{
// content filter only on topics
if( is_topic() )
{
// header stuff
add_action( 'bb_head', array( &$this, 'AddHeader' ) );
// add content filter
add_filter( 'post_text', array( &$this, 'ContentFilter' ), 9 );
}
else
{
/// add admin panel
add_action( 'bb_admin_menu_generator', array( &$this, 'AddAdminPage' ) );
}
}
}
function SaveOptions( $options, $verbose = true )
{
foreach( $options as $key => $value )
{
$this->options[ $key ] = $value;
}
bb_update_option( 'bbvideo_options', $this->options );
if( $verbose )
{
print( __( '
', $post = '
' ) { printf( $pre . $mask . $post, implode( ', ', array_keys( $this->provider ) ) ); } function GetTitle( $s ) { $magic = 0; for( $k=0; $k| [+] Embed the video{$download} | Get the {$url} |
| Get the {$url} |