function flickr_filter in Flickr 6
Same name and namespace in other branches
- 5 filter/flickr_filter.module \flickr_filter()
- 7 filter/flickr_filter.module \flickr_filter()
1 string reference to 'flickr_filter'
- flickr_admin_settings in ./
flickr.admin.inc - Implements hook_settings().
File
- filter/
flickr_filter.module, line 32
Code
function flickr_filter($op, $delta = 0, $format = -1, $text = '') {
if ($op == 'list') {
return array(
0 => t('Flickr linker'),
);
}
switch ($delta) {
case 0:
switch ($op) {
case 'description':
return t('Allows you to Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m]');
case 'no cache':
// TODO: only return true when testing the filter
// return TRUE;
return FALSE;
case 'prepare':
return $text;
case 'process':
$text = preg_replace_callback('/\\[flickr-photo:(.+?)\\]/', 'flickr_filter_callback_photo', $text);
$text = preg_replace_callback('/\\[flickr-photoset:(.+?)\\]/', 'flickr_filter_callback_photoset', $text);
return $text;
}
break;
}
}