You are here

function emimage_photobucket_data in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emimage/providers/photobucket.inc \emimage_photobucket_data()

File

contrib/emimage/providers/photobucket.inc, line 41
This include processes photobucket.com image files for use by emfield.module.

Code

function emimage_photobucket_data($field, $item) {
  $data = array();
  if (preg_match('![si]([^/.:@]+)\\.photobucket\\.com/albums/([^/]+)/([^/]+)/(\\?action=view&current=)?(.+)$!i', $item['embed'], $matches)) {
    $data = array(
      'server' => $matches[1],
      'album' => $matches[2],
      'owner' => $matches[3],
      'file' => $matches[5],
    );
    $data['title'] = emimage_photobucket_image_title($data['file'], $data);
    $data['emimage_data_version'] = EMIMAGE_PHOTOBUCKET_DATA_VERSION;
  }
  return $data;
}