<?php
$current_folder = dirname(__file__);
chdir("{$current_folder}");
require ($current_folder . "/include/config.php");
require ($current_folder . "/include/function.php");
require ($current_folder . "/include/functions_upload.php");
$sql = "SELECT * from `process_queue` WHERE status=0";
if (!($downloads = mysql_query($sql)))
{
mysql_die();
}
$num_downloads = mysql_num_rows($downloads);
$sql = "SELECT * from `process_queue` WHERE status=2";
if (!($process = mysql_query($sql)))
{
mysql_die();
}
$num_process = mysql_num_rows($process);
$cron = get_config("cron");
echo "cronjob started
";
if ($cron == 1)
{
$cron = 0;
if (0 < $num_downloads)
{
$video_info = mysql_fetch_assoc($downloads);
$video_id = $video_info['id'];
download_video($video_id);
}
else
if (0 < $num_process)
{
$video_info = mysql_fetch_assoc($process);
$video_id = $video_info['id'];
process_video($video_id);
}
}
else
{
$cron = 1;
if (0 < $num_process)
{
$video_info = mysql_fetch_assoc($process);
$video_id = $video_info['id'];
process_video($video_id);
}
else
if (0 < $num_downloads)
{
$video_info = mysql_fetch_assoc($downloads);
$video_id = $video_info['id'];
download_video($video_id);
}
}
$sql = "UPDATE `config` set `config_value`='" . $cron . "' where `config_name`='cron'";
if (!($tmp = mysql_query($sql)))
{
mysql_die();
}
?>
Thats the content from cron.php, cronjob is starter and is starting on evry 5 minutes, but why uploaded files haved separator "-" between words of the file. How to clean this separator?
Bookmarks