Commit 8d757ac2 authored by Martin Postma's avatar Martin Postma
Browse files

Issue #2443705 by lolandese: Filter on date taken for Flickr Blocks taken...

Issue #2443705 by lolandese: Filter on date taken for Flickr Blocks taken dynamically from a Date field attached to the node on the same page
parent 1661aae5
Loading
Loading
Loading
Loading
+90 −16
Changes for block/flickr_block.module: 90 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -23,32 +23,32 @@ function flickr_block_help($path, $arg) {
 */
function flickr_block_info() {
  // User blocks.
  $blocks[0]['info'] = t("Flickr: Node author photos optionally tagged as a taxonomy term or near the location attached to the node that is on the same page as this block (dynamic content)");
  $blocks[0]['info'] = t("Flickr: Node author photos corresponding with a node's taxonomy term, location or date field (1)");
  $blocks[1]['info'] = t("Flickr: Node author recent photosets");
  $blocks[2]['info'] = t("Flickr: Node author photos optionally tagged as a taxonomy term or near the location attached to the node that is on the same page as this block (dynamic content) (extra instance)");
  $blocks[2]['info'] = t("Flickr: Node author photos corresponding with a node's taxonomy term, location or date field (2)");

  // Site wide blocks.
  $blocks[3]['info'] = t('Flickr: User photos optionally tagged as a taxonomy term or near the location attached to the node that is on the same page as this block (dynamic content)');
  $blocks[3]['info'] = t("Flickr: User photos corresponding with a node's taxonomy term, location or date field (1)");
  $blocks[4]['info'] = t('Flickr: User recent photosets');
  $blocks[5]['info'] = t('Flickr: User photos optionally tagged as a taxonomy term or near the location attached to the node that is on the same page as this block (dynamic content) (extra instance)');
  $blocks[6]['info'] = t('Flickr: Group photos optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content)');
  $blocks[5]['info'] = t("Flickr: User photos corresponding with a node's taxonomy term, location or date field (2)");
  $blocks[6]['info'] = t("Flickr: Group photos corresponding with a node's taxonomy term (1)");

  // Photoset blocks.
  $blocks[7]['info'] = t('Flickr: Set photos optionally tagged as a taxonomy term  attached to the node that is on the same page as this block (dynamic content)');
  $blocks[8]['info'] = t('Flickr: Set photos optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content) (extra instance)');
  $blocks[7]['info'] = t("Flickr: Set photos corresponding with a node's taxonomy term (1)");
  $blocks[8]['info'] = t("Flickr: Set photos corresponding with a node's taxonomy term (2)");

  // Returns a list of favorite public photos for the given user.
  $blocks[9]['info'] = t("Flickr: Favorites optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content)");
  $blocks[9]['info'] = t("Flickr: Favorites corresponding with a node's taxonomy term (1)");

  $blocks[10]['info'] = t("Flickr: Group photos optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content) (extra instance)");
  $blocks[10]['info'] = t("Flickr: Group photos corresponding with a node's taxonomy term (2)");
  $blocks[11]['info'] = t("Flickr: User photos with specific tags");
  $blocks[12]['info'] = t("Flickr: Favorites optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content) (extra instance)");
  $blocks[12]['info'] = t("Flickr: Favorites corresponding with a node's taxonomy term (2)");

  $blocks[13]['info'] = t("Flickr: Node author favorites (what they like from others, but all together) optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content)");
  $blocks[14]['info'] = t("Flickr: Node author favorites optionally tagged as a taxonomy term attached to the node that is on the same page as this block (dynamic content) (extra instance)");
  $blocks[13]['info'] = t("Flickr: Node author favorites (what they like from others, but all together) corresponding with a node's taxonomy term (1)");
  $blocks[14]['info'] = t("Flickr: Node author favorites corresponding with a node's taxonomy term (2)");

  $blocks[15]['info'] = t("Flickr: Node author gallery photos (arbitrary selection by author of other's photos) optionally with gallery title as a taxonomy term attached to the node that is on the same page as this block (dynamic content)");
  $blocks[16]['info'] = t("Flickr: Node author gallery photos optionally titled as a taxonomy term attached to the node that is on the same page as this block (dynamic content) (extra instance)");
  $blocks[15]['info'] = t("Flickr: Node author gallery photos (arbitrary selection by author of other's photos) corresponding with a node's taxonomy term (1)");
  $blocks[16]['info'] = t("Flickr: Node author gallery photos corresponding with a node's taxonomy term (2)");

  for ($i = 0; $i < 17; $i++) {
    $blocks[$i]['cache'] = DRUPAL_CACHE_CUSTOM;
@@ -80,6 +80,7 @@ function flickr_block_configure($delta = '') {
    'media' => 'photos',
    'vocab' => '',
    'geo' => '',
    'date' => '',
    'extend' => variable_get('flickr_extend', 1),
    'min_title' => variable_get('flickr_title_suppress_on_small', '100'),
    'min_metadata' => variable_get('flickr_metadata_suppress_on_small', '150'),
@@ -108,6 +109,9 @@ function flickr_block_configure($delta = '') {
  if (!isset($settings['geo'])) {
    $settings['geo'] = '';
  }
  if (!isset($settings['date'])) {
    $settings['date'] = '';
  }
  if (!isset($settings['extend'])) {
    $settings['extend'] = variable_get('flickr_extend', 1);
  }
@@ -280,6 +284,24 @@ function flickr_block_configure($delta = '') {
      '#description'   => t("Limit the Flickr images to those that have a geo location near to the geofield found for the node on the page the block is displayed on.<br />If not on a node page, all photos will be diplayed. To avoid this set the visibility settings below to <em>Only the listed pages</em> specified as <em>node/*</em>."),
    );
  }
  if (module_exists('date')) {
    // Get a list of existing date ields.
    $fields = field_read_fields(array('type' => 'datetime'));
    $checklist_fields_array = array('0' => '<none>');
    foreach ($fields as $item) {
      $key = $item['field_name'];
      $value = $item['field_name'];
      $checklist_fields_array[$key] = $value;
    }
    $form["flickr_block_{$delta}_date"] = array(
      '#type'          => 'select',
      '#title'         => t('Filter by a date field (machine names)'),
      '#position'      => 'left',
      '#options'       => $checklist_fields_array,
      '#default_value' => $settings['date'],
      '#description'   => t("Limit the Flickr images to those that have are taken on or between the dates attached to the node on the page the block is displayed on.<br />If not on a node page, all photos will be diplayed. To avoid this set the visibility settings below to <em>Only the listed pages</em> specified as <em>node/*</em>."),
    );
  }
  // Override default settings to force or suppress the display of the caption
  // title and metadata.
  $attribution = l(t('proper attribution'), 'https://www.flickr.com/services/developer/attributions/', array(
@@ -332,6 +354,12 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      // Photoset, not photos.
      $form["flickr_block_{$delta}_show_n"]['#title'] = t('Show the last <em>n</em> photosets');
      $form["flickr_block_{$delta}_show_n"]['#description'] = t("The block will show this many of the user's photosets.");
@@ -356,6 +384,9 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      break;

    // Photos from a Flickr user.
@@ -388,6 +419,9 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      break;

    // Recent photosets from a Flickr user.
@@ -404,6 +438,9 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      // Photosets, not photos.
      $form["flickr_block_{$delta}_show_n"]['#title'] = t('Show the last <em>n</em> photosets');
      $form["flickr_block_{$delta}_show_n"]['#description'] = t("The block will show this many of the user's photosets.");
@@ -428,6 +465,9 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      break;

    // Photos from a Flickr photoset.
@@ -440,6 +480,9 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      break;

    // Photos with a specific tag from a Flickr user.
@@ -454,6 +497,9 @@ function flickr_block_configure($delta = '') {
      if (module_exists('geofield') || module_exists('location_node')) {
        unset($form["flickr_block_{$delta}_geo"]);
      }
      if (module_exists('date')) {
        unset($form["flickr_block_{$delta}_date"]);
      }
      if (empty($default_userid)) {
        $form["flickr_block_{$delta}_user_id"]['#description'] = t("A Flickr user ID (number@number, alias, username or email). Leave empty or use the keyword <em>public</em> to grab CC licensed Public photos.");
      }
@@ -541,6 +587,7 @@ function flickr_block_save($delta = '', $edit = array()) {
      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
      $geo = module_exists('geofield') || module_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
      $date = module_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
      variable_set('flickr_block_' . $delta, array(
        'show_n' => (int) $edit["flickr_block_{$delta}_show_n"],
        'size' => $edit["flickr_block_{$delta}_size"],
@@ -550,6 +597,7 @@ function flickr_block_save($delta = '', $edit = array()) {
        'vocab' => $vocab,
        'extend' => $extend,
        'geo' => $geo,
        'date' => $date,
        'min_title' => $edit["flickr_block_{$delta}_min_title"],
        'min_metadata' => $edit["flickr_block_{$delta}_min_metadata"],
      ));
@@ -595,6 +643,7 @@ function flickr_block_save($delta = '', $edit = array()) {
      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
      $geo = module_exists('geofield') || module_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
      $date = module_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
      variable_set('flickr_block_' . $delta, array(
        'user_id' => $edit["flickr_block_{$delta}_user_id"],
        'show_n' => (int) $edit["flickr_block_{$delta}_show_n"],
@@ -605,6 +654,7 @@ function flickr_block_save($delta = '', $edit = array()) {
        'vocab' => $vocab,
        'extend' => $extend,
        'geo' => $geo,
        'date' => $date,
        'min_title' => $edit["flickr_block_{$delta}_min_title"],
        'min_metadata' => $edit["flickr_block_{$delta}_min_metadata"],
      ));
@@ -762,6 +812,7 @@ function flickr_block_view($delta = '') {
    'media' => 'photos',
    'vocab' => '',
    'geo' => '',
    'date' => '',
    'extend' => variable_get('flickr_extend', 1),
    'min_title' => variable_get('flickr_title_suppress_on_small', '100'),
    'min_metadata' => variable_get('flickr_metadata_suppress_on_small', '150'),
@@ -802,6 +853,9 @@ function flickr_block_view($delta = '') {
  if (!isset($settings['geo'])) {
    $settings['geo'] = '';
  }
  if (!isset($settings['date'])) {
    $settings['date'] = '';
  }
  if (!isset($settings['min_title'])) {
    $settings['min_title'] = variable_get('flickr_title_suppress_on_small', '100');
  }
@@ -924,6 +978,15 @@ function flickr_block_view($delta = '') {
              $lat = NULL;
              $lon = NULL;
            }
            if (module_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
              $value = field_get_items('node', $node, $settings['date']);
              $datefrom = $value[0];
              $dateto= $value[1];
            }
             else {
              $datefrom = NULL;
              $dateto = NULL;
            }
          }
          break;

@@ -954,7 +1017,7 @@ function flickr_block_view($delta = '') {
            // Only if on a node page use it's terms.
            $tags = (($nid = (int) arg(1)) && arg(0) == 'node' && ((arg(2) == "" || arg(2) == 'view'))) ? $tags : '';
            $block['subject'] = NULL;
            $block['content'] = _flickr_album('user', $user->flickr['nsid'], $settings['show_n'], $settings['size'], $settings['media'], $tags, $tags_user, $delta, $settings['sort'], variable_get('flickr_block_heading', 'h2'), $settings['min_title'], $settings['min_metadata'], $settings['vocab'], $settings['filter'], NULL, NULL, NULL, NULL, NULL, $settings['extend']);
            $block['content'] = _flickr_album('user', $user->flickr['nsid'], $settings['show_n'], $settings['size'], $settings['media'], $tags, $tags_user, $delta, $settings['sort'], variable_get('flickr_block_heading', 'h2'), $settings['min_title'], $settings['min_metadata'], $settings['vocab'], $settings['filter'], $lat, $lon, NULL, $datefrom, $dateto, $settings['extend']);
            break;

          // User favorite Flickr photos.
@@ -1037,14 +1100,25 @@ function flickr_block_view($delta = '') {
          $lat = NULL;
          $lon = NULL;
        }
        if (module_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
          $value = field_get_items('node', $node, $settings['date']);
          $datefrom = substr($value[0]['value'], 0, strrpos($value[0]['value'], ' '));
          $dateto= substr($value[0]['value2'], 0, strrpos($value[0]['value2'], ' '));
        }
        else {
          $datefrom = NULL;
          $dateto = NULL;
        }
      }
      else {
        $tags = '';
        $lat = NULL;
        $lon = NULL;
        $datefrom = NULL;
        $dateto = NULL;
      }
      $block['subject'] = NULL;
      $block['content'] = _flickr_album('user', $settings['user_id'], $settings['show_n'], $settings['size'], $settings['media'], $tags, '', $delta, $settings['sort'], variable_get('flickr_block_heading', 'h2'), $settings['min_title'], $settings['min_metadata'], $settings['vocab'], $settings['filter'], $lat, $lon, NULL, NULL, NULL, $settings['extend']);
      $block['content'] = _flickr_album('user', $settings['user_id'], $settings['show_n'], $settings['size'], $settings['media'], $tags, '', $delta, $settings['sort'], variable_get('flickr_block_heading', 'h2'), $settings['min_title'], $settings['min_metadata'], $settings['vocab'], $settings['filter'], $lat, $lon, NULL, $datefrom, $dateto, $settings['extend']);
      break;

    // Recent photosets from a Flickr user.
+14 −14
Changes for flickr.inc: 14 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ function flickr_img($photo, $size = NULL, $attributes = NULL) {
  }
  $info = !is_array($photo['title']) ? flickr_photos_getinfo($photo['id']) : '';
  if (arg(2) != 'sets') {
  $taken_short = isset($info['dates']['taken']) ? format_date(strtotime($info['dates']['taken']), 'short') : format_date(strtotime($photo['dates']['taken']), 'short');
  $taken_short = isset($info['dates']['taken']) ? format_date(strtotime($info['dates']['taken']), 'short', '', NULL) : format_date(strtotime($photo['dates']['taken']), 'short', '', NULL);
  }
  $taken_short = empty($taken_short) ? '' : $taken_short . ' - ';
  $title = is_array($photo['title']) ? str_replace('"', "'", htmlspecialchars_decode(strip_tags($photo['description']['_content']))) : str_replace('"', "'", htmlspecialchars_decode(strip_tags($info['description']['_content'])));
@@ -582,7 +582,7 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
  // Also Flickr converts tags to lowercase, removes spaces and the ampersand.
  $tags = strtolower(str_replace(array(' ', '&'), '', $tags));
  // drupal_is_front_page() is added because it also can have arg(0) == 'node'.
  $cache = cache_get('flickr_block_' . $delta . '_' . $id . '_' . $tags . '_' . $lat . '_' . arg(0) . '_' . drupal_is_front_page() . '_' . $page);
  $cache = cache_get('flickr_block_' . $delta . '_' . $id . '_' . $tags . '_' . $lat . '_' . $datefrom . '_' . arg(0) . '_' . drupal_is_front_page() . '_' . $page);
  // If $delta is a number it is a block that could be cached.
  if ($cache && is_numeric($delta)) {
    $output = $cache->data;
@@ -736,15 +736,15 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
    ));
    if (substr($datefrom, 0, 10) == substr($dateto, 0, 10) && !empty($datefrom)) {
      // A single date.
      $str = format_date(strtotime(substr($datefrom, 0, 10)), 'medium');
      $str = format_date(strtotime(substr($datefrom, 0, 10)), 'medium', '', NULL);
      // Remove everthing after the last dash to remove the time.
      $taken = ' ' . t('taken on') . ' ' . substr($str, 0, strrpos($str, '-'));
    }
    // Multiple days.
    elseif (!empty($datefrom)) {
      // Remove everthing after the last dash to remove the time.
      $str = format_date(strtotime(substr($datefrom, 0, 10)), 'medium');
      $strto = format_date(strtotime(substr($dateto, 0, 10)), 'medium');
      $str = format_date(strtotime(substr($datefrom, 0, 10)), 'medium', '', NULL);
      $strto = format_date(strtotime(substr($dateto, 0, 10)), 'medium', '', NULL);
      $taken = ' ' . t('taken from') . ' ' . substr($str, 0, strrpos($str, '-')) . ' ' . t('to') . ' ' . substr($strto, 0, strrpos($strto, '-'));
    }
    else {
@@ -1030,7 +1030,7 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
        $page = ($sort == 'random' && isset($total) && $total > variable_get('flickr_per_page', 100) && empty($tags)) ? mt_rand(1, floor($total / variable_get('flickr_per_page', 100)) + $rest_ok) : $page;
        // Debug info.
        if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
          dpm("Arguments passed to 'function _flickr_album()': " . '$type=' . $type . ' $delta=' . $delta . ' $id=' . $id . ' $sort=' . $sort . ' $filter=' . $filter . ' $page=' . $page . ' $per_page=' . $per_page . ' $tags=' . $tags . ' $vocab_isset=' . $vocab_isset . ' $total=' . $total . ' $lat=' . $lat . ' $lon=' . $lon . ' $radius=' . $radius . ' $extend=' . $extend);
          dpm("Arguments passed to 'function _flickr_album()': " . '$type=' . $type . ' $delta=' . $delta . ' $id=' . $id . ' $sort=' . $sort . ' $filter=' . $filter . ' $page=' . $page . ' $per_page=' . $per_page . ' $tags=' . $tags . ' $vocab_isset=' . $vocab_isset . ' $total=' . $total . ' $lat=' . $lat . ' $lon=' . $lon . ' $radius=' . $radius . '$datefrom=' . $datfrom . ' $dateto=' . $dateto . ' $extend=' . $extend);
        }
        // Get a list of "all" the photos. This is cached.
        switch ($type) {
@@ -1295,9 +1295,9 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
        // A (too complex) series of conditions to loop through to generate the
        // photos of an album. TODO: Implement simplification and better logic.
        // No Flickr tags specified and on a node page.
        if ($vocab_isset != 0 && empty($tags) && (arg(0) == 'node' && is_numeric(arg(1)) && (arg(2) == '' || arg(2) == 'view'))) {
        if ($vocab_isset == -1 && empty($tags) && empty($lat) && (arg(0) == 'node' && is_numeric(arg(1)) && (arg(2) == '' || arg(2) == 'view'))) {
          $vocab_name = taxonomy_vocabulary_load($vocab_isset)->name;
          $output .= t("Post has no !vocab_name specified.", array('!vocab_name' => '<em>' . $vocab_name . '</em>'));
          $output .= t("Post has no !vocab_name or location specified.", array('!vocab_name' => '<em>' . $vocab_name . '</em>'));
        }
        // No Flickr tags specified, not on a node page, thus show all.
        elseif ((empty($tags)  && empty($tags_user)) || ($type == 'gallery' && is_numeric($delta))) {
@@ -1445,7 +1445,7 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
            $refresh = $sort == 'random' ? variable_get('flickr_block_refresh_random', 23) : variable_get('flickr_block_refresh_others', 31);
            // drupal_is_front_page() is added because it also can have
            // arg(0) == 'node'.
            cache_set('flickr_block_' . $delta . '_' . $idfix . '_' . $tags . '_' . $lat . '_' . arg(0) . '_' . drupal_is_front_page(), $output, 'cache', time() + $refresh * 60 * 60);
            cache_set('flickr_block_' . $delta . '_' . $idfix . '_' . $tags . '_' . $lat . '_' . $datefrom . '_' . arg(0) . '_' . drupal_is_front_page(), $output, 'cache', time() + $refresh * 60 * 60);
          }
          return $output;
        }
@@ -1466,10 +1466,10 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
          $radius = $radius / 3;
          $km = floor($radius);
          $mt = ltrim(str_replace(".", "", number_format($radius - $km, 3)), '0');
          $mt = empty ($mt) ? '' : $mt . ' mt';
          $km = $radius >= 1 ? $km . ' km' : '';
          $separator = empty($km) || empty($mt) ? '' : ' and ';
          $range = ' ' . t('in a range of') . ' '. $km . $separator . $mt;
          $mt = empty ($mt) ? '' : $mt . ' ' . t('mt');
          $km = $radius >= 1 ? $km . ' ' . t('km') : '';
          $separator = empty($km) || empty($mt) ? '' : ' ' . t('and') . ' ';
          $range = ' ' . t('in a radius of') . ' '. $km . $separator . $mt;
        }
        else {
          $range ='';
@@ -1496,7 +1496,7 @@ function _flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $si
      $refresh = $sort == 'random' ? variable_get('flickr_block_refresh_random', 23) : variable_get('flickr_block_refresh_others', 31);
      // drupal_is_front_page() is added because it also can have
      // arg(0) == 'node'.
      cache_set('flickr_block_' . $delta . '_' . $idfix . '_' . $tags . '_' . $lat . '_' . arg(0) . '_' . drupal_is_front_page() . '_' . $pagefix, $output, 'cache', time() + $refresh * 60 * 60);
      cache_set('flickr_block_' . $delta . '_' . $idfix . '_' . $tags . '_' . $lat . '_' . $datefrom . '_' . arg(0) . '_' . drupal_is_front_page() . '_' . $pagefix, $output, 'cache', time() + $refresh * 60 * 60);
    }
  }
  return $output;
+1 −1
Changes for flickr.module: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -610,7 +610,7 @@ function theme_flickr_photo($variables) {
  // Replace with $people['photostream'] if you want to link to the photostream.
  $username = $people['name'];
  // The date an image was taken formatted as 'time ago'.
  $taken = isset($info['dates']['taken']) ? '<a title="' . format_date(strtotime($info['dates']['taken']), 'long') . '">' . format_interval(time() - strtotime($info['dates']['taken']), 1) . '</a> ' . t('ago') : '';
  $taken = isset($info['dates']['taken']) ? '<a title="' . format_date(strtotime($info['dates']['taken']), 'long', '', NULL) . '">' . format_interval(time() - strtotime($info['dates']['taken']), 1) . '</a> ' . t('ago') : '';
  // A bunch of geo data.
  $neighbourhood = isset($info['location']['neighbourhood']['_content']) ? strip_tags($info['location']['neighbourhood']['_content']) . ', ' : '';
  $locality = isset($info['location']['locality']['_content']) ? strip_tags($info['location']['locality']['_content']) . ', ' : '';