I understand that this may not be a priority at this point. But it would be nice to have the option for users to show private photos. The flickr API has a nice way of allowing this. This would be especially useful once flickrhood integration has taken place.

Falbum (for wordpress) has this implementation. Unfortunately, my coding skills aren't really up this task. But it would be VERY nice.

Comments

tobyberesford’s picture

I agree this would be a really useful feature. I am using the Flickr module on Drupal for an intranet for Breast Cancer Care charity. They could then use a flickr account for private images for the intranet.

Thanks

Toby

lmirguet’s picture

I'm also very interested by this feature. As soon as my users are logged on my drupal site they should be able to see my private photos.

j13’s picture

#3 - yes this would be the one feature I really could use.

kobnim’s picture

Version: 6.x-1.x-dev » 5.x-1.3

In case it is helpful to anyone else, here is what I am doing to access private flickr photos.

Step #1:
In addition to the flickr api_key and api_secret, which you presumably already have, you will need an authorization token. You can get that here: http://phpflickr.com/tools/auth/

Step #2:
Install the phpflickr library: http://phpflickr.com/
You can install it, for example, in a subdirectory of flickr.module

Step #3:
Generate the url:

function get_flickr_url($photo_id) {
  static $flickr;  
  static $api_key = ... // your flickr api key
  static $api_secret = ... // your api secret
  static $auth_token = ... // your authorization token

  if (!isset($flickr)) {
    require_once drupal_get_path('module', 'flickr').'/phpFlickr/phpFlickr.php';
    $flickr = new phpFlickr($api_key, $api_secret);
    $flickr->setToken($auth_token);
  }

  $sizes = $flickr->photos_getSizes($photo_id);
  $url=$sizes[0]['source']; // for the thumbnail size version
  return ($url);
}

- Mindy

kobnim’s picture

One more thing I forgot to mention.

Go back to the page where you applied for your api_key and api_secret:
http://www.flickr.com/services/api/keys/

Click "your api keys"
Click "edit key details"

Set "authentication type": web application
Set "callback url": http://phpflickr.com/tools/auth/auth.php

- Mindy

irtech’s picture

Can you give a little more info on how the code is to be used?

I'm not sure where that function is supposed to go (passing in a photo_id and returning a url??)

kobnim’s picture

Yes, you pass in the flickr ID of your photo and the function passes back the url for that photo.
Does this answer your question?

- Mindy

Anonymous’s picture

I'll look into this , thanks

Anonymous’s picture

Assigned: Unassigned »

Will work on this next month

Anonymous’s picture

Version: 5.x-1.3 » 6.x-1.x-dev
bobanahalf’s picture

Looking forward to this one. Thanks for looking into it, Paul.

Anonymous’s picture

Please continue to discuss how you would like private photos to be used by the flickr module. I'm, coming back to this early next month ..

bobanahalf’s picture

There are a couple of flavors of spec in this thread. I'm not 100% sure what's being requested, but would like to get my two cents in. So I'm summarizing what I see: let me know if I'm misreading. To let the cat out of the bag, I'm hoping for flavor 3....

Flavor 1: the original post
Authenticated users on my Drupal site could create flickr nodes that point to their own protected flickr photos. In combination with phpflickr, flickr.module would provide the necessary credentials to show those protected photos to other users authenticated on my Drupal site.

