[vBTube Plugin] Mos…
 
Notifications
Clear all

[vBTube Plugin] Most Recent Videos Widget/CMS (Vertical)

1 Posts
1 Users
0 Reactions
131 Views
(@cipher5)
Posts: 152
Member Admin
Topic starter
 

Install Instructions:

* Goto Admincp->vBulletin CMS->Widgets->Create New Widget
* Choose PHP Direct Execution as Widget’s Type
* Place a Title. eg Most Rescent. 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 php 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 !!
[CODE] [COLOR=#0000bb][FONT=Courier New]ob_start[/FONT][/COLOR][FONT=Courier New][COLOR=#007700]();
[/COLOR][COLOR=#0000bb]$widget_cut_title [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]30[/COLOR][COLOR=#007700]; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]//Cutting the Number of Characters
[/COLOR][COLOR=#0000bb]$widget_results [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]5[/COLOR][COLOR=#007700]; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Number of Results
[/COLOR][COLOR=#0000bb]$widget_vbtube_dbquery [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]” WHERE active=1 AND tube=” AND mediatype=’video’ ORDER BY joindate DESC “[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

require_once([/COLOR][COLOR=#dd0000]’./vbtube_functions.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]);
[/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// Get Popular Threads
[/COLOR][COLOR=#0000bb]$popular_get [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]vB[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000bb]$db[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]query_read[/COLOR][COLOR=#007700]([/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]”
SELECT tubeid,title,link1img,rating FROM “[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]TABLE_PREFIX[/COLOR][COLOR=#007700].[/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]”vbtube_tubes
[/COLOR][COLOR=#0000bb]$widget_vbtube_dbquery[/COLOR][COLOR=#dd0000] LIMIT [/COLOR][COLOR=#0000bb]$widget_results[/COLOR][COLOR=#dd0000]”[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$output_bits [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]’
‘[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];
while([/COLOR][COLOR=#0000bb]$popular [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]vB[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000bb]$db[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]fetch_array[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$popular_get[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))
{
[/COLOR][COLOR=#0000bb]$popularlink[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]vbtube_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]’vbtube_seopower'[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000bb]$popular[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]title[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000bb]$popular[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]tubeid[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb]$popular[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]’title_cut'[/COLOR][COLOR=#007700]]=[/COLOR][COLOR=#0000bb]vbtube_cut_text[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$popular[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]’title'[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000bb]$widget_cut_title[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$popular[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]’tubes_ratesymbol'[/COLOR][COLOR=#007700]]=[/COLOR][COLOR=#0000bb]vbtube_rate[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$popular[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]’rating'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb]$output_bits [/COLOR][COLOR=#007700].= [/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]”

“[/FONT][/COLOR][FONT=Courier New][COLOR=#007700];
}
[/COLOR][COLOR=#0000bb]$output [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$output_bits[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];
[/COLOR][COLOR=#0000bb]ob_end_clean[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]();
[/COLOR] [/FONT] [/CODE] [B]Change these Values if needed: [/B][CODE][FONT=Courier New][COLOR=#0000bb]$widget_cut_title [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]30[/COLOR][COLOR=#007700]; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]//Cutting the Number of Characters
[/COLOR][COLOR=#0000bb]$widget_results [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]5[/COLOR][COLOR=#007700]; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Number of Results
[/COLOR][COLOR=#0000bb]$widget_vbtube_dbquery [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]” WHERE active=1 and tube=” AND mediatype=’video’ ORDER BY joindate DESC “[/COLOR][COLOR=#007700]; [/COLOR][/FONT][/CODE][B]

[B]Extra dbqueries:
[/B] Create a new Widget with same PHP Code above except $widget_vbtube_dbquery Variable.
Add one of the variables below.

Best Rated:
$widget_vbtube_dbquery = ” WHERE active=1 AND tube=” AND mediatype=’video’ ORDER BY rating DESC “;
Most Viewed:
$widget_vbtube_dbquery = ” WHERE active=1 AND tube=” AND mediatype=’video’ ORDER BY views DESC “;
Most Voted:
$widget_vbtube_dbquery = ” WHERE active=1 AND tube=” AND mediatype=’video’ ORDER BY votes DESC “;
Random:
$widget_vbtube_dbquery = ” WHERE active=1 AND tube=” AND mediatype=’video’ ORDER BY rand() “;
Recent Videos from CategoryID 2:
$widget_vbtube_dbquery = ” WHERE categoryid = 2 AND active=1 AND tube=” AND mediatype=’video’ ORDER BY joindate DESC “;[/B]

 
Posted : 17/02/2020 12:56 pm
Share: