Static helper class for interaction with the Flickr photo storage website.

package Client

 Methods

Authenticate onto Flickr unless already done.

auth(string $permissions) 
Static

This redirects the user to the Flickr authentication page asking them to confirm access.

Parameters

$permissions

string

Specify 'read' or 'write' to determine the level of permissions required.

<p>Generates a flickr linked photo selector control.

flickr_selector(string $div_id) : string
Static

This requires a call to flickr_helper::auth to have been made first and the user to have followed the login process to Flickr, otherwise a normal image upload box will be displayed.

<

p>

In order to get the flickr_select control working, you need to first obtain a Flickr API key from http://www.flickr.com/services/api/. When you register for the key you will also be given a "secret" - a second code that you need to supply to the Indicia data entry helpers. Once you have the keys, go to your client_helpers/helper_config.php file and enter them into the $flickr_api_key and $flickr_api_secret values.

In addition to specifying the api key and secret, you also need to tell Flickr where to link to on your website after authenticating the user (the callback URL). There is a ready-made PHP script in the Indicia code which you can use - client_helpers/flickr_auth.php. So, if your code is running on a page at http://www.example.com/data_entry.php, with your client helpers in a sub-folder, you will have a callback URL of http://www.example.com/client_helpers/flickr_auth.php. You can list your API keys at http://www.flickr.com/services/api/keys/, then click the Edit key details for the key you have registered. Now enter your callback URL in the respective field and then save the key.

Parameters

$div_id

string

Name and id of the div element that is generated. Defaults to Flickr.

Returns

stringHTML to insert into the web-page for the Flickr control.