Quote:
Originally Posted by Veer
Mine too not working on vb4.0.4
Jaxel, need your help for CMS Widget.
|
Do you mean the sideblock for forum home or the CMS sidebar.
For the CMS widget just insert this into a php direct execution widget.
Code:
global $vbulletin;
require_once(DIR.'/media/media_functions_hrefs.php');
// %d
$show_count = 5;
$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 ".$show_count);
$output = '
<style type="text/css">
.thumbnail img{
width: 90px;
height: 70px;
border: 1px solid #ccc;
padding: 5px;
margin: 5px;
float: left;
}
.video_bit {
min-height: 90px;
}
</style>
';
while ($media = $vbulletin->db->fetch_array($medias))
{
$media['thumbnail'] = $vbulletin->options['media_thumb_dir']."/thumbs/". $media['mediaID'] .".jpg";
$media['href'] = construct_href_details($media);
extract($media);
$title = substr($title,0,60);
$mediabits .= sprintf('<div class="cms_widget_post_bit video_bit"><div class="thumbnail"><a href="%s"><img src="%s"></a></div><div class="cms_widget_post_header"><a href="%s">%s</a></div><div class="cms_widget_post_userinfo"><a href="member.php/u=%d">%s</a> On %s</div></div>',$href,$thumbnail,$href,$title,$userid,$username,date('F j, Y, g:i a',$dateline));
}
$output .= $mediabits;
For the forum home sidebar .
add this to a new (php content type using template: " block html") forum block:
Code:
global $vbulletin;
require_once(DIR.'/media/media_functions_hrefs.php');
// %d
$show_count = 13;
$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 ".$show_count);
$output = '
<style type="text/css">
.thumbnail img{
width: 135px;
height: 90px;
border: 1px solid #ccc;
padding: 5px;
margin: 5px;
text-align: center;
float: center;
}
.video_bit {
text-align: center;
min-height: 120px;
}
</style>
';
while ($media = $vbulletin->db->fetch_array($medias))
{
$media['thumbnail'] = $vbulletin->options['media_thumb_dir']."/thumbs/". $media['mediaID'] .".jpg";
$media['href'] = construct_href_details($media);
extract($media);
$title = substr($title,0,60);
$mediabits .= sprintf('<div class="cms_widget_post_bit video_bit"><div class="thumbnail"><a href="%s"><img src="%s"></a></div><div class="cms_widget_post_header"><a href="%s">%s</a></div><div class="cms_widget_post_userinfo"><a href="member.php">%s</a> By %s</div></div>',$href,$thumbnail,$href,$title,$userid,$username,date('F j, Y, g:i a',$dateline));
}
$output .= $mediabits;
If you have any questions regarding the CMS widget go here for more instructions.
https://vborg.vbsupport.ru/showthread.php?t=244058