Mark Snell . com

Archives

Google maps

Google maps rocks. I’ve blogged about it before on the company blog at: The Tech Doctor Blog . This morning I wanted to know how far it was from home to Arizona, USA, so I went to get directions and typed in Lilydale, VIC 3140, Australia and Tempe, Arizona 85281. There 3 modes of transport, Car, public transport and walk. I left it on car. I clicked on Get Directions and was delivered the following map:

\""\""

Note the direction I’ve put the red box around noting a partial toll road… That was rather funny, so I decided to change the mode of transport to “by walking

The first thing I noticed was a warning: “Walking directions are in beta.
Use caution -: This route may be missing sidewalks or pedestrian paths.” Okay, that may be a fair warning, or is it just a bizzare sense of humour… Then I noticed how long the list of directions was.. Here are some highlights of the trip:

\""\""
There is a total of 1331 directions all up. Well done to the google maps team for being so thorough.

  • 0

First WordPress Widget/Plugin

I wrote this Widget (Plugin) for WordPress to be able to properly display the subscription form for The Tech Doctor Newsletter. It builds on the PHPlist Plugin by Jesse Heap which connects to PHPlist. It is based on a sample plugin by Kaf Oseo

&lt::?php

/*

      Plugin Name: PHPlist Widget

      Plugin URI: http://www.geekzone.com.au/

      Description: PHPlist  Widget that makes a widget out of &lt::a href=&quot::http://www.jesseheap.com/projects/wordpress-phplist-plugin.php&quot::&gt::Jesse Heap\’s PHPlist&lt::/a&gt:: plugin

      Author: Mark Snell

      Version: 0.65

      Author URI: http://www.geekzone.com.au/

      based on: http://guff.szub.net/2006/04/06/my-widget-example-wordpress-widget/

      */

function widget_PHPlist_init(){

      function widget_PHPlist($args) {

        extract($args)::

        $options = get_option(\’widget_PHPlist\’)::

        $title = empty($options[\’title\’]) ? \’&lt::b&gt::\’.\’Join our Mailing List:\’.\’&lt::/b&gt::\’ : \’&lt::b&gt::\’.$options[\’title\’].\’&lt::/b&gt::\’::

        echo $before_widget::

        echo $before_title . $title . $after_title::

        $content = apply_filters(\’the_content\’, \’&lt::!–phplist form–&gt::\’)::

        echo $content::

        echo $after_widget::

        }

  

    // This is the function that outputs the form to let users edit

    // the widget\’s title and so on. It\’s an optional feature, but

    // we\’ll use it because we can!

    function widget_PHPlist_control() {

        // Collect our widget\’s options.

        $options = get_option(\’widget_PHPlist\’)::

        // This is for handing the control form submission.

        if ( $_POST[\’PHPlist-submit\’] ) {

            // Clean up control form submission options

            $options[\’title\’] = strip_tags(stripslashes($_POST[\’PHPlist-title\’]))::

            update_option(\’widget_PHPlist\’, $options)::

        }

        // Format options as valid HTML. Hey, why not.

        $title = htmlspecialchars($options[\’title\’], ENT_QUOTES)::

// The HTML below is the control form for editing options.

?&gt::

        &lt::div&gt::

        &lt::label for=&quot::PHPlist-title&quot:: style=&quot::line-height:35px::display:block::&quot::&gt::Widget title: &lt::input type=&quot::text&quot:: id=&quot::PHPlist-title&quot:: name=&quot::PHPlist-title&quot:: value=&quot::&lt::?php echo $title:: ?&gt::&quot:: /&gt::&lt::/label&gt::

        &lt::input type=&quot::hidden&quot:: name=&quot::PHPlist-submit&quot:: id=&quot::PHPlist-submit&quot:: value=&quot::1&quot:: /&gt::

        &lt::/div&gt::

    &lt::?php

    // end of widget_PHPlist_control()

    }

    register_sidebar_widget(\’PHPlist\’, \’widget_PHPlist\’)::   

        // This registers the (optional!) widget control form.

    register_widget_control(\’PHPlist\’, \’widget_PHPlist_control\’)::

     }

    add_action(\’plugins_loaded\’, \’widget_PHPlist_init\’)::

?&gt::

You can download the file here.

  • 0

Keeping it Short

I think the key for me is to try and blog short and often. Just post the various little things I find, and move on. Lets be honest, I\’m so busy at the moment I barely get the time to think through anything in real detail anyway…

  • 0
%d bloggers like this: