--- drigg_embed.module	2008-04-10 01:44:19.000000000 -0400
+++ drigg_embed.module.new	2008-06-10 22:33:56.000000000 -0400
@@ -76,20 +76,6 @@ function drigg_embed_admin_settings(){
     '#required' => FALSE 
   ); 
 
-  $form['collegehumor'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('CollegeHumor settings'),
-    '#collapsible' => FALSE,
-    '#collapsed' => FALSE
-  );
-
-  $form['collegehumor']['drigg_embed_show_collegehumor'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Enable Collegehumor video embedding in stories'), 
-    '#default_value' => variable_get('drigg_embed_show_collegehumor',FALSE),
-    '#required' => FALSE 
-  ); 
-
   $form['metacafe'] = array(
     '#type' => 'fieldset',
     '#title' => t('Metacafe settings'),
@@ -184,11 +170,9 @@ function drigg_embed_contents($o,$node_u
   if(variable_get('drigg_embed_show_yahoo_video',FALSE)){
 
     if(preg_match('|video.yahoo.com/watch/([^/]*)/(.*)$|', $url, $matches)){
-
       if($teaser){
-        $return = '<div style="embedded-yahoo_video teaser"><a href="'.$node_url.'"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/sch/cn/video07/324210020080131_bd.jpg" width="80" height="60" alt="Veoh"/></div>';
-      } else {
-        
+        $return = '<div style="embedded-yahoo_video teaser"><a href="'.$node_url.'"><img src="http://thmg01.video.search.yahoo.com/image/'.$matches[1].'_01" width="80" height="60" title="'.$o->title.'"/></div>';
+      } else {      
         $return = '<div style="embedded-yahoo_video"><object width="512" height="323"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.0.41" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id='.$matches[1].'&vid='.$matches[2].'&lang=en-US&intl=us" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.0.41" type="application/x-shockwave-flash" width="512" height="323" allowFullScreen="true" flashVars="id='.$matches[2].'&vid='.$matches[1].'&lang=en-US&intl=us"></embed></object></div>';
       }
       return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
@@ -198,11 +182,9 @@ function drigg_embed_contents($o,$node_u
   if(variable_get('drigg_embed_show_google_video',FALSE)){
 
     if(preg_match('|video.google.com/videoplay\?docid=(.*)$|', $url, $matches)){
-
       if($teaser){
-        $return = '<div style="embedded-google_video teaser"><a href="'.$node_url.'"><img src="http://video.google.com/images/google-logo-sm.gif" width="80" height="60" alt="Veoh"/></div>';
+        $return = '<div style="embedded-google_video teaser"><a href="'.$node_url.'"><img src="http://video.google.com/img/logo_video.gif" width="80" height="60" title="'.$o->title.'"/></div>';
       } else {
-
         $return = '<div style="embedded-google_video"><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='.$matches[1].'&hl=en" flashvars=""> </embed></div>';
       }
       return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
@@ -210,12 +192,12 @@ function drigg_embed_contents($o,$node_u
   }
 
   if(variable_get('drigg_embed_show_ifilm',FALSE)){
-    if(preg_match('|www.spike.com/video/(.*)$|', $url, $matches)){
 
+    if(preg_match('|www.spike.com/video/(.*)$|', $url, $matches)){
+      $split = explode("/", $matches[1]);
       if($teaser){
-        $return = '<div style="embedded-ifilm teaser"><a href="'.$node_url.'"><img src="http://dyn.ifilm.com/website/spikelogo2.gif" width="80" height="60" alt="Veoh"/></div>';
+        $return = '<div style="embedded-ifilm teaser"><a href="'.$node_url.'"><img src="http://img1.ifilmpro.com/resize/image/stills/films/resize/istd/'.$split[1].'.jpg?width=80&height=60" width="80" height="60" title="'.$o->title.'"/></div>';
       } else {
- 
         $return = '<div style="embedded-ifilm"><embed wmode="transparent" width="425" height="350" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='.$matches[1].'&"> </embed></div>';
       }
       return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
@@ -223,12 +205,11 @@ function drigg_embed_contents($o,$node_u
   }
 
   if(variable_get('drigg_embed_show_veoh',FALSE)){
-    if(preg_match('|veoh.com/videos/([^/?]*)|', $url, $matches)){
 
+    if(preg_match('|veoh.com/videos/([^/?]*)|', $url, $matches)){
       if($teaser){
-        $return = '<div style="embedded-veohr teaser"><a href="'.$node_url.'"><img src="http://p-appserver.veoh.com/static/images/PlayThumbVeoh.jpg" width="80" height="60" alt="Veoh"/></div>';
-      } else {
-        
+        $return = '<div style="embedded-veoh teaser"><a href="'.$node_url.'"><img src="http://p-appserver.veoh.com/static/images/PlayThumbVeoh.jpg" width="80" height="60" title="'.$o->title.'"/></div>';
+      } else {    
         $return = '<div style="embedded-veoh"><embed src="http://www.veoh.com/videodetails2.swf?permalinkId='.$matches[1].'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" width="400" height="300" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></div>';
       }
       return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
@@ -236,12 +217,11 @@ function drigg_embed_contents($o,$node_u
   }
 
   if(variable_get('drigg_embed_show_revver',FALSE)){
-    if(preg_match('|revver.com/video/(.*?)/.*$|', $url, $matches)){
 
+    if(preg_match('|revver.com/video/(.*?)/.*$|', $url, $matches)){
       if($teaser){
-        $return = '<div style="embedded-revver teaser"><a href="'.$node_url.'"><img src="http://frame.revver.com/frame/120x90/'.$matches[1].'.jpg" alt="video thumbnail" /img> </div>';
+        $return = '<div style="embedded-revver teaser"><a href="'.$node_url.'"><img src="http://frame.revver.com/frame/80x60/'.$matches[1].'.jpg" title="'.$o->title.'"></a></div>';
       } else {
-        
         $return = '<div style="embedded-revver"><script src="http://flash.revver.com/player/1.0/player.js?mediaId:'.$matches[1].';width:480;height:392" type="text/javascript"></script> </div>';
       }
       return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
@@ -249,40 +229,24 @@ function drigg_embed_contents($o,$node_u
   }
 
   if(variable_get('drigg_embed_show_metacafe',FALSE)){
-    if(preg_match('|www\.metacafe\.com/watch/(.*?)/?$|', $url, $matches)){
 
+    if(preg_match('|www\.metacafe\.com/watch/(.*?)/?$|', $url, $matches)){
+      $split = explode("/", $matches[1]);
       if($teaser){
-        $return = '<div style="embedded-metacafe teaser"><a href="'.$node_url.'"><img src="http://i131.photobucket.com/albums/p285/taltalk/metacafe_logo_dim.gif" width=80 height=60 border=1 alt=""></a></div>';
+        $return = '<div style="embedded-metacafe teaser"><a href="'.$node_url.'"><img src="http://s3.mcstatic.com/thumb/'.$split[0].'.jpg" width="80" height="60" border=1 title="'.$o->title.'"></a></div>';
       } else {
-        
         $return = '<div style="embedded-metacafe"><embed src="http://www.metacafe.com/fplayer/'.$matches[1].'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed></div>';
       }
       return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
     }
   }
 
-
-  if(variable_get('drigg_embed_show_collegehumor',FALSE)){
-    if(preg_match('|^http://www.collegehumor.com/video:([^\&]+)|', $url, $matches)){
-
-      if($teaser){
-        $return = '<div style="embedded-collegehumor teaser"><a href="'.$node_url.'"><img src=" http://profile.ak.facebook.com/object2/1777/25/l6363207806_4049.jpg" width=80 height=60 border=1 alt=""></a></div>';
-      } else {
-        $return = '<div style="embedded-collegehumor"><object type="application/x-shockwave-flash"  data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='.$matches[1].'&fullscreen=1"  width="400" height="220" ><param name="allowfullscreen" value="true" /><param name="movie"  quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf? clip_id='.$matches[1].'&fullscreen=1" /></object></div>';
-      }
-      return variable_get('drigg_embed_before', '').$return.variable_get('drigg_embed_after', '');
-    }
-  }
-
   // Youtube: 'youtube'
   if(variable_get('drigg_embed_show_youtube',FALSE)){
 
-
-    #if(preg_match('|^http://www.youtube.com/watch\?v=([^\&]+)|', $url, $matches)){
-    if(preg_match('/youtube\.com\/watch\?v=(.*)/', $url, $matches)){
-
+    if(preg_match('/youtube\.com\/watch\?v=([A-Za-z0-9._%-]*)[&\w;=\+_\-]*/', $url, $matches)){
       if($teaser){
-        $return = '<div style="embedded-youtube teaser"><a href="'.$node_url.'"><img src="http://img.youtube.com/vi/'.$matches[1].'/2.jpg" width=80 height=60 border=1 alt=""></a></div>';
+        $return = '<div style="embedded-youtube teaser"><a href="'.$node_url.'"><img src="http://img.youtube.com/vi/'.$matches[1].'/0.jpg" width="80" height="60" border=1 title="'.$o->title.'"></a></div>';
       } else {
         $return = '<div style="embedded-youtube"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'.$matches[1].'&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$matches[1].'&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></div>';
       }
