Social Media Icons from ElegantThemes

Recently I’ve completed several websites that have required different types of social networking icons for various locations in the site design. I’ve used this excellent set of icons from ElegantThemes for two main reasons; their top-notch quality and that they’re supplied with the original PSDs allowing you to resize them, recolour or rearrange them. Download and preview after the break!

Click here to read more…

Codeigniter 2.0: Extending the Controller class

Extending Codeigniter core classes is often useful for adding functionality or changing an existing function without altering the frameworks core code. We’ve already done this once with the router class for search engine friendly URLs and this time we’ll be doing it with the CI_Controller class so that we can set the referring controller every request although you could do anything here. E.g setting a userdata variable.

The first step is to create a file called MY_Controller.php in the application/core/ folder. Remember that capitalization is important. The file should contain the following code: 

<?php
class MY_Controller extends CI_Controller {

	function __construct ()
	{
		parent::__construct();
		$this->session->set_flashdata('referrer', uri_string());
	}

}

The above code stores the method and class plus any other segments in a flashdata variable called referrer.

In order to use any code you put in your MY_Controller class you need to make sure your controllers extend MY_Controller instead of CI_Controller (See the example below). The code will be ran and you can access it in the normal way.

Example Controller – Default welcome.php: 

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends MY_Controller {

	public function index()
	{
		echo "Referrer: ".$this->session->flashdata('referrer');
		echo anchor(uri_string(), 'clicky');
		$this->load->view('welcome_message');
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */

Freelance consulting position

I’ve just spent the last 3 months working with well known Uk based digital media agency Cyber-duck (http://www.cyber-duck.co.uk). The team there were great to work with, I learnt a few new techniques and met some great people!

Many thanks for the oppertunity and I look forward to working with you in the future!

Get OS X Lion Free!

Did you buy your new Mac on or after the 6th June 2011? Well guess what, you can get Apples OSX Lion as a free upgrade for your machine.

OS X Lion Up-to-Date Programme. OS X Lion is coming this month, but you don’t have to wait until then to get your new Mac. The OS X Lion Up-to-Date upgrade will be available at no additional charge via the Mac App Store to all customers who purchased a qualifying new Mac system from Apple or an Apple Authorised Reseller on or after 6 June 2011.

You can read more about this promotion on the apple website here

Using hyphens instead of underscores in CodeIgniter

When I’m building a CodeIgniter application there are several important things that I need to think about whilst putting the whole project together. Two of these things are Accessibility and Search Engine Optimisation (SEO) and in particular for this article the URLs I use to link it all together.

Click here to read more…

Coda and SVN repositories: Invalid Server Certificate

With Coda version 1.5.1 there is no way of managing svn certificates, and when you try to add a repository for a site that has a self signed SSL certificate you will just get an alert with the error “Server certificate verification failed: issuer is not trusted”. One solution is to accept the certificate using svn through the command line, if you’re new to svn here’s how to do it:

1. If you haven’t already, install svn for mac

2. In a Terminal type svn list and the url of your SVN repository as below

svn list https://www.example.com/svn/

Type p to confirm and the certification will be cached.

Voila! You should now be able to connect to your SVN repository. For some reason although I accepted the certificate “permanently” I had to redo this fix every so often.