wp-SwimTeam v0.1.417 – Meet Report Shortcode

I posted wp-SwimTeam v0.1.417 this afternoon to the download page.  This update adds new functionality and fixes a few minor things which have bothered me as I found them during the season.

The big new feature is a new shortcode – wpst_meet_report.  This shortcode allows a the contents of a meet report to appear in a post or a page like this example on the wp-SwimTeam demo site.

The reports also now support hiding first and last names by only showing the initial as well as the ability to override the first name with a nickname if the swimmer’s profile has one.  The missing ability to display a map on the swim meet report has been added so the checkbox on the form is now enabled.  The reports can now display opt-in and opt-out information chronologically in the order they were added to the system as well as the previously available by name and by swimmer label.

Demo Site is running … sort of

The nice folks at WinSwim are interested in what I am doing with this plugin and have offered to host a demo site.  You can find it at:  http://wp.winswim.com  The demo site is running for the most part, if you are interested in trying it out, go ahead and register with the demo site then drop me an e-mail so I can change your permissions so you can actually do something other than register sample swimmers.

I say the demo site is running “sort of” because just about everything is working although there are a few bugs I know of (e.g. defining age groups).  The one thing which isn’t working and it is driving me nuts is the ability to display a Google Map.  This is a really nice feature that my own team used quite a bit this year.

I have encapsulated a class called Phoogle within wp-SwimTeam and it worked just fine in my development area and on the MacDolphins site.  Phoogle relies on a PHP configuration option known as allow_url_fopen which basically allows PHP to open a web page on an external site and read the content like it would a local file.  It’s a nice feature but one that a lot of web hosting providers turn off.  In fact, the host for the demo site has it turned off.

There is another technology called cURL which for all practical purposes, accomplishes what allow_url_fopen does although it is a little more involved.  I enhanced Phoogle to use cURL if allow_url_fopen is disabled and it worked just fine in my development area.  Great!  The change was pretty simple too.  Uploaded to the production server and nothing.  It doesn’t work there.  It turns out that GoDaddy (the web hosting provider) has a goofy cURL implementation which requires the use of a proxy.

After a much trial and error and a couple e-mails with GoDaddy support, all I have accomplished is a partial cURL request.  I am unable to get a complete response which prevents the map from being displayed.  I then got another e-mail from GoDaddy telling me that cURL is only supported on their Linux hosting environments not under Windows (even though it is enabled in PHP.ini).  Bleh.  ;-(

I think for now when I find a short code, I will check the allow_url_fopen setting and if it is off, will issue a warning during the short code processing.  There is probably a way to interact with the Google Maps API via Javascript, I guess I will need to look into that.  It is really too bad, the Phoogle solution was really simple to use.

Google Maps short code implemented

I have been using the Inline Google Maps plugin on the MacDolphins site but lately it has been flaky to say the least.  Sometimes the Google Map is displayed and sometimes it isn’t.  There isn’t any real rhyme or reason as to when it displays and when it doesn’t that I could find AND the plugin is actually hard to use, particularly for the casual author.

So I implemented a new short code for Google Maps called wpst_google_map which will take an address as an argument and display a Google Map.  The plugin uses this as part of the Club Profile to map a swim club for directions and such.  The short code is based on a Google Maps class called Phoogle Maps which has been extended to work with the plugin.  Phoogle Maps works pretty much as advertised.  I wish it didn’t echo it’s output directly to the output buffer but fortunately PHP can control the output buffer so it can be captured and used in the context of the plugin.

[wpst_google_map address="1600 Pennsylvania Ave, Washington DC, 20006" align="center"]

The short code syntax above will display a map similar to this: