- You have to be sure that you have the php PEAR prereq packages installed. The only one you absolutely need is HTTP_Request. If you want to do any caching, you'll also need to install the DB package.
NOTE: If you have installed version 1.3.1 of phpFlickr or later with the prereqs included, you can skip this step.
If you have PEAR installed on your *nix server, you can run "pear install [package]" from the command line. You can find much more information and documentation at http://pear.php.net/. You can get detailed installation instructions there.
- Copy the files contained in the archive into the same folder on your server. They need to be readible by your web server. You can put them into an include folder defined in your php.ini file, if you like, though it's not required.
- All you have to do now is include the phpFlickr.php file in your PHP scripts and create an instance. For example:
$f = new phpFlickr();
The constructor has three arguments:
- $api_key – This is the API key given to you by flickr.com. This argument is required and you can get an API Key at: http://www.flickr.com/services/api/key.gne
- $secret – The "secret" is optional because is not required to make unauthenticated calls, but is absolutely required for the new authentication API (see Authentication section below). You will get one assigned alongside your api key.
- $die_on_error – This takes a boolean value and determines
whether the class will die (aka cease operation) if the API
returns an error statement. It defaults to false. Every method
will return false if the API returns an error. You can access
error messages using the getErrorCode() and getErrorMsg()
- All of the API methods have been implemented in my class. You can see a full list and documentation here: http://www.flickr.com/services/api/. To call a method, remove the "flickr." part of the name and replace any periods with underscores. For example, instead of flickr.photos.search, you would call $f->photos_search() or instead of flickr.photos.licenses.getInfo, you would call $f->photos_licenses_getInfo() (yes, it is case sensitive). All functions have their arguments implemented in the list order on their documentation page (a link to which is included with each function in the clasS). The only exception to this is photos_search() which has so many optional arguments that it's easier for everyone around if you just have to pass an associative array of arguments. See the comment in the photos_search() definition in phpFlickr.php for more information.
- January 2011
- May 2010
- September 2009
- March 2009
- December 2008
- November 2008
- January 2008
- October 2007
- April 2007
- February 2007
- December 2006
- October 2006
- September 2006
- August 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005