vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Video Widget (https://vborg.vbsupport.ru/showthread.php?t=267699)

reddyink 07-30-2011 08:29 PM

Video Widget
 
Is it possible to create a widget that will find and play the most recently uploaded video or a selected uploaded video??

I would like to play, on my cms page, the latest video uploaded to my forums similar to YouTube video widget.

Can someone provide me with the php that I can use in a PHP Direct Execution widget for this?

Create the widget:
AdminCP > vBulletin CMS > Widgets > Create New Widget
Widget Type: PHP Direct Execution Widget
Title: Video-uploaded
SAVE

Now, find your widget in the list and click on Configure Next to it and enter valid PHP into the text area there.

Using a query: NEED HELP HERE
PHP Code:

$myquery = vB::$db->query_first("
SELECT
post.threadid, thread.title
FROM " . TABLE_PREFIX . "post AS post
INNER JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)
WHERE post.userid = ".vB::$vbulletin->userinfo['userid']. "
ORDER BY post.dateline DESC
");
$threadurl = '<a href="' . fetch_seo_url(thread, $myquery) . '" title="'. $myquery[title] .'">'. $myquery[title] .'</a>';
$output .= "<br />" . $threadurl;

Mooff 07-30-2011 08:50 PM

tbh a database query to display the latest youtube video someone posted in a thread or a post would be horribly ugly.
You would need to go through ALL posts, take out the pagetext and search through it in order to find a youtube url.

I would advise you to search through articles instead. This query would be a lot easier since articles already have a column 'preview_object' or something, which is either empty or has a video in it.


And what you are looking for is probably not help in coding it, but someone who does code that modification, which would be a request best suited here:
https://vborg.vbsupport.ru/forumdisplay.php?f=112


That aside, i have seen modifikations around which provide 'youtube video databases' where users can link their youtube content. This would also have 'most recent videos' and 'most popular videos'.


All times are GMT. The time now is 02:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00957 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete