Adventure Locations

I think it was sometime in late 2007 that I first allowed posts to have a country, and thus flag, attributed to them. The Post Country plugin was eventually released to the WordPress community in April 2008. Although the plugin has always allowed a Latitude & Longitude to be entered and saved along with the country, promising that the location would be plotted using Google maps, this location data has never been used. Until now!

The observant may have already noticed that the box for entering location data has some extra hint-text…

location-box

Hints:

  • The crucial hint is Please use decimal values.
  • To help get the Lat & Lng values use the map (initially hidden, click Show Map). Search by name (e.g. Paris), address, place (e.g. Todra Gorge), etc. or simply use the map to zoom to a location and click.
  • Lastly, please try not to create multiple posts with the exact same Lat & Lng values as this would make displaying the locations discretely impossible. This is because locations that are close to each other are grouped to de-clutter the display. Therefore two or more locations that are in exactly the same spot can’t be ungrouped.

The location map is easily accessed using the Venues button venues-button on the index page or the location links world-link found with reports (there’s one below for Show all locations). Links underneath the map allow you to reset the map (if you loose yourself panning and zooming around the world), filter the location markers by category (e.g. Caving), and provide hints and instructions on using the Google mapping.

So, knock yourselves out, provide some location data with your posts if you want to have the venue of your latest adventures plotted on the map!
:geek:

WordPress Changed Files

Upgrading WordPress can be a real pain! Every few months (or sometimes faster!) the WordPress development team release a new version of the software that either fixes bugs, introduces new features, or often both. Great! However, it takes ages to replace all the installation files with those released as the complete download. Even the new automated upgrade built in to WordPress is limited by the capability of your web hosting account; mine doesn’t allow PHP enough memory to complete the task automatically. Therefore, I tend to look for a list of changed files each time and just replace those. Of course clever people, with the right set-up, can get SVN to do that for them. But having the right set-up is tricky and many people (me included) don’t have the required level of control and tooling on their web hosting account. So I use the WordPress Trac site to tell me what has changed and just upload the changed files. Figuring out what files have changed using Trac can be tricky, here’s my workflow…

  • First, find the revision numbers for the two versions of WordPress you want a list of changed files for. Go to Browse Source / Tags and note the “Rev” (revision) number for two tagged versions – your current installation version, and the version you are upgrading to. For example, v2.9 is rev 12455.
  • Then build a URL that includes the two tagged versions and their revision numbers. For example, for changed files from v2.9 to v2.9.1 the URL would be:
    http://core.trac.wordpress.org/changeset?old_path=tags/2.9&old=12455&new_path=tags/2.9.1&new=12600
  • The list of revised files is shown at the top of the page. Plus, for those interested, a list of the changes to those files.
  • Use the list of changed files to select the required update files from a complete WordPress download and upload them to your web host.

Hope this is of some help… 😀

Sterling Adventures WordPress Theme

The theme (look and feel) used for Sterling Adventures has been developed with lots of love and care! Although it probably isn’t perfect (or even working in some places – software is never bug-free), but I am fairly proud of it. 😳 So, first off lets give credit where it’s due…

Apple’s iWeb Modern template was the seed for the overall style. The original blog was built using iWeb (check this page for some background), but that soon failed to meet requirements and was moved in March 2007 to WordPress, delivering a ‘proper’ blog.

However, there was an awful lot of customisation work to get it to look right (and anything at all like the Apple template). Not to mention hours and hours of fiddling to make stuff work across multiple browsers; Safari (Mac), Firefox, and Microsoft’s annoying IE v6.

I think it is now at a point where it’s worth shouting about, and possibly sharing…

Here are some of the features:

  • Styled to fit in with Apple’s Modern iWeb template.
  • Clean layout focussing on content, not the theme itself.
  • Neat javascript to include video uploads on post pages.
  • Widgetised sidebar with docking boxes.
  • Integrated Lightbox enabled slideshows of post images.
  • Integrated images ratings.
  • etc.
Let me know if you are interested in using the theme for your own WordPress blog using the feedback link at the page footer or this comment link. The theme is available for sale – the price is dependent upon how much customisation is required to make it work for your site. For example, the menu structure at the top of the page is included externally from the theme to permit integration with other site content/pages.

Prices are very reasonable – for example, if you already have some HTML suitable to include for the menu and integrated slideshows and picture ratings are not needed, it may be as little as $20.

Sorry it isn’t as simple as just providing a free download link – it wasn’t built with that in mind.

WordPress Blog Goes Live!

Today marks a significant leap forward in Sterling Adventures blogging…

Sterling Adventures is a year old! (A bit like the Queen, we have two birthdays – 28th December and 16th March.) And to mark that anniversary, we have moved hosting service, saved some money (so long as the UK to US exchange rate stays favourable), and found a host that supports MySQL databases (and therefore WordPress) at no extra cost. Thus we now have the platform for a fully fledged blog service. Check it out – register if you want to blog yourself (Your Reports), subscribe to the RSS feed if you want to check out our adventures regularly, or just pop back whenever you can to see what we’ve been up to!

We started with Apple’s iWeb blog (Sterling Adventures v1.0) and now we have a WordPress powered blog (v2.0). Good luck and enjoy! 🙂

Sterling Technology

The Technology that powers Sterling Adventures
Are you a sheep? Do you just follow the crowd and switch on a MS Windows PC? Or, do you have inspiration, power, reliability, creativity, flair and a Mac! 😉

Lets look at some of the technology I’ve used to make this site what it is. There are three areas I’d like to share, the technology that makes it possible, blogging, and the mechanisms behind my live weather feeds…

Web Technologies
Apple have made it easy for those with no technical know-how to create web content using iWeb.

But for those with more of a technical leaning, use of the following technologies allows you to get really flash (well I think so anyway)…

  • Central to the power is that fact that a Mac is a fully qualified UNIX server.

    UNIX

    For example, the power of UNIX shell scripts are unleashed. These are a UNIX system administrator’s nightmare and blessing all in one.

  • (Perhaps) the most important aspect of the technology is the fact that Macs are:

    Powered by Apache

    With Apache, HTML is (of course) easy – it’s a web server first and foremost. But one other thing is nice when creating dynamic content – and that is server side HTML includes; SHTML.

    Getting Apache going is as simple as one click in the Sharing preferences panel of a Mac’s System Preferences.

    SHTML is a good deal trickier to enable and involves editing the Apache configuration files (use Google for help).

  • Apache also opens the door (easily, as compared to other “lesser” operating systems) to the next big tool:

    PHP

    PHP is a mega powerful way to get stuck into server side scripting.

    It can be a bit strange to get started coding in PHP, but for anyone with C (or other C variants like C++ or Java) programming skills, it’ll come quickly.

    Setting up PHP is a bit involved, but this link sorted me (and loads of others) out.

The other technology used in the pages of Sterling-Adventures is Java Script. A common web technology, but still really powerful for client side scripting.

Especially when the latest AJAX techniques are used to dynamically change content, as used on the Home page news ticker.

See all of the results starting here.

Blogging Technologies
Apple’s iWeb application makes the creation of content super easy. Pages like this, photos, movies, podcasts, blogs, etc. are simple.

However, there are some aspects of iWeb that are a bit tough to get around:

  • Including any of your own HTML. Like a link to the Amazon affiliates programme.

    Although Apple have now made this possible in limited ways.

  • Any other generated content, for example the output from a weather station as described right.
  • Fully featured web logs (blogs). Of course, Apple have now added comments and searching to iWeb, but you also need a .Mac account to use them. Not as cool as your own domain name (and considerably more expensive).

iWeb

Sterling Adventures has chosen to implement WordPress (“a state-of-the-art semantic personal publishing platform”).

Using this technology has brought fast, easily searched, customisable blogging to Sterling Adevntures, and allowed contributors to have far more control of their adventures reports.

WordPress is a feature rich solution that leverages two key technologies – PHP (described left) and MySQL. MySQL is a powerful (and fast) open source relational database used by WordPress to store all the blog data.

These amazing software products (WordPress, PHP, and MySQL) are free to use! How cool is that?

WordPress takes about 5 minutes to install (“the famous 5 minute install”) and offers a completely flexible environment on which to build a blog.

The look of the blog is all controlled by templates (Sterling Adventures has its own template to get as close as possible to the style used across the whole site).

Add to this an array of freely available plug-ins (Askimet spam filtering, Gravatars, database backup, etc.) to enhance and extend the capabilities and the “state-of-the-art” claim made by WordPress starts to make sense.

Check out the results here…

The custom plug-ins etc. are available for download here…

Weather
The Davis Instruments Vantage Pro 2 weather station is the hub of the Sterling weather solution. It’s an awesome weather station, and following Davis’ installation instructions is easy – even setting up the rain gauge for millimetres is straight forward. Why do those silly Yanks still use inches anyway?

The Davis WeatherLink software does a great job, but it is deficient in that it doesn’t expose the forecast information. For many it’ll do fine as-is, but I wanted more – flash icons, up-to-date forecast information, etc. So I searched for a solution to the Davis functionality gap. I found Joe Jaworski’s VPROWEATHER software. The only problem with this is, it’s written for Linux on a PC and the handling of 32 bit data when compiled on a Mac doesn’t work. Some debugging of the C code followed by moving bytes of data 8 bits left using Apple’s X Tools sorted that.

Next, how to automatically update the weather and publish it to the web:

  1. Create a template with WeatherLink and VPROWEATHER tags. There are lots of examples with the Davis software. My template has loads of PHP in it too. This does stuff like display a moon at night and a sun during the day if it’s clear or sunny respectively. So the final output from step 2 is a file with a PHP extension.
  2. Schedule the WeatherLink software to pre-process the template, replace the WeatherLink tags, generate any images required and then place the results in a local directory. Don’t use this software to upload using FTP.
  3. Create a shell script to look if the processed WeatherLink file is in the local directory. If it is:

    • Run VPROWEATHER to fetch data from the Vantage Pro. Then run the tag replacement software. This time the only tags we are replacing are the forecast information, as all the other weather data (e.g. temperature) has been inserted by WeatherLink.
    • Copy the final version of the processed file (and any image files) to the mirror site. This is optional, but it’s probably best to have a copy should the hosted data get trashed…
    • Using FTP (or rsync), copy the same files to the appropriate place on the web hosting service.
  4. Schedule the shell script (using cron) to run regularly.

Finally, thanks to Stardock Icons for the icons that make the weather page a far improved visual experience.

Check out the results here.


Want to know more, or get your hands on some of the code?
e-Mail me (link below, remembering to remove your PANTS) and I’ll do my best to help out…