... Elxis version 2009.3 codename Aphrodite is out, download it from Elxis Download Center (EDC) ...

Flickr API

From Elxis Official Documentation

Revision as of 21:32, 3 October 2009 by Datahell (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Flickr API allows you to easily get images from Flickr based on criteria. The API will search flickr for images matching the given criteria (tags) and return you the search results (images). The API was built for Elxis CMS by Is Open Source (Ioannis Sannos) and its usage is extremely easy. It can be used to display pictures from flickr related to a subject (any subject). For instance you can use it to display pictures from places from all around the world. See how Flickr API is implemented into IOS Reservations administration. Flickr API is also used on IOS NoobSlide module.


Features

  • Search by given tags (OR/AND keywords are also supported).
  • Limit the number of returned images.
  • Cache search results.
  • Sort results with many options.
  • Usage of CURL (if supported by the system) or fsockopen to retrieve the data from flickr.
  • Extremely lightweight application.
  • Can be easily expanded to support more features.


Usage

The usage of the flickr API for Elxis CMS is extremely easy. Here is a sample.

//include the API's class
require_once('flickr.class.php');
 
//set the search tags comma separated
$tags = 'egypt,giza';
 
//initialize the class
$f = new flickr($tags, $key, $secret);
 
//get results (photos)
$pictures = $f->getphotos();
 
//display the photos
if ($pictures) {
    foreach ($pictures as $pic) {
        echo '<img src="'.$pic['small'].'" alt="'.$pic['title'].'" border="0" /> '."\n";
    }
}

The above code will generate the following output

returned pictures from fkickr

License

The Flickr API built to retrieve images from Flickr for locations all around the world for IOS Rervations v3.0 which is a commercial component for Elxis CMS. So, the API's license is also commercial and the copyright owner is Ioannis Sannos. But if you want to create an application for Elxis CMS in which this API would be useful contact me and you might get my permission to use it in your own application.

Personal tools