testing geotagging

July 8, 2009 · 8 comments

in general

ignore this post. I’m playing with a plugin, to see if I can add geotagging of posts and pages. It appears to work perfectly under standalone WP, but seems to fall over under WPMU (or, perhaps, under Multi-DB?)

[gmap zoom='18']

{ 8 comments… read them below or add one }

1 Cole July 12, 2009 at 6:22 am

So which plugin are you testing?

Reply

2 dnorman July 13, 2009 at 12:44 pm

I’m checking out the GeoTag plugin – looks pretty much ideal for putting posts and pages on a map, and then displaying a map for all content (or just all content in a given category, etc…)

Reply

3 Monkeyclaus July 14, 2009 at 11:15 am

Did you ever get this to work on WPMU? I am still having a similar problem. The first thing I did was follow this instruction..

http://mu.wordpress.org/forums/topic/12474#post-76396

Hi,
as reported by holyolli, running the Geotag plugin with Wordpress MU will produce some trouble. I tried to find out what went wrong and noticed, that only the procedure which saves the options is affected. Although I stick to the Wordpress Codex for creating options pages, you will always receive a failure notice if you try to save the options. To be honest, right now I don’t now how I can improve the plugin to avoid this error, but I compared the Worpdress MU with the standard version and found the difference which causes the trouble.
Take a look at the /wp-admin/options.php file and search for the following code:

case ‘update’:
if ( isset($_POST[ 'option_page' ]) ) {
$option_page = $_POST[ 'option_page' ];
check_admin_referer( $option_page . ‘-options’ );
}

If you change this to

case ‘update’:
if ( isset($_POST[ 'option_page' ]) ) {
$option_page = $_POST[ 'option_page' ];
check_admin_referer( $option_page . ‘-options’ );
} else {
// This is for back compat and will eventually be removed.
$option_page = ‘options’;
check_admin_referer( ‘update-options’ );
}

But this did not let me save any of the plugin information like the Google Map API.

Did you find anyluck getting this to work.. I would be very curious to know and compare details.

cheers!

Reply

4 dnorman July 14, 2009 at 11:23 am

I haven’t had a chance to figure out how to properly fix the plugin for WPMU. What I did as a quick and dirty hackfix was to get it running here on my standalone WP blog, copy the value from the settings table, and manually add that entry to the appropriate table for the WPMU blog that uses it – changing the API key to match what is generated for the URL of that blog.

The plugin itself works great under WPMU, but the settings page borks because of the security model of WPMU.

Reply

5 Monkeyclaus July 14, 2009 at 11:31 am

That sounds like a reasonable plan.. Is this done in the WP_options table in MySQL or in the edit table that WPMU blogs offer to ADMIN. Thanks for the lightening fast response… Great to know your blog is so active!

best regards, from the Blue Ridge Mountains of Virginia.

Reply

6 Monkeyclaus July 14, 2009 at 12:23 pm

So I looked in the DB and I found the WP_options table for the blog I want it to work with…

Here are the contents..

a:13:{s:12:”gmap_api_key”;s:0:”";s:17:”gmap_display_page”;a:2:{s:6:”SINGLE”;s:4:”true”;s:4:”PAGE”;s:4:”true”;}s:8:”auto_map”;a:2:{s:4:”SHOW”;N;s:8:”POSITION”;s:6:”BOTTOM”;}s:9:”gmap_type”;s:12:”G_HYBRID_MAP”;s:21:”gmap_controls_zoompan”;s:18:”GLargeMapControl3D”;s:21:”gmap_controls_maptype”;a:4:{s:12:”G_NORMAL_MAP”;s:4:”true”;s:15:”G_SATELLITE_MAP”;s:4:”true”;s:12:”G_HYBRID_MAP”;s:4:”true”;s:14:”G_PHYSICAL_MAP”;s:4:”true”;}s:19:”gmap_controls_other”;N;s:9:”gmap_zoom”;s:1:”5″;s:10:”gmap_width”;s:4:”100%”;s:11:”gmap_height”;s:5:”300px”;s:15:”geotaged_photos”;a:2:{s:20:”READ_GEOTAGED_PHOTOS”;N;s:4:”ICON”;s:6:”CAMERA”;}s:4:”misc”;a:3:{s:12:”GEOTAG_FEEDS”;s:4:”true”;s:11:”GEOTAG_HTML”;s:4:”true”;s:10:”QUICKGUIDE”;s:4:”true”;}s:23:”misc_wpgeocompatibility”;a:2:{s:2:”DB”;s:4:”READ”;s:9:”SHORTCODE”;s:4:”true”;}}

Do I just add the MAP Key to the first line like this….

a:13:{s:12:”gmap_api_key”;s:0:”ABQIAAAAM7U79ushb5ilQ4E6fvQRR4NPCD-AFOrwEtVCOtQrn9bEu09hT69vt8bhv5f2ZMD9RA9cQwYwo2mA”;

When I did this, it broke the post editor.

I looked at a WP that I have using this plugin and the first line looks like this….

a:13:{s:12:”gmap_api_key”;s:86:”ABQIAAAAM7UI1gtNnqb5ilQ4E6fvQRRpaozJldtI2le5zzbbGPXuiKV-3RQQuRYma7R0Hmssv_oKgws1F8BG2Q”;s:17:”gmap_display_page”; …….

Am I missing something that you understand and did.. Hope this helps anyone trying to get this to work. It is a very useful plugin and WPMU users would love to have GEO-Tag suitable for WPMU.

Reply

7 dnorman July 14, 2009 at 12:30 pm

I went into the wp_options in my standalone blog database, copied the value for “geotag_options” – then created a new entry in the WPMU database’s wp_options table, and pasted that content in as the value.

I had to replace the 86 character string for “gmap_api_key” and it Just Worked™

You won’t be able to set the options using the web UI, so be sure you’ve set them however you want the plugin to behave on the standalone blog before copying the options to the WPMU blog.

Reply

8 Monkeyclaus July 14, 2009 at 1:49 pm

Brilliant.. That worked.. Thank You very much for taking the time to contribute your help. My you experience Good Karma !

Reply

Leave a Comment

Previous post:

Next post: