Geeklog France

Open Source Content Management System

Flickr plugin

This is a simple Flickr plugin for Geeklog. All it does right now is to provide autotags.

[flickr:] will display a photo's thumbnail which links to the actual photo page on Flickr.

[flickr_gallery:] will embed super flexible galeries from any flickr account or group, using different parameters to customise it.

[flickr_slideshow:] will embed the same super slideshow that you can see on flickr site.

This is the documentation page and you could also visit the demo page.

Usage

[flickr:] autotag

Another beach

Once installed (see below), all you need to include a photo thumbnail in your stories or comments is the photo's id. When viewing a photo on flickr.com, you'll notice the URL looks something like this:

http://www.flickr.com/photos/dhaun/71877803/

So here “71877803” is the photo's id. Now you simply add that id in the [flickr:] autotag after the colon:

[flickr:71877803]

When the story (comment, …) is displayed, it will show the photo's thumbnail instead of the autotag. Clicking on the thumbnail will take you to the photo page on flickr (the above URL, in this example).

The plugin will get the photo's title from Flickr and display it as a title attribute when you hover your mouse over the thumbnail. If you'd rather provide your own title, simply enter it after the id:

[flickr:71877803 How to make a penguin fly]

Extended Syntax

You can also change the alignment of the image and its size:

[flickr:71877803 align:right size:square How to make a penguin fly]

The “align:” attribute accepts “left” and “right” as alignments, while the “size:” attribute accepts “square”, “thumbnail” (which is the default when no size is given), “small”, and “medium”.

The order of the two attributes doesn't matter, but they have to be listed before the photo's title text.

Caching

Please note that using [flickr:] autotags may significantly slow down your site, as the plugin will have to do 2 Flickr API calls for every thumbnail. And then your browser will do another request to get the actual thumbnail image.

Fortunately, phpFlickr provides caching to minimize the number of requests.

Two types of caching are provided: In the database or on the filesystem. Database caching is faster but requires the PEAR::DB package to be installed (not included with this plugin). Filesystem caching will store cache files on your webserver's filesystem (in Geeklog's “data” directory, unless changed in the plugin's config.php).

To enable caching, set 'Use cache' to true and then select either 'database' or 'filesystem' for the cache type. There are more configuration variables that let you choose the expiration timeout for cached items, the name of the cache table, and the location of the cache files. See the plugin's online config (new in version 1.1.0) for details.

[flickr_gallery:] autotag

The first parameter is the thumbnail limit. flick_gallery:5 will show 5 thumbnails.

The second parameters are optional

  • user_id (Optional) : The NSID of the user who's photo to search. If this parameter isn't passed then everybody's public photos will be searched.
  • tags (Optional) : A comma-delimited list of tags. Photos with one or more of the tags listed will be returned.
  • min_upload_date (Optional) : Minimum upload date. Photos with an upload date greater than or equal to this value will be returned. The date should be in the form of a unix timestamp.
  • max_upload_date (Optional) : Maximum upload date. Photos with an upload date less than or equal to this value will be returned. The date should be in the form of a unix timestamp.
  • min_taken_date (Optional) : Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. The date should be in the form of a mysql datetime.
  • max_taken_date (Optional) : Maximum taken date. Photos with an taken date less than or equal to this value will be returned. The date should be in the form of a mysql datetime.
  • sort (Optional) : The order in which to sort returned photos. Deafults to date-posted-desc (unless you are doing a radial geo query, in which case the default sorting is by ascending distance from the point specified). The possible values are: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, and relevance.
  • bbox (Optional) : A comma-delimited list of 4 values defining the Bounding Box of the area that will be searched.The 4 values represent the bottom-left corner of the box and the top-right corner, minimum_longitude, minimum_latitude, maximum_longitude, maximum_latitude. Longitude has a range of -180 to 180 , latitude of -90 to 90. Defaults to -180, -90, 180, 90 if not specified. Unlike standard photo queries, geo (or bounding box) queries will only return 250 results per page. Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against “parameterless searches” for queries without a geo component. A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters — If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future).
  • group_id (Optional) : The id of a group who's pool to search. If specified, only matching photos posted to the group's pool will be returned.
  • lat (Optional) : A valid latitude, in decimal format, for doing radial geo queries.Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against “parameterless searches” for queries without a geo component.A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters &emdash; If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future).
  • lon (Optional) : A valid longitude, in decimal format, for doing radial geo queries.Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against “parameterless searches” for queries without a geo component.A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters &emdash; If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future).
  • radius (Optional) : A valid radius used for geo queries, greater than zero and less than 20 miles (or 32 kilometers), for use with point-based geo queries. The default value is 5 (km).