Flavor 2: Comment #1
Authenticated users on my Drupal site could provide a flickr username and password to access protected content. I guess the flickr security would be in charge here. (probably mis-reading comment #1)

Flavor 3: Comment #2
Authenticated users on my Drupal site can view my private flickr photos. This is essentially the same as the current flickr.module, but phpflickr and flickr.module provide the necessary credentials to show my protected content. As if my Drupal site had it's own guest pass to my photos. Security is handled by my site.

krwester’s picture

Since I was the original poster, I will try to expand on what I was hoping for at that time. Currently each user can enter in their flickr username on the account page, and this in turn enables a page/node at /flickr/drupaluserid with their photos. What I was hoping for was that the user could go through the authentication with flickr when they entered their username and they could decide what photos would be shown on the site (i.e friends, family, all...). In my mind this is sort of a superset of Flavor #3, where all the authentication is handled as in flavor 1, but just for the "admin" user and not for all users. So I would be very cool with flavor 3, but it seems that if we were lucky enough to get flavor 1, flavor 3 would be included.

I can't say I understand flavor 2.

Anonymous’s picture

Status: Active » Closed (fixed)

As we have had so few requests over the past two years it looks as though the vast majority of people are serviced nicely by a module that request public photos from flickr.

This may be a good candidate for a contributed module that works with this module.

Best, Paul

seanr’s picture

Assigned: » seanr
Status: Closed (fixed) » Needs work

I'm interested in this as well and will work on a patch based on the above code. I think it makes the most sense as a patch to this module rather than a whole new module.

jbomb’s picture

The flickr module will have to be patched no matter what.

The only way to retrieve private images and private photosets through the API is to include an authorization token with the signed request. This can be accomplished by adding the authorization token to the second argument in flickr_request(), however the following invoke flickr_request privately:

flickr_photo_get_info
flickr_photoset_get_info
flickr_photoset_get_list
flickr_photos_search

seanr’s picture

I've been working on this, but I'm having a hellacious time getting Flickr to give me a damned auth token. I got the frob, but the auth token step always returns errors (it either won't accept the api_key or the frob every farking time). They really did not need to make this so damned complex; it's absolutely ridiculous.

riddles’s picture

What I'd really like to do is to somehow map my local users to a flickr account (not sure how to do that). The underlying reason is that I'd like to show images in the random block (or elsewhere) based on the fact if someone is in the family, friends or public category.

k_and_j’s picture

I see that there have been no posts on this for over half a year. Hopefully someone is still considering working on this.

I think what I'm looking for is Flavor #3 from the post above - that would be simplest in terms of the other users not having to login somewhere else, but, at this point, any way to get private Flickr photos onto my site would be great. Afterall, I can use Drupal to control who is seeing them. (I had previously used gallery, but Flickr has really surpassed gallery in terms of user-friendliness).

seanr’s picture

Assigned: seanr » Unassigned

I eventually got it partially working, but then the client pulled the plug on it so I was never able to finish it. Unfortunately, I'm unable to continue helping with this one (just don't have time).

bobanahalf’s picture

still interested

Anonymous’s picture

Status: Needs work » Closed (won't fix)

No plans to extend the module to handle private photos.

Best,
Paul Booker
Appcoast

oneone’s picture

My very particular issue is solved using phpflickr.

Problem description
Showing a photographer's private flickr collection on a drupal site using this module.

Solution

  1. Add the flickr module to your drupal site.
  2. Generate flickr api and secret keys.
  3. Put flickr api and secret keys in modules config screen (site configuration -> flickr).
  4. Update auth.php and getToken.php with keys.
  5. Dump auth.php, getToken.php, and phpFlickr.php in site root.
  6. Update the callback url in flickr to site's auth.php.
  7. Get your flickr token by surfing to your getToken.php file. (If you get an error in auth.php 'unexpected T_UNSET', just comment that line.)
  8. Copy and save your token.
  9. Delete the phpflickr files from your site - you don't need them anymore.
  10. Update this modules flickr.inc flickr_request function. Add $args['auth_token'] = 'YOUR_TOKEN_HERE'; to the list of parameters at the start of the function.
  11. You're done.

I hope this helps someone.

mottolini’s picture

@oneone: Thanks it works for me too!

I would just add some items to your list...

Solution

  1. Add the flickr module to your drupal site.
  2. Generate flickr api and secret keys.
  3. Put flickr api and secret keys in modules config screen (site configuration -> flickr).
  4. Download the phpflickr library: http://phpflickr.com/
  5. Update auth.php and getToken.php with keys.
  6. Dump auth.php, getToken.php, and phpFlickr.php in site root.
  7. Update the callback url in flickr to site's auth.php.
  8. Get your flickr token by surfing to your getToken.php file. (If you get an error in auth.php 'unexpected T_UNSET', just comment that line.)
  9. If you get an error from Flickr saying "page not found", copy the url in the address bar from the name of your site up to the end of the frob and use it in a new browser window
  10. Copy and save your token.
  11. Delete the phpflickr files from your site - you don't need them anymore.
  12. Update this modules flickr.inc flickr_request function. Add $args['auth_token'] = 'YOUR_TOKEN_HERE'; to the list of parameters at the start of the function.
  13. You're done.
hughbris’s picture

I can confirm that you can access private photos (flavor #3) if you pass the shared secret and authentication code when calling the API. phpFlickr, used by Drupal's Flickr API module, allows both of these settings but the Flickr API module does not make use of either. It's particularly strange that the Flickr API module has a setting for the shared secret but never uses it. I've submitted a bug report and patch for that.

Drupal's Flickr API module doesn't contain a setting for the authentication code at all, and this is also needed to access private photos. My patch adds this setting and uses it where supplied in the instantiation of the phpFlickr class.

So, this is not the Flickr module as such, but this will work with any other module that uses Flickr API module (like Flickr Rippr), and it shows it can be done.

It might be of interest that I've also created a patch which adds a Drupal implementation of the authentication token grabbing tool provided in the phpFlickr module and described in its README. Some of you in this issue's comments have attempted to describe ways to accomplish the same thing.

How to use it is all documented with the issue. I'd love to hear some feedback before I tweak it.

Hope that's useful, at least in a theoretical sense :)