Hello,
Please forgive me but I was given the file that needs to be altered. This is the coding. Is there anyway to do any of what you mentionned above to it?
Thank you in advance....
//=====================================================
// Include Setup And Config
//=====================================================
require_once("functions.php");
require_once($config['sitepath'].'/classes/videoencode.class.php');
//=====================================================
// Passed Values
//=====================================================
$filename = $argv[1];
$filename2 = $argv[2];
$id = $argv[3];
if (($filename != "") && ($filename2 != "") && ($id != ""))
{
$filename_orig = $filename;
//=====================================================
// Encode Video
//=====================================================
$encode = new VideoEncode();
$encode->smclass =& $smclass;
$encode->background_convert = false;
$encode->init($filename);
if ( $encode->encode() )
{
//-----------------------------------------
// Delete source video
//-----------------------------------------
if ($config['delete_source_video'] == 1)
{
@unlink($config['sitepath']."/files/".$filename_orig);
$filename_orig = $encode->filename_new;
}
$filename = $encode->filename_new;
$filesize = $smclass->_get_file_size($config['sitepath'].'/files/'.$filename);
}
//=====================================================
// Media Slave Server
//=====================================================
if ($config['enable_slaves'])
{
$db->query("SELECT * FROM servers WHERE server_type = 'media' AND enabled = 1 ORDER BY RAND() LIMIT 1");
$serv = $db->fetch_row();
if ( $db->get_num_rows() )
{
$file_path = $config['sitepath']."/files/".$filename;
$file_orig_path = $config['sitepath']."/files/".$filename_orig;
require($config['sitepath'].'/classes/ftp.class.php');
$ftp = new FTP($serv['ftp_username'], $serv['ftp_password'], $serv['ftp_host']);
$ftp->smclass =& $smclass;
if ( $ftp->connect() )
{
//-----------------------------------------
// Move file to slave server
//-----------------------------------------
$ftp->put($serv['server_path']."/files/".$filename, $file_path);
//-----------------------------------------
// Delete original file
//-----------------------------------------
@unlink($file_path);
if (file_exists($file_orig_path))
{
@unlink($file_orig_path);
}
$db->query("UPDATE files SET server_id = '".$serv['server_id']."' WHERE file_id = ".intval($id)."");
}
}
}
//=====================================================
// Update
//=====================================================
sleep(10);
$db->query("UPDATE files SET file_size = '".$filesize."', file_orig = '".$filename_orig."', file = '".$filename."' WHERE file_id = ".intval($id)."");
}
?>