You are here

function flickrapi_phpFlickr in Flickr API 6

Same name and namespace in other branches
  1. 5 flickrapi.module \flickrapi_phpFlickr()
  2. 7.2 flickrapi.module \flickrapi_phpFlickr()
  3. 7 flickrapi.module \flickrapi_phpFlickr()

Returns the phpFlickr object. If we need to change anything, such as making the cache configuration, then it'll all be done here.

2 calls to flickrapi_phpFlickr()
FlickrApiTestCase::testPhpFlickrClass in tests/flickrapi.test
flickrapi_get_user_nsid in ./flickrapi.module
Tries to match an 'identifier' onto a flickr nsid

File

./flickrapi.module, line 94

Code

function flickrapi_phpFlickr() {
  module_load_include('php', 'flickrapi', 'phpFlickr/phpFlickr');
  $api_key = variable_get('flickrapi_api_key', '');
  $api_secret = variable_get('flickrapi_api_secret', '');
  if (!$api_key) {
    drupal_set_message(t("Flickr API key not set"), 'error');
    if (user_access('configure flickr api')) {
      drupal_set_message(t("Goto !link to configure the Flickr API settings", array(
        '!link' => l('admin/settings/flickrapi', 'admin/settings/flickrapi'),
      )));
    }
  }
  $flickr = new phpFlickr($api_key, $api_secret);
  $flickr
    ->enableCache("fs", variable_get('flickrapi_cache_path', '/tmp'));
  return $flickr;
}