Sep
30
2009
Three Peaks
On Friday 9th October 2009, I will be attempting the Three Peaks Challenge with three friends. The aim is to climb the highest peaks in Scotland, England and Wales (Ben Nevis, Scafell Pike & Snowdon) over a three day period. We’ll be climbing Ben Nevis on the Friday, Scafell on the Saturday and Snowdon on the Sunday. I have decided to do this to raise money for a charity called The Friends of Michael Sobell House.
Michael Sobell House is the hospice and specialist palliative care centre based at Mount Vernon Hospital, enhancing without discrimination, the care of patients with life limiting illnesses and providing support for their families and carers. Funding from charitable donations must reach an annual target of £1,200,000 to maintain patient care at its current level from the In-patient unit, Day Therapies Centre, Outreach Team and Education Program. Many services at Michael Sobell House would not exist without Fundraising and Voluntary contributions from individuals, community groups, companies, charitable trusts and legacies. It is thanks to a dedicated team of staff, generous and skilled volunteers and with the boundless energy and enthusiasm of all its supporters that Michael Sobell House can keep ‘Sharing the Caring’.
Please visit my JustGiving page: http://www.justgiving.com/andrewgoodricke/ if you’d like to sponsor me. Donating through JustGiving is simple, fast and totally secure. Your details are safe with JustGiving – they’ll never sell them on or send unwanted emails. Once you donate, they’ll send your money directly to the charity and make sure Gift Aid is reclaimed on every eligible donation by a UK taxpayer. So it’s the most efficient way to donate - I raise more, whilst saving time and cutting costs for the charity.
So please dig deep and donate now.
Here’s a few facts and figures about the Three Peaks:
Ben Nevis
1344m high
Expected time to reach summit and return - 7 hours
Scafell Pike
978m high
Expected time to reach summit and return - 5.5 hours
Snowdon
1085m high
Expected time to reach summit and return - 4.5 hours
You can also track our progress at: http://purplefundraising.co.uk/
Dec
07
2008
Here’s one for you Sukie…
The php function date_add ( DateTime $object , DateInterval $interval ) is an experimental function and shouldn’t really be used in a production site. The way to get around this is to use strtotime ( string $time [, int $now ] ).
If you’re trying to add a week to today’s date you can simply do the following:
$new_date = strtotime("+1 week");
but if need to add a week to a time stamp of your own you can do:
$my_date = strtotime('05-Dec-2008');
$new_date = strtotime("+1 week", $my_date);
Note: The second parameter needs to be a valid date, when I’m getting data from a database I will usually get the date in to a dd-mmm-yyyy format as this explicitly defines the date. If it were written ‘05-12-2008′ it potentially could be interpreted as ‘12-May-2008′ which could then cause other issues to your data further down the line.
You could condense the code to be one line:
$new_date = strtotime("+1 week", strtotime('05-Dec-2008'));
For outputting the $new_date I’d use php’s date ( string $format [, int $timestamp ] ) function:
$new_date = strtotime("+1 week", strtotime('05-Dec-2008'));
echo date('d M Y', $new_date)
Have a look at php’s strtodate function and php’s date function for information on how to use.
Sep
09
2008
Over the weekend I took some friends to Wembury as they were down visiting, I’d not been before but I’d heard it was a nice spot so gave me a great oportunity to head over there to have a look around. Here’s a selection of the pictures I took using a Canon 400D, Sigma 17-70mm and a Gorrila-pod (a great piece of kit) where required.
Aug
21
2008
I’ve been working with Ajax recently, I’ve been particularly impressed with how potentially powerful Ajax is. Having a good knowledge of PHP and HTML myself has helped when it came to learning this amalgamation of technologies. If you’re not aware what Ajax is, It stands for Asynchronous JavaScript And XML (eXtensible Markup Language).
A good introduction to it can be found on Harry Maugans in tutorial AJAX Made Easy, in addition to that the SAMS Teach Yourself in 10 Minutes have got a great little book on Ajax which explains it all really well from beginner to intermediate.
Back to the point in hand, I wanted an animated gif to display while I was collecting data from the server. That is precisely what I got when I came upon the Ajax Loading gif Generator. You can customise the gifs produced from the type of animation to the fore and background colours - A great little tool!

Jul
23
2008
I’ve used mod_rewrite quite a lot with Code Igniter and I’ve experienced issues getting it working to remove the index.php from the url on different servers before but this was another issue again. Here’s my resolution and some of my previous resolutions:
Here’s the contents of the .htaccess for Heart Internet to remove index.php:
RewriteEngine On
RewriteCond $1 !^(index\.php|css|img|js|robots\.txt) [NC]
RewriteRule ^(.+)$ index.php?/$1 [L]
SetEnv DEFAULT_PHP_VERSION 5
The SetEnv DEFAULT_PHP_VERSION 5 tells Heart to use PHP 5.
If you have any directories or specific files (like robots.txt) you need to access for css, JavaScript etc, they will need to be put them in the RewriteCond separated by a pipe (|).
In addition, I prefer working with short open tags for writing PHP. You need a file called php5.ini containing:
short_open_tag = On
For my XAMPP development I use the following code in my .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|css|img|js) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
For other servers I’ve needed the following:
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|css|img|js|robots\.txt) [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
The subtle differences (that make a huge difference between it working and not working) that may have not been noticed are all located around /index.php?/$1.
I hope this of some use.