| 1 |
// $Id:$
|
| 2 |
|
| 3 |
About
|
| 4 |
-----
|
| 5 |
|
| 6 |
Flickrblock is a simple module what generates blocks of Flickr images.
|
| 7 |
It is proof-of-concept and not yet ready for mainstream use (no proper access control and
|
| 8 |
error handling yet)
|
| 9 |
|
| 10 |
Currently 2 blocks are generated:
|
| 11 |
|
| 12 |
* 'Related Flickr Images' will show up on taxonomy/term/x pages. In addition for term name,
|
| 13 |
the synonyms are also considered (should also 'related terms' be matched?)
|
| 14 |
The block is useful f.e. travel sites where in each destination page the related
|
| 15 |
images are shown in sidebar, http://www.43places.com and http://technorati.com style
|
| 16 |
|
| 17 |
* 'My latest Flickr images' shows just stream of latest images added, matching the Flickr ID
|
| 18 |
|
| 19 |
Fetching the XML is done by Drupal's new excellent xmlrpc() function, it is favoured over REST
|
| 20 |
because of cleaner code.
|
| 21 |
|
| 22 |
PHP parsing is done by xml_parse_into_struct() and helper function that converts the
|
| 23 |
struct into a a more usable nested array. The array structure might be too complicated
|
| 24 |
though, looking for suggestions for simplifing.
|
| 25 |
|
| 26 |
|
| 27 |
Demo
|
| 28 |
----
|
| 29 |
http://kika.trip.ee (unstable)
|
| 30 |
|
| 31 |
|
| 32 |
Installation
|
| 33 |
------------
|
| 34 |
|
| 35 |
1. Go to http://flickr.com and register if you have not done it already
|
| 36 |
|
| 37 |
2. Upload some photos if you have not done it already
|
| 38 |
|
| 39 |
3. Note down your Flickr user ID. It can be done by browsing one of your photos -
|
| 40 |
the URL shows
|
| 41 |
|
| 42 |
http://www.flickr.com/photos/<your_user_id>/<photo_id>/
|
| 43 |
|
| 44 |
The <your_use_rid> looks like this: 44124434048@N01
|
| 45 |
|
| 46 |
4. Generate an API key here http://www.flickr.com/services/api/misc.api_keys.html
|
| 47 |
|
| 48 |
The API key looks like this: 08e1ae314c988a7a38323121620debd7
|
| 49 |
|
| 50 |
5. Add following lines to you site configuration file under /sites/default
|
| 51 |
(this is temporary until proper configuration is introduced)
|
| 52 |
|
| 53 |
$variable['flickr_uid'] = <your_user_id>
|
| 54 |
$variable['flickr_apik'] = <your_api_key>
|
| 55 |
|
| 56 |
Alternatively, if you are using flickr.module and configured that properly,
|
| 57 |
flickr_block.module respects those settings and you do not have add anything
|
| 58 |
to your configuration file
|
| 59 |
|
| 60 |
6. Copy flickr_block.module to your /modules directory and enable it in 'administration > modules'
|
| 61 |
|
| 62 |
7. Enable the blocks in 'administration > blocks'
|
| 63 |
|
| 64 |
|
| 65 |
Todo & Future
|
| 66 |
-------------
|
| 67 |
|
| 68 |
* 'See more pictures' link
|
| 69 |
* CC licence link
|
| 70 |
* access control
|
| 71 |
* error handling
|
| 72 |
* caching (should we cache xml, transformed array or images?)
|
| 73 |
* CSS classes
|
| 74 |
* image theme/CSS unification with image.module
|
| 75 |
|
| 76 |
* introduce configuration
|
| 77 |
* number of images be fetched
|
| 78 |
* move all flickr paths to configuration (they have changed their url schemas already!)
|
| 79 |
|
| 80 |
* more blocks
|
| 81 |
* blog block (requires separate flick_user_id for each user);
|
| 82 |
* my latest photosets
|
| 83 |
|
| 84 |
* testing, testing, testing
|
| 85 |
|
| 86 |
|
| 87 |
In future, I'd like to see this module integrated to Jonas' flickr.module
|
| 88 |
http://drupal.org/node/14912 after some more integration:
|
| 89 |
|
| 90 |
* unified naming conventions
|
| 91 |
* unified configuration
|
| 92 |
* unified xml parsing
|
| 93 |
* unified caching
|
| 94 |
|
| 95 |
|
| 96 |
Contact
|
| 97 |
-------
|
| 98 |
Kristjan Jansen
|
| 99 |
kika@trip.ee
|