rendered paste body<?php/*Plugin Name: Video Extension Plugin by AnonymousPlugin URI: http://vieah.orgDescription: Adds a video bbcode for FLV filesVersion: 1.0Author: AnonymousAuthor URI: http://php.net*/ function CheckFLVPlayerCode( $old_content ) { $random_var = 'var'.md5( time( ) / rand( 0, 255 ) ); $p_name = "player".md5( rand( time( ), time( ) + 255 ) ); $new_content = preg_replace ( //[flv w=<param> h=<param>]<link>[/flv] '/\[flv width=(.+) height=(.+)\](.+)\[\/flv\]/Ui', '<p id="'.$p_name.'">'. ' '. '<a href="http://www.macromedia.com/go/getflashplayer">You must install Macromedia flash player</a> to use this player.'. ' '.'</p>'. ' '. '<script type="text/javascript">'. ' '. 'var '.$random_var.' = new SWFObject( "wp-content/plugins/flvplayer/mediaplayer.swf", "single", "$1", "$2", "7" );'. ' '. $random_var.'.addParam( "allowfullscreen", "true" );'. ' '. $random_var.'.addVariable( "file", "$3" );'. ' '. $random_var.'.addVariable( "width", "$1" );'. ' '. $random_var.'.addVariable( "height", "$2" );'. ' '. $random_var.'.addVariable( "backcolor", "0x51b2da" );'. ' '. $random_var.'.addVariable( "frontcolor", "0xFFFFFF" );'. ' '. $random_var.'.addVariable( "lightcolor", "0x000000" );'. ' '. $random_var.'.write( "'.$p_name.'" );'. ' '. '</script>'. ' '.'</p>', $old_content ); return $new_content; } function CheckFLVListCode( $old_content ) { $random_var = 'var'.md5( time( ) / rand( 0, 255 ) ); $p_name = "player".md5( rand( time( ), time( ) + 255 ) ); $new_content = preg_replace ( '/\[xmlflv file=(.+) displayheight=(.+) width=(.+) height=(.+)\]/Ui', '<p id="'.$p_name.'">'. ' '. '<a href="http://www.macromedia.com/go/getflashplayer">You must install Macromedia flash player</a> to use this player.'. ' '. '</p>'. ' '. '<script type="text/javascript">'. ' '. 'var '.$random_var.' = new SWFObject( "wp-content/plugins/flvplayer/mediaplayer.swf", "playlist", "$3", "$4", "7" );'. ' '.$random_var.'.addParam( "allowfullscreen", "true" );'. ' '.$random_var.'.addVariable( "file", "/wp-content/plugins/flvplayer/playlists/$1" );'. ' '.$random_var.'.addVariable( "displayheight", "$2" );'. ' '.$random_var.'.addVariable( "backcolor", "0x51b2da" );'. //main ' '.$random_var.'.addVariable( "frontcolor", "0xFFFFFF" );'. //main text/stuff ' '.$random_var.'.addVariable( "lightcolor", "0x000000" );'. //highlight ' '.$random_var.'.addVariable( "width", "$3" );'. ' '.$random_var.'.addVariable( "height", "$4" );'. ' '.$random_var.'.write( "'.$p_name.'" );'. '</script>'. ' '.'</p>', $old_content ); return $new_content; } function filter_videolink( $content ) { $content = CheckFLVPlayerCode( $content ); $content = CheckFLVListCode( $content ); return $content; } add_filter( 'the_content', 'filter_videolink' );?>