Mod Media Cho VBB 4.0

saveyourtime1990

Administrator
Staff member
25 Tháng mười 2010
10,248
0
36
33
Installation:
Upload all the files in the "upload" directory of the attached zip file to your forum root.
CHMOD the /customVID directory and all directories within it to full read/write/execute 777.
Import the product file called "product-media.xml" in the Product Manager of vBulletin.
Set your usergroup permissions and media library settings in your administration control panel.

Known Bugs:

There is a conflict with this modification and some of Valter's VSA modifications that will prevent navbar permissions from being handled correctly. I don't know exactly who's fault it is; but I'm pretty sure there are no errors in my code that would be causing this problem. There is a work around for this however.

Admin Control Panel > Plugins & Products > Plugin Manager > "media NAVTAB"

Find the code:
Mã PHP:
PHP Code:
$perms = media_permissions();
Mã PHP:
PHP Code:
$perms['rate'] = true;
$perms['submit'] = true;

if (
is_member_of($vbulletin->userinfo, explode(',','5,6')))
{
$perms['modtags'] = true;
$perms['modcategory'] = true;
$perms['modservice'] = true;
}
Sidebar Block:
Mã PHP:
PHP 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;
CMS Widget:
Mã PHP:
PHP Code:
require_once(DIR.'/media/media_functions_hrefs.php');

$medias = vB::$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 = 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_WIDGET');
$templater->register('media', $media);
$mediabits .= $templater->render();
}

$output = $mediabits;
hoặc
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;
Mod này hỗ trợ các link từ trang: DailyMotion, LocalAudio, LocalVideo, MegaVideo, MetaCafe, uStream, Veoh, Vimeo, YouTube

Demo: http://sinhvienthamdinh.com/forum/media.php

[DOWNLOAD][/DOWNLOAD]
link media
bản tiếng anh http://www.mediafire.com/?gzygnmjzdnm
bản việt hoá http://www.mediafire.com/?zmdizmoyrzw
 

Thống kê diễn đàn

Chủ đề
61,129
Bài viết
63,349
Thành viên
86,046
Thành viên mới nhất
vuhong

VỀ CHÚNG TÔI

  • Sinhvienthamdinh.Com là diễn đàn đầu tiên và lớn nhất dành riêng cho cộng đồng nhân lực ngành thẩm định giá. Cổng thông tin được tạo ra nhằm tạo kênh kết nối tri thức cho tất cả các bạn đã và đang quan tâm đến ngành thẩm định giá. Các thông tin được tổng hợp với đầy đủ các mảng thuộc lĩnh vực thẩm định giá như: Thẩm định giá Bất động sản, thẩm định giá động sản, thẩm định giá máy móc thiết bị, thẩm định giá doanh nghiệp, thẩm định giá dự án đầu tư, thẩm định giá thương hiệu...
  • Với phương châm "Connet For Sharing" chúng tôi chia sẻ hoàn toàn miễn phí và không giới hạn những kiến thức từ cộng đồng diễn đàn.

DANH MỤC CHÍNH

CÁ NHÂN