Saludos y gracias
Código PHP:
<?php
define('_VALID', true);
define('CONSOLE', true);
$base_dir = realpath(dirname(__FILE__).'/../');
require $base_dir.'/libraries/bootstrap.php';
set_time_limit(0);
$db = VF::factory('database');
$db->query("SELECT video_id
FROM #__video
WHERE total_views >= 1000
ORDER BY RAND()
LIMIT 10");
$videos = $db->fetch_rows();
$date = date('Y-m-d h:i:s');
$time = time();
foreach ($videos as $video) {
$db->query("UPDATE #__video
SET featured = '1',
add_time = ".$time.",
add_date = '".$date."'
WHERE total_views >= 1000
LIMIT 10");
}
{
$db->query("INSERT INTO #__video_featured
feature_time = ".$time.",
video_id = ".$video_id."
WHERE total_views >= 1000
LIMIT 10");
}
VF::close();