Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Media Library CMS Sidebar Details »»
Media Library CMS Sidebar
Version: 1.00, by ngcoders ngcoders is offline
Developer Last Online: Sep 2012 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.x Rating:
Released: 06-05-2010 Last Update: Never Installs: 115
Auto-Templates
 
No support by the author.

Media Library CMS Sidebar

Released 06-06-2010
By Vikas - http://www.ngcoders.com
For Plugin - https://vborg.vbsupport.ru/showthread.php?t=240677 (8WayRun.Com - Media Library)
For Demo - http://www.roboticsindia.com/ ( Left Sidebar )

Installation
  • Goto Admincp->vBullietin CMS->Widgets->Create New Widget
  • Choose PHP Direct Execution as Widget's Type
  • Place a Title. eg Latest Videos. Keep it short as this is what will appear as title on your pages.
  • Click Save
  • Click Configure on the right of the new created widget.
  • Remove the default code that appears. Be sure to not leave behind even a single letter.
  • Copy and Paste the code that you can find below.
  • Leave the template name as is (vbcms_widget_execphp_page)
  • Click Save
  • Goto Admincp->vBullietin CMS->Layout Manager
  • Click Go on the Default Layout
  • Add the Widget to your Layout
  • Click Save
  • That's all !!

PHP Code

PHP 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

Screenshots

File Type: jpg Clipboard01.jpg (21.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
eTiKeT?, K4GAP, RichieBoy67

Comments
  #2  
Old 06-06-2010, 11:42 AM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey mate i think its best if you change the title to CMS sidebar
Jaxel added a forums sidebar one in his mods page (just not a CMS one) i think it will be easyer for people to find
Good Work too :up::up:
Reply With Quote
  #3  
Old 06-06-2010, 12:55 PM
rotor rotor is offline
 
Join Date: Jul 2007
Location: Qld, Australia
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Been waiting for this..... thx much appreciated :up:
Reply With Quote
  #4  
Old 06-06-2010, 01:30 PM
ngcoders ngcoders is offline
 
Join Date: Dec 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Changed to CMS side bar.
Reply With Quote
  #5  
Old 06-06-2010, 03:04 PM
schlottkej schlottkej is offline
 
Join Date: Apr 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where is the Forums Sidebar version in his thread?
Reply With Quote
  #6  
Old 06-06-2010, 03:47 PM
schlottkej schlottkej is offline
 
Join Date: Apr 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow.. I found it... Ill repost

# NEW FEATURE: Widget support for both the ForumHome Sidebar and the vbCMS.

This has been updated since the previous versions, so please update your codes.

Sidebar Block:
Code:

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($seconds2"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:
Code:

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($seconds2"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;

# BUG FIX: Fixed formatting buttons on quick reply for comments.
# BUG FIX: Fixed MySQLi errors for those who happen to be using it.
# BUG FIX: Fixed service constructs for non-SEO slugged links.
# BUG FIX: Fixed RSS feeds for tags in table prefix settings. 
Reply With Quote
  #7  
Old 06-06-2010, 11:18 PM
nomoreturn's Avatar
nomoreturn nomoreturn is offline
 
Join Date: Apr 2009
Posts: 345
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed but didnt got the thumbnil of videos
Attached Images
File Type: png Capture90.PNG (16.5 KB, 0 views)
Reply With Quote
  #8  
Old 06-15-2010, 09:22 PM
akxt660 akxt660 is offline
 
Join Date: May 2010
Location: Brasil
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have a way to add the userinfo bellow off any midia?
Reply With Quote
  #9  
Old 06-28-2010, 07:03 PM
Reef Man Reef Man is offline
 
Join Date: Nov 2006
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

do you know how I can configure this on a vbadvanced block?
Reply With Quote
  #10  
Old 06-29-2010, 01:15 PM
LouisB LouisB is offline
 
Join Date: Jan 2010
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sidebar block works great. Thanks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05219 seconds
  • Memory Usage 2,367KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete