W3C Geolocation API (HTML5)

I have fiddled a little bit with the W3C Geolocation API and made the below demo on how to detect the user’s location within a browser. The demo uses HTML5 and the Google Maps API V3, which is designed to load faster, especially on mobile browsers such as Android-based devices and the iPhone.

See demo in fullscreen here: W3C Geolocation API Demo – you can also see this demo on your iPhone.

Feel free to comment, if you have any experience on geolocation

As an alternative it is also posible to use the Google Gears Geolocation API, see code example here: Google Maps Javascript API V3 – Basics

Currently, several ways exist to detect the user’s location within a browser. None of these methods are part of the Google Maps API; instead, they are common industry standards.

  • Newer browsers are starting to support the W3C Geolocation standard. This standard is part of HTML5 and will likely become the de-facto standard going forward. All applications that wish to perform geolocation should support this standard.
  • Some browsers with Google Gears can use Google Gears Geolocation API. Since widespread support for the W3C standard is still forthcoming, checking for Gears is a good fallback mechanism.
  • Some browsers use IP addresses to detect a user’s location, though this provides only a very rough estimate.

Source: code.google.com

Additional Google Maps resources:

Posted in Google, HTML5, iPhone, User Experience, Web Development | 4 Comments

bbPress One Forum Only – Permanent Redirect

Problem:

bbPress supports multiple forums by default, and does not include options to support a only a single forum.

Solution (redirect hack):

Replace the contents of your template’s front-page.php with this code to permanently redirect the forums site to your preferred single forum. “http://www.example.com/forums/forum-slug” must be the direct URL to the single forum you want to show:

< ?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/forums/forum-slug");
exit;
?>

This will permanently redirect users from the frontpage to the specific forum.

Posted in Web Development | Leave a comment