Jump to content

(M34) Videos System


Michael.J

Recommended Posts

(M34) Videos System


This is the legacy IP.Board 3.x version. View the new IP.Board 4.x version here.

Video sharing system, allows you and your members to share various video embed codes from YouTube, Google Video, Yahoo Video etc.. Including per category settings as well as subcategories,
Click here to read my IPS Marketplace purchase guide before purchasing.

Keep up to date with DevFuse mod development and releases.
Posted Image Posted Image Posted Image Posted Image Posted Image

 Feature List:

  • No file edit or template edits required, just upload the application files and run the application installer.
  • Basic video upload support added with flowplayer integration. No transcoding done, video must be compatible with flowplayer.
  • Mobile skin support for the portal index, category view, video form and view video pages.
  • Content Spy integration for new and updated videos. View more on what Content Spy is here.
  • Support included for share links on view video page.
  • Notification support for add, edit, approve, unapprove and moderator pending videos
  • IP.Board Sitemap Generator plugin included. Which allows video links to be included in your sitemap file.
  • Support for category permissions. Set who can add videos, edit videos, delete videos, add comments, edit comments, delete comments per group.
  • Support for per category settings, including view category, view and add video permissions and discussion topics.
  • Videos tab added to the profile page for members who have added videos.
  • Ajax rating system with per group permissions who can rate and even who can change their votes.
  • Share video option with page link, bbcode and html code provided for members to share videos more easily.
  • Default per category settings for sort and filter as well as number of videos per page.
  • Support for media tags. Members can now just add the url for supported media sites and the embed code will be generated for them
  • Support for YouTube thumbnails. Thumbnails are downloaded and saved locally for display next to videos when new videos are added using media urls. (See below for which sites are supported.)
  • Quick add video option, enter the media url and category and the system will attempt to get the video title/description automatically. (Not all media urls supported.)
  • Support for category or video following.
  • Support for IPB's tag class for videos.
  • Support for IP.Contents feed plugin (videos, categories and comments).
  • Support for IPB's like/reputation class for videos.
  • Rebuild tools included for videos and comments. Useful for when a members display name gets changed.
  • Cleanup tool for orphaned and broken thumbnails and uploaded videos.
  • Sidebar hook included with the option to change which field, the videos in the sidebar are sorted as well as the order and number of videos to display.
  • Per category or globally created discussion topics.
  • Pending videos overview for mass approval/denial of new videos added.
  • Full use of IPB's inbuilt cache system to minimize server load and resources.
  • RSS feed for new videos added and per category rss feed export added for each category.

 
Sites which support automatic thumbnail downloading:

  • Youtube
  • Vimeo Video
  • Facebook Video
  • Vine Video
  • TwitchTV & JustinTV

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 1 month later...

Where can we file bug reports?



I've changed my BBCode for youtube, but rebuilding the videos isn't updating the embed code in the DB - could you take a look?



You can view the bug reports for the Videos System here. This is already a confirmed bug, you can view the bug report here. I've already included this fix in the next version, due out in a few weeks.


How to add facebook videos ?




Through media bbcodes would probably be the best option, you'll need to add your own media bbcode for Facebook.

Edit: You can find one here, Also please note Saurabh that this support topic is not a way to get around an expired subscription to the Videos System.
Link to comment
Share on other sites

I haveve purchased a video system and I have two problems first is that the details of the video appear below in a browser
example:


while another separate aspect
example:


of the second problem is in the thumbnails as I would like to show it in your video ad.
example: http://community.invisionpower.com/index.php?app=downloads&module=display&section=screenshot&full=1&id=3724&record=27649

tanx

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hello All,

I wrote (read: hacked together) this script to search a certain forum for youtube videos that users have previously posted, and import them into the videos system


#!/usr/local/bin/php

<?php


/**

 *

 */


define( 'IPS_IS_SHELL', TRUE );

define( 'IPB_THIS_SCRIPT', 'admin' );


if ( is_file( './initdata.php' ) )

{

	require_once( './initdata.php' );

}

else

{

	require_once( '../initdata.php' );

}


require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );

require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );


$reg = ipsRegistry::instance();

$reg->init();


/* Ensure it's CLI */

$cli = php_sapi_name() === 'cli';


if ( ! $cli )

{

      print "<html><head><title>Warning</title></head>n";

      print "<body style='text-align:center'>n";

      print "This script is meant to be run via command line<br />n";

      print "More information:<br />n";

      print "<a href="http://www.google.com/search?hl=en&q=php+cli+windows" target="_blank">http://www.google.com/search?hl=en&q=php+cli+windows</a><br />n";

      print "This script will not run through a webserver.<br />n";

      print "</body></html>n";

      exit();

}



$moo = new moo( $reg );


class moo

{

	function __construct( ipsRegistry $registry )

	{

		$this->registry   =  $registry;

		$this->DB         =  $this->registry->DB();

		$this->settings   =& $this->registry->fetchSettings();

		$this->request    =& $this->registry->fetchRequest();

		$this->cache      =  $this->registry->cache();

		$this->caches     =& $this->registry->cache()->fetchCaches();

		$this->stdin      =  fopen('php://stdin', 'r');


		$this->_convert();

	}



	private function _convert()

	{

		$this->DB->build( array(

				'select'	=> 't.*',

				'from'		=> array( 'topics' => 't' ),

				'where'		=> 't.forum_id = FORUM_ID_GOES_HERE',

				'add_join'	=> array(

							array(

								'select'	=> 'p.*',

								'from'		=> array( 'posts' => 'p' ),						

								'where'		=> "p.topic_id = t.tid AND p.new_topic = 1 AND p.post like '" . '%youtube%' . "'",

								)

							)

					)		

				);


		$o = $this->DB->execute();


		while( $row = $this->DB->fetch( $o ) )

		{

			$a = $this->show_youtube($row['post']);


			if(is_array($a)) {

				$media = "<object width='640' height='360'>

								<param value='" . $a['embed'] . 

					"?fs=1&amp;hl=en_GB&amp;&amp;showinfo=0&amp;iv_load_policy=3&amp;rel=0&amp;border=0&amp;hd=1&amp;autoplay=0&amp;autohide=1&amp;showinfo=0&amp;color2=0xFFFFFF&amp;color1=0xFFFFFF' 

					name='movie'>

								<param value='true' name='allowFullScreen'><param value='always' name='allowscriptaccess'>

								<embed width='640' height='360' allowfullscreen='true' allowscriptaccess='always' 

					type='application/x-shockwave-flash' src='" . $a['embed'] . 

					"?fs=1&amp;hl=en_GB&amp;&amp;showinfo=0&amp;iv_load_policy=3&amp;rel=0&amp;border=0&amp;hd=1&amp;autoplay=0&amp;autohide=1&amp;showinfo=0&amp;color2=0xFFFFFF&amp;color1=0xFFFFFF'>

							</object>";


				$this->DB->insert( 'videos',

											array(

												'author_id' => $row['starter_id'],

												'author_name' => $row['starter_name'],

												'date' => $row['start_date'],

												'title' => $row['title'],

												'description' => $row['description'],

												'topic_id' => $row['topic_id'],

												'views' => $row['views'],

												'last_updated' => $row['start_date'],

												'video_type' => "media_url",

												'video_data' => $a['link'],

												'members_seo_name' => $row['starter_name'],

												'embed' => $media,

												'cid' => '1'

												)

											);


				$this->_print(".");

			}	

		}

	}


	/**

	 * Out to stdout

	 */

	private function _print( $message, $newline="n" )

	{

			$stdout = fopen('php://stdout', 'w');

			fwrite( $stdout, $message . $newline );

			fclose( $stdout );

	}


	private function show_youtube($text)

	{

		$text .= ' ';

		$find = 'youtube.com/watch?v=';

		$pos = strpos($text, $find);


		if ($pos === false)

		{

			return;

		}


		$len = strlen($text);


		for ($i=$pos; $i>=0; $i--)

		{

			if (substr($text, $i, 6) == 'http:/')

			{

				$pos1 = $i;

				break;

			}

		}


		for ($i=$pos; $i<$len; $i++)

		{

			if (in_array($text[$i], array('"', '<', '[', '&', ' ', "r", "n", ',', "t")))

			{

				$pos2 = $i;

				break;

			}

		}


		$link1 = substr($text, $pos1, $pos2 - $pos1);


		if(strlen($link1)) {

			$a['link'] = $link1;

			$a['embed'] = str_replace('/watch?v=', '/v/', $link1);

			return $a;

		}


		return false;

	}

}


