Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#856 2011-07-03 15:25:51

worths1
Member
Registered: 2005-03-08
Posts: 18

Re: glz_custom_fields

King Hack here! I cobbled together a short custom script for retrieving a list of Flickr photosets into a custom field. It works, but I want to make sure I haven’t opened some gaping security hole or otherwise done something dumb or inefficient. If someone knowledgeable gets a chance to scan this, let me know if you see something bad. Thanks!

Here ‘tis.

<?php
function list_Flickr_sets($custom_field, $custom_id, $custom_value) {
	$sets = array();
	$url = 'http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key={your_key}&user_id={your_id}';
	$contents=file_get_contents($url);
	$xml = new SimpleXMLElement($contents);
	$limit = count($xml->photosets->photoset)-1;
	$xml_array = json_decode(json_encode($xml->photosets), true);
	for($i=0;$i<=$limit;$i++) {
		$sets[$xml_array['photoset'][$i]['@attributes']['id']] = $xml_array['photoset'][$i]['title'];
		}
	return glz_selectInput($custom_field, $custom_id, $sets, $custom_value, "0");
}

EDIT: Okay, so this is not working as I intended. While the custom field “gallery” shows Flickr sets by title, <txp:custom_field name=“gallery” /> outputs the id (I think). I’ll edit this post again if I’m able to resolve this on my own and use it in a Flickr badge.

EDIT 2: Holy #%@ crap! You guys that do this for a living, my hats off. I spent all day to get the above. If you see something more efficient, I’d appreciate the advice.

Last edited by worths1 (2011-07-04 18:44:26)

Offline

#857 2011-07-04 22:39:44

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: glz_custom_fields

Weird. in 4.4.1 I’m no longer able to edit the custom script path.

Offline

#858 2011-07-17 10:37:42

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: glz_custom_fields

Hi Gerhard

Could you give us an estimate when you going to release the new plugin version for 4.4.1

At the mo I am building an real estate site with that plugin in 4.4.0


<txp:way_too_cool />

Offline

#859 2011-07-17 11:47:55

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: glz_custom_fields

Hi Gerhard, Plse have a look at this link

Link


<txp:way_too_cool />

Offline

#860 2011-07-20 11:14:23

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: glz_custom_fields

ola

my problem now is, that i can create and edit custom_fields, but when i change it to “textarea” it simply doesnt appear on the write tab, when i change it back to textfield it appears.
using txp 4.4.1

found the issue: i disabled the excerpt field. when i renabled it, the custom_field appeard again..???
guess its been placed behind the excerpt, causing it to not appear, if excerpt is off..

Offline

#861 2011-07-22 09:12:13

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: glz_custom_fields

I am slightly behind on this chaps, I started with a few fixes and then got carried away. I will have to curb my enthusiasm because otherwise it will be a few more weeks before I’ll wrap up the refactoring. So, plan is to have the new PATCH version out this weekend.

Offline

#862 2011-07-22 09:13:49

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: glz_custom_fields

Great thanx, I dont have a problem anymore, it just failing to write to the mysql when installing. Good luck finding motivation :P


<txp:way_too_cool />

Offline

#863 2011-07-22 09:27:25

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: glz_custom_fields

That bug took me exactly 2 minutes to fix. It’s the other stuff (particularly the JS parts) which dragged me into this massive refactoring (almost rewrite in certain respects).

This is the plan for the weekend

Last edited by gerhard (2011-07-22 09:27:38)

Offline

#864 2011-07-28 15:36:44

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 240
Website GitHub Mastodon

Re: glz_custom_fields

Hi Gerhard,
i gave a donation through Paypal this morning, and no download link showed up !
Is there something i am missing ?
Thanks for your advice !

Offline

#865 2011-07-30 08:41:57

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: glz_custom_fields

Aleth, I will be in touch via e-mail.

Everyone else, v1.2.5 is being packaged and prepared for delivery today.

Offline

#866 2011-07-30 19:22:12

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: glz_custom_fields

awesome!

Offline

#867 2011-07-30 19:56:09

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: glz_custom_fields

I came across an issue which I want to get nailed before releasing the new version. Will keep you posted.

Offline

#868 2011-07-30 20:15:56

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: glz_custom_fields

gerhard wrote: “I want to get nailed”

fair enough… to each his own. ;)

Last edited by mrdale (2011-07-30 20:16:09)

Offline

#869 2011-08-01 00:43:03

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: glz_custom_fields

If you’re a contributor but haven’t received the latest v1.2.5 in the next few hours, PM or e-mail.

Offline

#870 2011-08-01 00:44:57

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: glz_custom_fields

mrdale wrote:

fair enough… to each his own. ;)

Shoot, that was for my wife… How did it get in my post? :D

Last edited by gerhard (2011-08-01 00:45:20)

Offline

Board footer

Powered by FluxBB