Quote:
Originally Posted by bart6767
Where do you get the widgets for this ?
|
Code:
ob_start();
require_once(DIR.'/media/media_functions_hrefs.php');
$medias = vB::$vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "media ORDER BY dateline DESC LIMIT 3");
while ($media = vB::$vbulletin->db->fetch_array($medias))
{
if ($media['length'] == 0)
{
$media['length'] = "???";
}
else
{
$duration = $media['length'];
$minutes = floor($duration / 60);
$seconds = $duration % 60;
$seconds = str_pad($seconds, 2, "0", STR_PAD_LEFT);
$media['length'] = "$minutes:$seconds";
}
$media['intrate'] = intval($media['rating']);
$media['thumbnail'] = vB::$vbulletin->options['media_thumb_dir']."/thumbs/". $media['mediaID'] .".jpg";
$media['href'] = construct_href_details($media);
$templater = vB_Template::create('8WR_media_block');
$templater->register('media', $media);
$mediabits .= $templater->render();
}
$output = $mediabits;
ob_end_clean();