A last optional parameter allow you to add a caption. Every text before the closing bracket will be use as the caption gallery.

Autotag flickr_gallery | [flickr_gallery:5 user_id:21913923@N03 tags:blue,green My nice caption]

[flickr_slideshow:] autotag

The first parameter is the flickr user ID.

  • A user ID : 21913923@N03

A second optional parameter allow you to specify a set ID for this user.

  • A set ID : 72157603679761232
Autotag slideshow | [flickr_slideshow:21913923@N03 set_id:72157603679761232]

Installation

Automatic install

1. As one of your site's Root users

  • visit {site_url}/admin/plugins.php
  • Upload the plugin archive (.zip) : Select it on your HD and press Upload.

2. If the installation completed successfully you are ready to go. Otherwise, check the geeklog error.log for errors.

  • <geeklog_dir>/logs/error.log

Manual install

1. Unpack the tarball in /path/to/geeklog/plugins/ (or unpack it on your PC and then upload the “flickr” folder to that directory)

2. Rename the “admin” folder to “flickr” and move it to /path/to/geeklog/public_html/admin/plugins/

3. Log into your site as the Admin user, select “Plugins” from the “Admins only” block, find the “flickr” entry and click on “install”

4. There's no step 4 - the plugin should be ready for use now. Check that you have a [flickr:] autotag in the list of available HTML tags when you create a new story or comment.

Upgrade

To upgrade from an earlier version, please upload all the files from this archive to their respective location, replacing the older versions of the same files or use the automatic way (see Automatic install above).

Once you've done that, log into your site as a member of the Root group (e.g. as user Admin). Go to the Admin's “Plugins” panel.

You can upgrade just by clicking the icon “Update” or click on the “edit” link for the Flickr plugin. You will be presented with an “Update” button. Click that button and you should get a message that the upgrade was successful. That's all.

Configuration

With Flickr plugin version 1.1.0 the plugin configuration is now online. Visit {site_url}/admin/configuration.php

Cache

See caching above.

jQuery

Use CND for jQuery library : Use google as a content network delivery for jQuery or use the javascript included file version (ver. 1.4)

Theme

Mini gallery pictures format : Could be square (default) or thumbnail ( rectangular).

Changelog

  • 1.1.1 Fix bug for upgrade from version 1.1.0
  • 1.1.0 Online config. [flickr_slideshow:] autotag
  • 1.0.0 Private release. [flickr_gallery:] autotag
  • 0.2.0 Extended syntax - introduced align: and size: attributes. The <img> tag now has a class=“flickr-photo” to allow further styling.
  • 0.1.2 Strip trailing slash from $_FL_CONF['cache_fs_name'] dynamically.
  • 0.1.1 Be more fault tolerant, e.g. when the photo does not exist. Upgraded included phpFlickr to version 1.5.1
  • 0.1.0 Initial release

Know Issues

Update from version 0.2.0 do not create the settings config. Delete and install the plugin again will solve this.

Authors

  • phpFlickr was written by Dan Coulter and released under the GPL. See http://www.phpflickr.com/ for details.
  • The Geeklog plugin is © 2006 Dirk Haun and also released under the GPL.
  • The geeklog plugin's use some Felipe Skroski code's from http://www.felipesk.com for the gallery autotag.
  • The version 1.0+ is made by ::Ben and also released under the GPL.
 
Logged in as: Guest (Guest)
/home/geeklog/public_html/wiki/data/pages/plugins/flickr.txt · Last modified: 2010/06/29 11:16 by ::Ben
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki

Espace Membre

Demo Random Product

Demo membership

Demo membership | 4.00 EUR

Demo paypal cart

Votre panier (0 article)

Votre panier est vide!

0.00 EUR

Catégories

GeekLog (29)
Plugins (33)
Thèmes (11)

What's new

COMMENTAIRES


MEDIA GALLERY Last 14 Days

No new media items

No new media comments

NEW FILES last 14 days

En ligne

Visiteurs: 8