Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#949 2011-09-29 16:42:26

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

Re: glz_custom_fields

Here’s an idea that’s beyond my capabilities.

A custom field that uses a custom script to geocode an address (existing custom fields) in the current article and outputs those geocodes to itself in the form of a text field.

The obvious benefit is that an article can have googlemaps geocode it’s location only once, therefore making any map functions faster and more reliable that geocoding on the fly.

I found this resource on using php to geocode and insert the values into a table, but I’m not smart enough to bend it to the following purpose…

  1. Grab the address fields from CFs in the existing article
  2. Concatenate those fields into a single string
  3. Feed that string to the google geocoder
  4. Obtain XML or csv values
  5. Drop the non-pertinent parts
  6. present those values as an editable string if the field is empty.

so… looks straightforward, but it’s way outside of my capabilities. Anyone bored? {he laughs}

Offline

#950 2011-10-05 23:41:21

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: glz_custom_fields

Hi Gerhard,
I think it’d be great to have the actual custom fields’ numbers displayed in the Custom Fields tab for when you need to look up field’s numbers ( sort="custom_n" ). I know it’s visible when I edit a field, but it can need many clicks to get the correct one. E.g. at the moment I needed it to reconstruct bot_wtc rules from an SQL export file. (Yes, cool job.)
Probably needs you seconds to implement, and could be a time saver for many of us. Horizontal space seems to be sufficient.

Then I just realized there’s a stumbling block in v1.3.0:
Up to (and including) v1.2.4 the INSTALL.txt file told to put scripts in a folder called “scripts”. From v1.2.5 on it was named “plugins”. If on an update you continue putting scripts into the scripts folder, knowing you simply have to adapt paths in the plugin prefs, you’ll nonetheless end with a custom_fields tab that’s not working cause both paths to glz_custom_fields.js and glz_custom_fields.css have “plugins” coded in the plugin.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#951 2011-10-24 06:42:26

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: glz_custom_fields

With version 1.3 of the plugin, this is what my custom field overview page looks like:

What can I do about it?

Offline

#952 2011-10-24 08:54:34

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

Re: glz_custom_fields

to me this looks a little like you’ve installed another admin theme, right?
(just to isolate the problem)

Offline

#953 2011-10-24 08:59:33

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: glz_custom_fields

Or is it not seeing the glz_custom_fields.css… I think the folder changed from ‘scripts’ to ‘plugins’ in this upgrade, or just check to see if you uploaded it

Offline

#954 2011-10-24 09:15:43

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: glz_custom_fields

jens31 wrote:

to me this looks a little like you’ve installed another admin theme, right?
(just to isolate the problem)

I used “Remora” the newer one of the two that come pre-packed with TXP. I just changed back to the classic theme but the problem remains.

Offline

#955 2011-10-24 09:23:53

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: glz_custom_fields

OK – solved it. I re-uploaded both the plugin and the support folder and now it works on both admin-themes.

There doesn’t seem to be a file called glz_custom_fields.css – the CSS for the plugin, if I get this correctly, is packacked in the plugin code.

Thanks for your help.

Last edited by andreas (2011-10-24 09:24:36)

Offline

#956 2011-11-01 08:20:00

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 553

Re: glz_custom_fields

For some reason whenever I try to add a new Text Area using glz_custom_fields I keep getting the following error.

Warning: BLOB/TEXT column 'custom_10' can't have a default value ALTER TABLE `textpattern` MODIFY `custom_10` TEXT NOT NULL DEFAULT '' in C:\wamp\www\my-site\textpattern\lib\txplib_db.php on line 89

Offline

#957 2011-11-03 15:19:34

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 553

Re: glz_custom_fields

I’ve noticed that if I ignore the above error message I still get the text area in the Write tab. However I found when adding a lot of text (such as an HTML table) I get the following error message:

Warning: Data too long for column 'custom_10' at row 1 update textpattern set Title = 'Article-Title', Body = 'body-text' C:\wamp\www\mysite\textpattern\lib\txplib_db.php on line 89

Just so you know I’ve changed the Title, Body and site name in the generated error.

— Edit —
Just noticed when I get this error message all of the text I’ve entered into the custom field vanishes. Argh!

If it helps I’m using v1.3.0

Last edited by Algaris (2011-11-03 15:27:22)

Offline

#958 2011-11-03 19:44:16

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: glz_custom_fields

Do you have PHPMyAdmin? You could try changing that field to mediumtext or longtext.

Offline

#959 2011-11-04 08:22:42

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 553

Re: glz_custom_fields

I do but was unsure where to look for it. I tried looking before posting here and found the custom_fields table but all I could see there were entries for custom_2_set.

Offline

#960 2011-11-04 09:05:13

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

Algaris wrote:

I do but was unsure where to look for it. I tried looking before posting here and found the custom_fields table but all I could see there were entries for custom_2_set.

Hi,
you must change the value in the “textpattern” table for column custom_2

Offline

Board footer

Powered by FluxBB