Gordonmac dot com ~ Download free CSS templates and graphics

Skip navigation links

Welcome to Gordonmac dot com ゴードンマック・ドットコムようこそ

The free HTML/CSS templates & stuff

This is the blog of Gordon Mackay, a web developer from the N.E Highlands of Scotland. On this site you will find free HTML and CSS templates, free Adobe Fireworks graphics and some PHP code to use in your projects. Enjoy!

  1. New CDs!

    — by GordonThursday 5th January 2012 • Category: { 0 }

    Just bought some CDs from Amazon (surprisingly cheap!!). It's been ages since I've bought music from anywhere other than iTunes.

    I got: The Fragile by NIN, The Blackening by Machine Head, TEN (+ 3 Bonus Tracks version) by Pearl Jam, Psalm 69 by Ministry and also Pretty Hate Machine by NIN.

    They averaged out about maybe £5 - £6 each - seems I have a budget taste in music :)

  2. Caithnesian - My new website

    — by GordonWednesday 21st December 2011 • Category: { 1 }

    I recently completed a new website for myself. How exciting!

    Over the past three years Wordpress has almost become my sole occupation, creating client websites using its feature-rich API and templating system. Creating websites with it has become a pleasure, and with a reasonablly smooth learning curve, most people would be able to cobble together a fully functional website in no time at all.

    In the past I have built my own little applications for publishing content, much like this site - but having seen the light I've made myself a site. It's for me and Kirsty to publish photos of our walks and outdoor excursions, mostly focussing on our county of Caithness.

    If you're interested, have a look at Caithnesian.co.uk

  3. Validating e-mail addresses in PHP

    — by GordonThursday 17th November 2011 • Category:

    This is easily the best function I've used for validating e-mail addresses in my PHP scripts and applications.

    function is_valid_email($email)
    {
    	$qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
    	$dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';
    	$atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+';
    	$quoted_pair = '\\x5c[\\x00-\\x7f]';
    	$domain_literal = "\\x5b($dtext|$quoted_pair)*\\x5d";
    	$quoted_string = "\\x22($qtext|$quoted_pair)*\\x22";
    	$domain_ref = $atom;
    	$sub_domain = "($domain_ref|$domain_literal)";
    	$word = "($atom|$quoted_string)";
    	$domain = "$sub_domain(\\x2e$sub_domain)*";
    	$local_part = "$word(\\x2e$word)*";
    	$addr_spec = "$local_part\\x40$domain";
    	return preg_match("!^$addr_spec$!", $email) ? true : false;
    }
    

    Use it as follows:

    if((isset($_POST['email']) && !empty($_POST['email']))
    {
        if(is_valid_email($_POST['email']))
        {
    	    $email = $_POST['email'];
        } else {
        	$errors['email'] = 'Please provide a valid e-mail address.';
        }
    } else {
        $errors['email'] = 'Please provide your e-mail address.';
    }
    
  4. Displaying recent posts in the Wordpress sidebar

    — by GordonMonday 14th November 2011 • Category:

    To add recent posts navigation to your Wordpress blog, simple add the following code to sidebar.php.

    <h2>Recent Posts</h2>
    <nav id="navigation-recent">
    <ul>
    <?php
    $recent_posts = wp_get_recent_posts(5);
    foreach( $recent_posts as $recent ){
    	$date = date("M d, Y",strtotime($recent["post_date"]));
    	echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.$recent["post_title"].'" >' .   $recent["post_title"].'</a> '.$date.'</li>'; 
    }
    ?>
    </ul>
    </nav>

    This will display the 5 most recent posts. To change the number of recent posts just edit the following:

    $recent_posts = wp_get_recent_posts(10);

    This will now display the 10 most recent posts.

  5. Pacific Outdoor Equipment Peak ELITE AC - Conclusion

    — by GordonWednesday 9th November 2011 • Category:

    Finally, the big pass the buck.

    Hi Gordon

    If that is the case have you tried calling the Cotswold store to see if they can arrange something via post or a refund over the phone?

    We now have no stock of the Peak Elite AC until our next delivery in 2012.

    Let me know if you can't find a solution through Cotswold.

    Kind regards
    Chris

    Hardly seems fair, seeing as I've already had one Pacific Outdoor Equipment Peak ELITE AC replaced by Cotswold outdoors.

    Can safely conclude that I will never purchase anything else from this company ever again.

Want to read more?

If you would like to read more of my diaries please visit the archive page.

Search diaries *

Categories

Subscribe

Use the link below to subscribe to the feed you want:

Bookmark

Recent Music

  • No recent tracks…

5 MPs and 8 million songs to play every month

Interesting Links

About the author

Gordon Mackay Gordon Mackay (Gordonmac dot com) is a web developer from the Highlands of Scotland.

Download my vcard or .

You can also see the about me page.

Et Cetera

This site uses Microformats.
(hCard, hAtom & rel-tags)

xHTML Strict & valid CSS

T-o-p