exit();



If you want to use it you'll need to
1. save as 'forum_root/_tools/youtube.php'
2. run 'php youtube.php'
3. login to admin CP and rebuild all thumbnails.

Michael, I was hoping you'd be able to give me a hand. I'd like to update the script to run every few minutes to scrape any new videos out of the specified forum (I can do this bit), what I don't know how to do is automate the thumbnail generation. Could you give me any pointers?

Thanks
Tom.

Link to comment
Share on other sites

eep, sorry to bombard you Michael, but getting this error when I try to rebuild the sphinx config:

Parse error: syntax error, unexpected $end in /home/***/domains/***.com/public_html/forum/admin/applications_addon/other/videos/extensions/sphinxTemplate.php on line 85

Link to comment
Share on other sites


I wrote (read: hacked together) this script to search a certain forum for youtube videos that users have previously posted, and import them into the videos system



Michael, I was hoping you'd be able to give me a hand. I'd like to update the script to run every few minutes to scrape any new videos out of the specified forum (I can do this bit), what I don't know how to do is automate the thumbnail generation. Could you give me any pointers?




Nice work. :) The problem is that rebuild thumbnails is not in it's own function yet, so your not going to be able to load up a file and call it. You'll need to copy the code that rebuilds the thumbnail and paste it into your own code. The best place would probably be from the admin rebuild tools function. In admin/applications_addon/other/videos/modules_admin/tools/tools.php in function thumbnailsDo. Because your probably not working with many videos, you'll probably be able to scrap the mysql limit. Also because you don't have a thumbnail in the first place, you can remove the reset thumbnail queries.

Going by your above code, you seem pretty knowledgeable but if you need my help to go over your code, just let me know. You might be able to remove a few of the redundancies as well that it takes into account if CURL or file_put_contents isn't available.


eep, sorry to bombard you Michael, but getting this error when I try to rebuild the sphinx config:




Open that file and add a new line after the EOF; line.
Link to comment
Share on other sites


I've been having reports of problems with the new YouTube short form url. I'll be fixing this in an upcoming release but until then you can import [url="http://community.invisionpower.com/files/file/4120-media-bbcode-for-youtube-links/"]this[/url] media bbcode to fix the issue.




Yeah that work fine Michael but the "thumbnails" of the video don't show just a red x in a box but when you go to watch the video it's ok just the video list with the thumbnails giving a problem.
Link to comment
Share on other sites


Nice work. :) The problem is that rebuild thumbnails is not in it's own function yet, so your not going to be able to load up a file and call it. You'll need to copy the code that rebuilds the thumbnail and paste it into your own code. The best place would probably be from the admin rebuild tools function. In admin/applications_addon/other/videos/modules_admin/tools/tools.php in function thumbnailsDo. Because your probably not working with many videos, you'll probably be able to scrap the mysql limit. Also because you don't have a thumbnail in the first place, you can remove the reset thumbnail queries.



Going by your above code, you seem pretty knowledgeable but if you need my help to go over your code, just let me know. You might be able to remove a few of the redundancies as well that it takes into account if CURL or file_put_contents isn't available.





Open that file and add a new line after the EOF; line.




Great, thanks :) I did have a quick look in there before but it seemed to be doing quite a lot of stuff. I should be able to trim it down so it just does what I need.

Will post an updated script once its sorted.
Link to comment
Share on other sites


Yeah that work fine Michael but the "thumbnails" of the video don't show just a red x in a box but when you go to watch the video it's ok just the video list with the thumbnails giving a problem.




You can add another entry to the "Thumbnail Sites" using the thumbnail file entry youtube and the new short form youtu,be media bbcode. Use the existing thumbnail site for Youtube as a guide. If you need detailed instructions, just let me know.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...