TheMeyers.org Geek

August 20, 2009

Phanfare Badge

Filed under: Phanfare,WordPress — Tags: , , , — admin @ 10:32 am

Sorry, I haven’t yet released the Phanfare-Widget…. I want to rework the code to use a single compound context variable, rather than many single value context variables.  I have started the transition, but I still need to debug and test the new version.  I realized that using the RSS feed interface, is limited compared to what can be accomplished using the Phanfare API interface.

I have been learning the Phanfare API by implementing a clone of Flickr’s Badge javascript code badge_code_v2.gne. This is a PHP module which you install on a server, which mimics the behavior of the Flickr badge function.  In fact you can use the Flickr Badge generator and then replace the Flickr badge call “http://www.flickr.com/badge_code_v2.gne?count=10&display=latest&size=t&layout=x&source=user&user=18867172%40N00" in the generated code, with a call to your Phanfare version, and it will just work!

There are some differences:

  1. For security the username and password for login into Phanfare is stored inside the PHP code.  Rather than being passed in the URL.
  2. You can specify the album_id or year which the random images are pulled from.
  3. I haven’t implemented the display, source,user arguments as it is always choosing from the specified Phanfare user

Example here

I have implemented a PhanfareAPI PHP class to encapsulate all the interaction with their site.  At first I was using SimpleXMLElement but didn’t like the organization of the returned  XML structure.  I wrote XMLParser which uses the PHP internal xml_parser_create, with startElement, endElement callbacks.  This returns a pure PHP nested array structure, which is much easier to handle when iterating over repeating structures with foreach.  The performance is slightly faster than SimpleXMLElement, and there is little (if any) special case code needed when walking the returned XML structures.

I am working on a Caching class to improve the performance using a sqlite DB.  The performance is excellent, but the programmer interface is not yet smooth.  The assumption is that the photo site meta information doesn’t change that often, and so can be cached for a longer period of time.

Example: The same badge test, using Caching here

July 14, 2009

Phanfare-Widget

Filed under: Phanfare,WordPress — Tags: , — admin @ 9:53 pm

I am very close to releasing the new Phanfare Widget for WordPress.  My request for subversion space has been submitted to WordPress. This is based on the Photo Sidebar widget, with various improvements.

  • Uses SimplePie for parsing, rather than Magpie (allows for faster, easier parsing, with caching of feeds)
  • Improved the random selection algorithm to speed up display. Should be faster with larger RSS feeds
  • The feeds are verified during the widget configuration.
  • Clicking on thumbnail will: (do nothing, show larger image, bring up a lightbox slideshow)
  • The size of the thumbnail image can be specified
  • When multiple resolutions are available in the feed, the closest size is used to avoid excessive browser scaling.
  • Currently works with Phanfare, PicasaWeb, SmugMug, and Flickr

July 4, 2009

Trying out a new Phanfare RSS plugin

Filed under: Phanfare,WordPress — Tags: , — admin @ 1:39 pm

I used the code from WP-SmugMug.

and modified it to use the RSS feeds from Phanfare
(both public and private feeds work!)

Here are the first 4 images from a public feed of mine:

If people are interested I will continue to port the remaining bits over into a true wp-Phanfare wordpress plugin.

Testing using Phanfare Slide show

Powered by WordPress

Bad Behavior has blocked 3 access attempts in the last 7 days.