Index: vimeo_link_formatter.module =================================================================== --- vimeo_link_formatter.module (revision 21) +++ vimeo_link_formatter.module (working copy) @@ -55,7 +55,6 @@ function vimeo_link_formatter_field_formatter_view(&$entity_type, &$entity, &$field, &$instance, &$langcode, &$items, &$display) { // Call the function which handles this formatter. $function = __FUNCTION__ . '_' . $display['type']; - return call_user_func($function, $entity_type, $entity, $field, $instance, $langcode, $items, $display); } @@ -172,15 +171,20 @@ $url = array(); if ($id = $matches[2]) { - $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$id.php")); - $thumb_size = $display['settings']['thumb_size'] ? $display['settings']['thumb_size'] : 'medium'; + $video_raw = drupal_http_request("http://vimeo.com/api/v2/video/$id.php")->data; - $thumb_url = $hash[0]['thumbnail_'.$thumb_size]; + if ($video_raw) { + $video_hash = unserialize($video_raw); - $img = theme('image', array('path' => $thumb_url, 'alt' => $hash[0]['title'])); + $thumb_size = $display['settings']['thumb_size'] ? $display['settings']['thumb_size'] : 'medium'; - $ret[] = array('#markup' => $img); + $thumb_url = $video_hash[0]['thumbnail_'.$thumb_size]; + + $img = theme('image', array('path' => $thumb_url, 'alt' => $video_hash[0]['title'])); + + $ret[] = array('#markup' => $img); + } } else { // The link is not a valid Vimeo.com link.