
06-28-2012, 09:55 PM
|
 |
|
|
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by Taurus1
I can't remember where I got it, but here is the forumblock I use:
Create a new forum block with PHP as the content type, and add this code in the content part. You can edit how many thumbs you want to display in the forum block by editing the "LIMIT" part in the code.
Code:
global $vbulletin;
require_once(DIR.'/media/media_functions_hrefs.php');
$medias = $vbulletin->db->query_read("
SELECT media.*, media_service.*
FROM " . TABLE_PREFIX . "media AS media
LEFT JOIN " . TABLE_PREFIX . "media_service AS media_service ON(media_service.serviceID = media.serviceID)
ORDER BY media.dateline DESC
LIMIT 3
");
while ($media = $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'] = $vbulletin->options['media_thumb_dir']."/thumbs/". $media['mediaID'] .".jpg";
$media['href'] = construct_href_details($media);
$templater = vB_Template::create('8WR_media_WIDGET');
$templater->register('media', $media);
$mediabits .= $templater->render();
}
return $mediabits;
Make sure the template to use is 'block_html'
|
How do I edit the css for the block? I edited the 8wr WIDGET template's last line, and nothing is changing (hard refreshed page)
Quote:
<div style="text-align: center;padding:5px"><b><a href="{vb:var media.href}">{vb:var media.title}</a></b></div>
|
Thanks.
|