I updated the plugin to be used with the latest version of FLV Player (3.1). Also added a few more parameters. It's using a JavaScript that is part of the package that you have to download from
http://www.jeroenwijering.com/?item=Flash_Video_Player (and upload to any directory on your server, but the same directory as the flvplayer.swf file).
I also added a few more parameters that can be used with FLV Player 3.1 (there are more parameters available too, but maybe this could be turned into a module instead at some point).
showdigits: Set this to true to show the digits for % loaded, elapsed and remaining time in the flvplayer. (default : true)
showfsbutton: Set this to true to show the fullscreen button. (default : true)
autostart: Set this to "true" if you want the flvplayer to automatically start playing. (default : false)
playerdir: The directory where flvplayer.swf is found. (defaults to root dir)
fullscreenpage: HTML page to jump to for fullscreen. This HTML page has the flvplayer included at 100% screensize. (default : fullscreen.html)
Here's the tag (save as function.flvplayer.php) and upload to the /plugins folder. Use it in a page or template with the {flvplayer} tag (and optional parameters).
<?php
#CMS - CMS Made Simple
#(c)2004 by Ted Kulp (wishy@users.sf.net)
#This project's homepage is: http://cmsmadesimple.sf.net
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
function smarty_cms_function_flvplayer($params, &$smarty) {
$dir = "videos";
$playerdir = "";
$width = "360";
$height = "288";
$showdigits = "true";
$showfsbutton = "true";
$autostart = "false";
$fullscreenpage = "fullscreen.html";
$fsreturnpage = "filmtest";
$flv_selfA = explode('/', $_SERVER["PHP_SELF"]);
$flv_self = $flv_selfA[sizeOf($flv_selfA)-1] . '?page=' . $_GET['page'];
if(!empty($params['dir']))
$dir = $params['dir'];
if(!empty($params['width']))
$width = $params['width'];
if(!empty($params['height']))
$height = $params['height'];
if(!empty($params['showdigits']))
$showdigits = $params['showdigits'];
if(!empty($params['showfsbutton']))
$showfsbutton = $params['showfsbutton'];
if(!empty($params['autostart']))
$autostart = $params['autostart'];
if(!empty($params['playerdir']))
$playerdir = $params['playerdir'];
$playerdir = preg_replace("/(\/|\\\)++/","",$playerdir);
if(!empty($params['fullscreenpage']))
$fullscreenpage = $params['fullscreenpage'];
$flv_dir = "uploads/".$dir;
// autoscanning the flv directory
@$flv_d = dir($flv_dir);
if ($flv_d) {
while($flv_entry=$flv_d->read()) {
$flv_entry = preg_replace("/ /","%20",$flv_entry);
$flv_pos = strpos(strtolower($flv_entry), ".flv");
if (!($flv_pos === false)) {
$flv_files[] = $flv_entry;
}
}
$flv_d->close();
}
// getting the file from the url
if ($_GET['file']) { $flv_file = $_GET['file']; } else { $flv_file = 1; }
// extracting the name of the video
$flv_p1 = strpos($flv_files[$flv_file-1],"/");
$flv_p2 = strpos($flv_files[$flv_file-1],".flv");
$flv_name = substr($flv_files[$flv_file-1],$flv_p1,($flv_p2-$flv_p1));
// Showed in content
$result .= '<script type="text/javascript" src="'$playerdir.'ufo.js"></script>'."\n";
$result .= '<h1>'.$flv_name.'</h1><br />'."\n";
$result .= '<div id="flvplayer">'."\n";
$result .= '<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>'."\n";
$result .= '<script type="text/javascript">'."\n";
$result .= ' var FO = { movie:"'.$playerdir.'/flvplayer.swf",width:"'.$width.'",height:"'.$height.'",majorversion:"7",build:"0",bgcolor:"#FFFFFF",'."\n";
$result .= ' flashvars:"file='.$flv_files[$flv_file-1].'&showdigits='.$showdigits.'&autostart='.$autostart.'&showfsbutton='.$showfsbutton.'&fullscreenpage='.$fullscreenpage.'" };'."\n";
$result .= ' UFO.create(FO,"player1");';
$result .= ' </script>';
$result .= '</div>'."\n";
$result .= '<div id="flvarray">'