Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#625 2007-12-18 08:45:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

Re: [plugin] [ORPHAN] vdh_flickr

jstubbs wrote:

Is it possible to use Slimbox with the thumbnails?

I’ve not looked at the plugin, but it should be possible. Find a plugin option (or edit the plugin) so that it adds the following to the anchor in each <a href="http://flickr.com/blah.jpg"><img thumbnail></a> tag:

rel="lightbox-sometext"

Then Slimbox/lightbox will automatically pick them up and run. “sometext” can be anything you like; all images assigned the same value allow slimbox to navigate among those as a group.

Incidentally, if you add class="thickbox" to the anchors instead, you can use Thickbox. That’s what the next version (currently alpha code) of my slimbox plugin does. jQuery-tastic :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#626 2007-12-22 16:29:38

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] vdh_flickr

For those wondering about Lightbox or Slimbox integration, it is in fact very easy, no editing of the plugin is required.

Assuming you already have Slimbox in place in your head tag, then use a vdh_flickr tag like so:

<txp:vdh_flickr_thumbnails nsid="your_flickr_id_here" set="your_set_number"  open="lightbox" />

And Slimbox picks up the rel="lightbox" tag, which is already in the plugin, but not in the help docs.

Offline

#627 2007-12-22 22:12:50

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] vdh_flickr

Two questions:

First one is about using best practice with custom fields. I have 8 sections, and need to set 8 separate Set numbers in the vdh_ tag. I can do this fine with a bunch of if_section tags, but looking for a cleaner way to assign the Flickr Set #.

I have this code in a page, BTW.

<txp:if_section name="section1">
<txp:vdh_flickr_thumbnails nsid="my_nsid" open="lightbox" latest="20" />
</txp:if_section>
<txp:if_section name="section2">
<txp:vdh_flickr_thumbnails nsid="my_nsid" open="lightbox" set="my_set" latest="20" />
</txp:if_section>

Second question is related to the variable “latest”. In the second tag, I would like to pull out no more than 20 thumbnails from the set, but I end up with the thumbnails repeating.

Offline

#628 2007-12-31 22:22:18

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: [plugin] [ORPHAN] vdh_flickr

has anyone been able to get this working on 4.0.5? I verified I have simplexml on my php5 install, but keep getting the “Failed to connect..” message.

Offline

#629 2008-01-01 00:07:21

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: [plugin] [ORPHAN] vdh_flickr

nevermind I found the issue. I’m on php5 and this plugin is attempting to load the xml file via a url. My server has that disabled, so I had to create a cache copy to sit on my server. If the original author or anyone would like the code, just let me know.

Offline

#630 2008-01-01 09:04:42

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] vdh_flickr

Amit, the “failed to connect” issue is caused by the lack of allow_url_fopen in php.ini. In my case, the option is turned off by default by the web host, but I turned it on and vdh_flickr now connects fine.

General question: Anyone seen a way to limit the number of thumbnails to 20? Using the txp:vdh_flickr_thumbnails tag, but using a straight limit=“20” in that tag does not work, and I don’t see anything in the docs.

Offline

#631 2008-01-03 16:20:29

ralph
Member
Registered: 2005-02-28
Posts: 106

Re: [plugin] [ORPHAN] vdh_flickr

@variaas: Please feel free to send me any code patches concerning vdh_flickr.

@jstubbs: I think you could use thumbs_per_page=“20” and a form that does not show any pagination navigation.

@everyone: I finally added the lightbox option to the documentation.

Sorry, very little time at the moment!

Offline

#632 2008-01-03 16:43:19

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] vdh_flickr

Thanks Ralph your suggestion does not work, but thanks for trying!

Offline

#633 2008-01-03 16:45:48

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: [plugin] [ORPHAN] vdh_flickr

I just added a check for the curl function if you have php5. Sorry I don’t have line numbers, but here’s the edit I did:

original:

else {
     if(!$this->xml = @simplexml_load_file($this->xmlurl)) {
	unset($this->xml);
    }
}

updated:

else {
			if (function_exists('curl_init')) {
				$ch = @curl_init();
				curl_setopt($ch, CURLOPT_URL, $this->xmlurl);
				curl_setopt($ch, CURLOPT_HEADER, 0);
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
				$resp = curl_exec($ch);
				curl_close($ch);

if(!$this->xml = @simplexml_load_string($resp)) { unset($this->xml); } }

else if(!$this->xml = @simplexml_load_file($this->xmlurl)) { unset($this->xml); } }

You do a check for the cURL function if you have php4, but not php5. This edit will just allow people who can’t load external urls with simplexml_load_file() to use this great plugin.

Offline

#634 2008-01-07 21:46:31

markworsnop
New Member
Registered: 2008-01-07
Posts: 3

Re: [plugin] [ORPHAN] vdh_flickr

Hi, just wondering if you can help. I’d like to be able display all the photos in my Flickr account as a gallery on my website, in chronological order, in batches of twenty per page. Then I’d like to be able to email new images from my phone, to update my flickr account and then my website.

I’m currently using txp:vdh_flickr_thumbnails to display my gallery.

Here is my problem:

If I put all my photos in a set and use set=“x”, I’m not aware of a way to assign a photo to a set when sending a photo to flickr from my phone, therefore new photos would not be added to the website

If I tag all the photos with the same tag and use tag=“x”, the photos are not displayed chronologically on my website.

If I use latest=“x”, then I have to specify a higher number than there are photos (to allow for new photos being uploaded) and I end up with blank pages in my gallery.

Hope that makes sense, can anyone help?

Is there either a way to make photos displayed by tag chronological or a way to assign the current total photos in my flickr account to the latest=“x” parameter?

If you display as a set=“x”, it automatically gets rid of addional pages can this be applied to the latest=“x” parameter?

Thanks M.

Offline

#635 2008-01-07 22:00:15

ralph
Member
Registered: 2005-02-28
Posts: 106

Re: [plugin] [ORPHAN] vdh_flickr

The latest thing is a bug I should fix asap.

Offline

#636 2008-01-07 22:43:41

markworsnop
New Member
Registered: 2008-01-07
Posts: 3

Re: [plugin] [ORPHAN] vdh_flickr

Hi Ralph, thanks for the quick reply. Well if it could be fixed, that would certainly solve my problem. Thanks M.

Offline

Board footer

Powered by FluxBB