chrisspeck.com

Chris' random ramblings

WordPress more tag patch for Facebook Photo Fetcher

I have been experimenting with using the brilliant Facebook Photo Fetcher plug-in (by Justin Klein) to present the photos I have on Face Book however it didn’t work quite the way I wanted.

The specific problem is that there was no way to split a gallery with a <!--more--> tag.

(Having two references to Facebook Photo Fetcher, with a more tag in between does not work either).

So I have edited the source of the plunging to introduce the functionality I need and I have added support for a more=n stanza to the plungin.

The edits (to version 1.2.8 of _output_gallery.php) are as follows:

1. At line 108 insert:

//1.2.8-cs
if( preg_match('/more=(\d+)/', $retVal['startTag'], $matches) )      $retVal['more']      =$matches[1];

2. At line 293 insert:

//1.2.8-cs
//Insert a more tag?
if( $params['more'] > 0 && $i == $params['more'] ) $retVal['content'] .= "<!--more-->\n\n";


An example usage is this:

<!--FBGallery [ID#] more=8 --><!--/FBGallery-->

This will insert a <!--more--> tag after your eighth image. I suggest you set this number to be a multiple of your column count (with default settings, 4 or 8 are good numbers).

If you want you can download a pre-hacked version of _output_gallery.php in a zip file (note this will only work for version 1.2.8 of Justin Klein's plug-in).

Full credit for creating the plugin goes to Justin Klein, I am very grateful to him for sharing it and you may visit his site here, and the plug-in's info and FAQ is here.

posted by specky in Downloads and have Comment (1)

One Response to “WordPress more tag patch for Facebook Photo Fetcher”

  1. Bram says:

    Thanks a LOAD! Really appreciate this. Thanks a lot! The plugin itself is great, but I needed support for the more tag. And then you came. Thanks!

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment
*