<?php
/*
Plugin Name: FFVideo
Plugin URI: http://code.anze.info
Description: Allows you to insert ff videos in your post by providing the video id
Version: 0.02
Date: June 30th, 2007
Author: Anže Žnidaršič
Author URI: http://www.anze.info
--------------------------------------------------------------------------------
This program is free software. You can redistribute it and modify in any way you
want, but you have to mention my name and link to my website (and buy me a beer) :)
*/

function ffvideo($text)
{
    
$pattern '/([\[|<]ffvideo\s*(.*?)[\]|>](.*?)[\[|<]\/ffvideo[\]|>])/i';
    if (
preg_match_all ($pattern$text$matches))
    {
        for (
$i 0$i count($matches[0]); $i++)
        {
            
$url $matches[3][$i];
            if (
is_numeric($url))
                
$url 'http://frendiinflirt.24ur.com/sniplet.php/id%3D' $url;
            
$html '
            <div style="width: 416px; height: 332px; margin: 0px auto">
            <object width="416" height="332" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0">
                <param name="movie" value="'
.$url.'"></param>
                <param name="allowFullScreen" value="true" />
                <embed src="'
.$url.'" type="application/x-shockwave-flash" width="416" height="332" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer">
                </embed>
            </object>
            </div>
            '
;
            
$text str_replace($matches[0][$i], $html$text);
        }
    }
    return 
$text;
}
add_filter('the_content''ffvideo'1);
?>