function emimage_imageshack_data in Embedded Media Field 6.3
Same name and namespace in other branches
- 6 contrib/emimage/providers/imageshack.inc \emimage_imageshack_data()
File
- contrib/
emimage/ providers/ imageshack.inc, line 43 - This include processes imageshack.com image files for use by emfield.module.
Code
function emimage_imageshack_data($field, $item) {
$data = array();
$url = stristr($item['embed'], 'my.php?image=') ? _emimage_imageshack_scrape_image_url($item['embed']) : $item['embed'];
if (preg_match('!([^/.:@]+)\\.imageshack\\.us/([^/]+)/([^/]+)/(.+)$!i', $url, $matches)) {
$data = array(
'server' => $matches[1],
'a1' => $matches[2],
'a2' => $matches[3],
'file' => $matches[4],
'title' => '',
);
$data['emimage_data_version'] = EMIMAGE_IMAGESHACK_DATA_VERSION;
}
return $data;
}