You are here

function flickrapi_phpFlickr in Flickr API 5

Same name and namespace in other branches
  1. 6 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.

1 call to flickrapi_phpFlickr()
flickrapi_get_user_nsid in ./flickrapi.module
Tries to match an 'identifier' onto a flickr nsid

File

./flickrapi.module, line 81

Code

function flickrapi_phpFlickr() {
  $include_file = drupal_get_path('module', 'flickrapi') . '/phpFlickr/phpFlickr.php';
  if (!file_exists($include_file)) {
    drupal_set_message(t("Missing phpFlickr - expected to find it at !file", array(
      '!file' => $include_file,
    )));
    return false;
  }
  require_once $include_file;
  $api_key = variable_get('flickrapi_api_key', '');
  if (!$api_key) {
    drupal_set_message(t("Flickr API key not set"), 'error');
    if (user_access('Administer global flickr api settings')) {
      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);
  $flickr
    ->enableCache("fs", variable_get('flickrcachepath', '/tmp'));
  return $flickr;
}