Video Thumbnails - Version 1.7.4

Version Description

  • Fixed Dailymotion bug (thanks Gee)
  • Added detection for Dailymotion URLs (thanks Gee)
  • Added support for WP YouTube Lyte
Download this release

Release Info

Developer sutherlandboswell
Plugin Icon 128x128 Video Thumbnails
Version 1.7.4
Comparing to
See all releases

Code changes from version 1.7.3 to 1.7.4

Files changed (2) hide show
  1. readme.txt +8 -3
  2. video-thumbnails.php +10 -4
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: sutherlandboswell
3
  Donate link: http://amzn.com/w/1L25YG6FO8AZ1
4
  Tags: Video, Thumbnails, YouTube, Vimeo, Blip.tv, Justin.tv, Dailymotion, Metacafe, Image, Featured Image, Post Thumbnail
5
  Requires at least: 3.0
6
- Tested up to: 3.1
7
- Stable tag: 1.7.3
8
 
9
  Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
10
 
@@ -26,7 +26,7 @@ Video Thumbnails even works with most video embedding plugins, including:
26
  * [Viper's Video Quicktags](http://wordpress.org/extend/plugins/vipers-video-quicktags/)
27
  * [Simple Video Embedder](http://wordpress.org/extend/plugins/simple-video-embedder/)
28
  * [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
29
- * [JR Embed](http://plugins.jakeruston.co.uk/wordpress/wordpress-plugin-jr-embed/)
30
 
31
  Some functions are available to advanced users who want to customize their theme:
32
 
@@ -84,6 +84,11 @@ The Vimeo API has a rate limit, so in rare cases you may exceed this limit. Try
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
87
  = 1.7.3 =
88
  * More comprehensive search for embedded YouTube videos
89
 
3
  Donate link: http://amzn.com/w/1L25YG6FO8AZ1
4
  Tags: Video, Thumbnails, YouTube, Vimeo, Blip.tv, Justin.tv, Dailymotion, Metacafe, Image, Featured Image, Post Thumbnail
5
  Requires at least: 3.0
6
+ Tested up to: 3.1.2
7
+ Stable tag: 1.7.4
8
 
9
  Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
10
 
26
  * [Viper's Video Quicktags](http://wordpress.org/extend/plugins/vipers-video-quicktags/)
27
  * [Simple Video Embedder](http://wordpress.org/extend/plugins/simple-video-embedder/)
28
  * [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
29
+ * [WP YouTube Lyte](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
30
 
31
  Some functions are available to advanced users who want to customize their theme:
32
 
84
 
85
  == Changelog ==
86
 
87
+ = 1.7.4 =
88
+ * Fixed Dailymotion bug (thanks [Gee](http://wordpress.org/support/profile/geekxx))
89
+ * Added detection for Dailymotion URLs (thanks [Gee](http://wordpress.org/support/profile/geekxx))
90
+ * Added support for [WP YouTube Lyte](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
91
+
92
  = 1.7.3 =
93
  * More comprehensive search for embedded YouTube videos
94
 
video-thumbnails.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://sutherlandboswell.com/2010/11/wordpress-video-thumbnails/
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Blip.tv, and Justin.tv.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
- Version: 1.7.3
9
  License: GPL2
10
  */
11
  /* Copyright 2010 Sutherland Boswell (email : sutherland.boswell@gmail.com)
@@ -64,6 +64,7 @@ function getDailyMotionThumbnail($id) {
64
  curl_setopt($ch, CURLOPT_URL, "https://api.dailymotion.com/video/$id?fields=thumbnail_url");
65
  curl_setopt($ch, CURLOPT_HEADER, 0);
66
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
67
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
68
  $output = curl_exec($ch);
69
  curl_close($ch);
@@ -125,9 +126,9 @@ function get_video_thumbnail($post_id=null) {
125
  preg_match('#http://w?w?w?.?youtube.com/watch\?v=([A-Za-z0-9\-_]+)#s', $markup, $matches);
126
  }
127
 
128
- // If no standard YouTube embed is found, checks for one embedded with JR_embed
129
- if(!isset($matches[1])) {
130
- preg_match('#\[youtube id=([A-Za-z0-9\-_]+)]#s', $markup, $matches);
131
  }
132
 
133
  // If we've found a YouTube video ID, create the thumbnail URL
@@ -220,6 +221,11 @@ function get_video_thumbnail($post_id=null) {
220
  // Dailymotion flash
221
  preg_match('#<object[^>]+>.+?http://www.dailymotion.com/swf/video/([A-Za-z0-9]+).+?</object>#s', $markup, $matches);
222
 
 
 
 
 
 
223
  // Dailymotion iframe
224
  if(!isset($matches[1])) {
225
  preg_match('#http://www.dailymotion.com/embed/video/([A-Za-z0-9]+)#s', $markup, $matches);
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Blip.tv, and Justin.tv.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
+ Version: 1.7.4
9
  License: GPL2
10
  */
11
  /* Copyright 2010 Sutherland Boswell (email : sutherland.boswell@gmail.com)
64
  curl_setopt($ch, CURLOPT_URL, "https://api.dailymotion.com/video/$id?fields=thumbnail_url");
65
  curl_setopt($ch, CURLOPT_HEADER, 0);
66
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
67
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
68
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
69
  $output = curl_exec($ch);
70
  curl_close($ch);
126
  preg_match('#http://w?w?w?.?youtube.com/watch\?v=([A-Za-z0-9\-_]+)#s', $markup, $matches);
127
  }
128
 
129
+ // Checks for YouTube Lyte
130
+ if(!isset($matches[1]) && function_exists('lyte_parse')) {
131
+ preg_match('#<div class="lyte" id="([A-Za-z0-9\-_]+)"#s', $markup, $matches);
132
  }
133
 
134
  // If we've found a YouTube video ID, create the thumbnail URL
221
  // Dailymotion flash
222
  preg_match('#<object[^>]+>.+?http://www.dailymotion.com/swf/video/([A-Za-z0-9]+).+?</object>#s', $markup, $matches);
223
 
224
+ // Dailymotion url
225
+ if(!isset($matches[1])) {
226
+ preg_match('#http://www.dailymotion.com/video/([A-Za-z0-9]+)#s', $markup, $matches);
227
+ }
228
+
229
  // Dailymotion iframe
230
  if(!isset($matches[1])) {
231
  preg_match('#http://www.dailymotion.com/embed/video/([A-Za-z0-9]+)#s', $markup, $matches);