Here's a challenge:

I have need to access the customfields values in the author record using php. I am on MT-4.1 with the professional pack.

I have read Arvind's tutorial to access plugindata_data using php (Arvind's example code) and tried to incorporate it for accessing mt-authors->author_meta->customfields.

It appears the serialization is a bit more complex but the basic logic should be the same. The blog_id in question is 7.

Here's my code adapted from Arvind's tutorial:

CODE
include('/home/theconsulting/www/www/cgi-bin/mt/php/mt.php');
$mt = new MT(7, '/home/theconsulting/www/www/cgi-bin/mt/mt-config.cgi');
$db =& $mt->db;
// author_meta where author_id = 'N'
// or where author_name = $username
$data = $db->get_var("select author_meta from mt_author where author_name = 'merv.forney@erols.com'", ARRAY_A);

// Everything stored in plugindata_data is serialized so to be usable,
// we must unserialize it
$data = $db->unserialize($data);
$geoLat = $data['geocode_latitude'];
$geoLong = $data['geocode_longitude'];


There are several custom fields in the author records and I want to get to the GeoCode fields for a Google Map application (both read and write).

It appears the db select is not returning a result. I do not get any php warnings or errors and not sure where to look for MT errors besides the Activity Log (no errors there either). I am absolutely sure the record exists with the author_name supplied in the select statement because it is me.

I'm hoping I have overlooked something simple or perhaps MT-4 has changed significantly since Arvind's example.

It would seem that I may not be the only one developing more advanced applications to read and write serialized data in MT records.

Any help you can provide (or point me in the right direction) would be appreciated.
Merv Forney