File: //home/httpd/mech_ftp/baretube.com/admin/cronPublish.php
<?php
include('db.php');
$count = 0;
$results = dbQuery("SELECT * FROM `content` WHERE `enabled` = 0 AND `approved` = 2 ORDER BY RAND() LIMIT 0, $numCronPublish", false);
foreach ($results as $row) {
dbQuery("UPDATE `content` SET `encoded_date` = NOW(), `scheduled_date` = NOW(), `enabled` = 1 WHERE `record_num` = '$row[record_num]'");
updateRelatedVideos($row['record_num']);
updateContentSearch($row['record_num']);
generateSlug($row['record_num']);
if($randomViewsEnabled && is_numeric($randomViewsMin) && is_numeric($randomViewsMax)) {
$newViews = rand($randomViewsMin,$randomViewsMax);
dbQuery("UPDATE content_views SET views = $newViews WHERE content = '$row[record_num]'");
}
$count++;
}
exit("$count video(s) published");
?>