<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matthew Elliston</title>
	<atom:link href="http://www.matthewelliston.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthewelliston.com</link>
	<description></description>
	<lastBuildDate>Thu, 18 Feb 2010 10:35:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magento &#8211; Change Layered Navigation Category Text</title>
		<link>http://www.matthewelliston.com/magento-change-layered-navigation-category-text/</link>
		<comments>http://www.matthewelliston.com/magento-change-layered-navigation-category-text/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:35:37 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=136</guid>
		<description><![CDATA[This is just a quick post about how to change the &#8220;Category&#8221; wording on the layered navigation of a site. I needed to change it to &#8220;Brand&#8221; and it took me a few minutes to locate the correct files as the developer guide lines were not showing up. I thought for this reason I will [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick post about how to change the &#8220;Category&#8221; wording on the layered navigation of a site. I needed to change it to &#8220;Brand&#8221; and it took me a few minutes to locate the correct files as the developer guide lines were not showing up. I thought for this reason I will make a quick note of it here on my blog.</p>
<p>The file you need to look in is:</p>
<p><em>/shop/app/design/frontend/default/default/template/catalog/navigation/left.phtml</em></p>
<p>Remember default/default should be changed to your current interface and theme for the site.</p>
<p>In this file around line 46 you should see a line of code looking like this:</p>
<p>
<pre class="brush: php">
<dt><?php echo $this->__('Category') ?></dt>
</pre>
<p>Change this to whatever you want to display eg. &#8216;Brand&#8217;. So my line will now look like:</p>
<p>
<pre class="brush: php">
<dt><?php echo $this->__('Brand') ?></dt>
</pre>
<p>Save the file and hit refresh and voila! New title in your layered navigation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/magento-change-layered-navigation-category-text/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento Change &#8220;My Cart&#8221; to &#8220;My Basket&#8221;</title>
		<link>http://www.matthewelliston.com/magento-change-my-cart-to-my-basket/</link>
		<comments>http://www.matthewelliston.com/magento-change-my-cart-to-my-basket/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 13:16:46 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=132</guid>
		<description><![CDATA[A site we were developing needed to have the wording &#8220;My Cart&#8221; changed to &#8220;My Basket&#8221; in the header links of the site.
To do this we made a translate.csv file under &#8220;/app/design/frontend/default/default/locale/en_GB/&#8221;
The &#8220;en_GB&#8221; could be whatever locale you are using. Our store is setup for the UK so it is &#8220;en_GB&#8221; the US would be [...]]]></description>
			<content:encoded><![CDATA[<p>A site we were developing needed to have the wording &#8220;My Cart&#8221; changed to &#8220;My Basket&#8221; in the header links of the site.</p>
<p>To do this we made a translate.csv file under &#8220;/app/design/frontend/default/default/locale/en_GB/&#8221;</p>
<p>The &#8220;en_GB&#8221; could be whatever locale you are using. Our store is setup for the UK so it is &#8220;en_GB&#8221; the US would be &#8220;en_US&#8221;.</p>
<p>Also the template could differ, we were using the default template.</p>
<p>Now in the translate.csv file add the following lines:</p>
<p>&#8220;My Cart (%s item)&#8221;, &#8220;My Basket (%s item)&#8221;<br />
&#8220;My Cart (%s items)&#8221;, &#8220;My Basket (%s items)&#8221;<br />
&#8220;My Cart&#8221;, &#8220;My Basket&#8221;</p>
<p>Save the file and upload it to the location above. Login to the admin and refresh the cache by going to System->Cache Management. Select refresh in the drop down and press &#8220;Save Cache Settings&#8221;</p>
<p>Refresh your website front end to notice the difference.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/magento-change-my-cart-to-my-basket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copyright Year.</title>
		<link>http://www.matthewelliston.com/copyright-year/</link>
		<comments>http://www.matthewelliston.com/copyright-year/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 09:23:46 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=125</guid>
		<description><![CDATA[Just a quick post but it is one that I had to use recently so thought I would quickly make a note of it so that it helps others out.
With the new year coming I had to update a sites copyright year which was displayed in the footer. It was a simple enough thing to [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post but it is one that I had to use recently so thought I would quickly make a note of it so that it helps others out.</p>
<p>With the new year coming I had to update a sites copyright year which was displayed in the footer. It was a simple enough thing to do but I feared that I would need to be doing it again this time next year.</p>
<p>The solution was to use PHP to output the current year.</p>
<pre class="brush: php">
   echo date("Y");
</pre>
<p>If your server doesn&#8217;t support PHP check see if there are any other server side scripting languages such as ASP, Perl, Python or Ruby etc They all have similar functions for returning the current year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/copyright-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove sound from an FLV</title>
		<link>http://www.matthewelliston.com/remove-sound-from-an-flv/</link>
		<comments>http://www.matthewelliston.com/remove-sound-from-an-flv/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 10:40:34 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=113</guid>
		<description><![CDATA[Today I needed to remove sound from an a flash video that was playing in the website. I was hoping that I would not have to get the DVD out and re-encode it for the web as this took me quite some time to get it to the required level of quality/size.
After a bit of [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to remove sound from an a flash video that was playing in the website. I was hoping that I would not have to get the DVD out and re-encode it for the web as this took me quite some time to get it to the required level of quality/size.</p>
<p>After a bit of searching with google I came across FFMPEG which turned made the task really easy.</p>
<pre class="brush: bash">
ffmpeg -i input.flv -an -vcodec copy output.flv
</pre>
<p>-i is the input fil<br />
-an disables the audio which is really important here.<br />
-vcodec copy ensures that the codec of the input file is used for the output file.</p>
<p>output.flv is the name of the output file.</p>
<p>Hope that you find this useful! I know it saved me some time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/remove-sound-from-an-flv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Scaffolding Class</title>
		<link>http://www.matthewelliston.com/php-scaffolding-class/</link>
		<comments>http://www.matthewelliston.com/php-scaffolding-class/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 21:11:53 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=101</guid>
		<description><![CDATA[Im uploading this scaffolding class so that hopefully some other people can find use for it. It is based on the excellent tutorial on building a scaffolding class by Ben Hirsch which can be found here http://www.shadow-fox.net/site/tutorial/39-Creating-A-Scaffold-like-Class-in-PHP-or-An-Automatic-CMS-For-a-Table Sadly i can&#8217;t seem to find the original post however I&#8217;m sure its nothing a quick google can&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Im uploading this scaffolding class so that hopefully some other people can find use for it. It is based on the excellent tutorial on building a scaffolding class by Ben Hirsch which can be found here http://www.shadow-fox.net/site/tutorial/39-Creating-A-Scaffold-like-Class-in-PHP-or-An-Automatic-CMS-For-a-Table Sadly i can&#8217;t seem to find the original post however I&#8217;m sure its nothing a quick google can&#8217;t fix.</p>
<p>There is a link to the download at the end of this post.</p>
<p>I have used it to get projects going quickly. It can be pointed to a mysql database and can read the tables in etc and generate the CReate Update and Delete (CRUD) similar to how ruby on rails has scaffolding.</p>
<p>It is by no means perfect and could do with some refinements here and there. It is however quite functional in its current state and has support for foreign keys and image uploads.</p>
<p>There are some naming conventions to be adhered to if you want to get the most out of this. However you can quickly go through it and change these to whatever you like.</p>
<p>Here is a list of column names and how the Scaffolding Class reacts to them:</p>
<table>
<tr>
<th>Column Name</th>
<th>Data Type</th>
<th>Scaffolding Output</th>
</tr>
<tr>
<td>image_url</td>
<td>varchar(255)</td>
<td>Image Upload Field</td>
</tr>
<tr>
<td></td>
<td>varchar</td>
<td>Text Input</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>Textarea</td>
</tr>
<tr>
<td>&#8220;foreigntable_id&#8221;</td>
<td>INT</td>
<td>Outputs the &#8220;name&#8221; field from the lookup table &#8220;foreigntable&#8221;</td>
</tr>
<tr>
<td></td>
<td>datetime</td>
<td>A date/time drop down selector.</td>
</tr>
<tr>
<td>Last three characters &#8216;_on&#8217;</td>
<td>INT</td>
<td>A Yes/No drop down selector.</td>
</tr>
</table>
<p>I have used this for many projects to get them off the ground. For simple admin areas it works perfectly. </p>
<p>Would love to hear your thoughts and comments.</p>
<p><a href="http://www.matthewelliston.com/code/Scaffolding.zip" title="PHP Scaffolding Class">Download Scaffolding.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/php-scaffolding-class/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Howto scrape an entire website</title>
		<link>http://www.matthewelliston.com/howto-scrape-an-entire-website/</link>
		<comments>http://www.matthewelliston.com/howto-scrape-an-entire-website/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 18:22:06 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=95</guid>
		<description><![CDATA[I had the need to backup an entire site and its content when I couldn&#8217;t get access to the FTP details quickly. Luckily the site was just static content so I was able to just use one of the many tools available in a regular linux shell.
Here is the code I typed into my terminal:
wget [...]]]></description>
			<content:encoded><![CDATA[<p>I had the need to backup an entire site and its content when I couldn&#8217;t get access to the FTP details quickly. Luckily the site was just static content so I was able to just use one of the many tools available in a regular linux shell.</p>
<p>Here is the code I typed into my terminal:</p>
<pre class="brush: bash">wget -m --tries=5 "http://www.foo.com"</pre>
<p>The &#8220;-m&#8221; from the Man pages states that it is mirroring where it will follow links around the pages. The &#8220;&#8211;tries=5&#8243; will stop  wget from running into an infinite loop.</p>
<p>I&#8217;m not sure how well this will work with dynamic sites it may just capture the HTML of the outputted server side script but at least its better than nothing.</p>
<p>Further options such as:</p>
<pre class="brush: bash">--referer=www.google.com</pre>
<p>For setting the referrer and:</p>
<pre class="brush: bash">--user-agent=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090717 Fedora/3.5.1-3.fc11 Firefox/3.5.1</pre>
<p>For setting the user agent if a particular website is proving tricky to download.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/howto-scrape-an-entire-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I&#8217;m Back!</title>
		<link>http://www.matthewelliston.com/im-back/</link>
		<comments>http://www.matthewelliston.com/im-back/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 18:07:00 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=93</guid>
		<description><![CDATA[I have recently been working quite hard on some projects for work and also I had about a month off over summer.
I have however got a series of updates to add to the site which include a basic framework I made for a project at work and also some tools I have found for web [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently been working quite hard on some projects for work and also I had about a month off over summer.</p>
<p>I have however got a series of updates to add to the site which include a basic framework I made for a project at work and also some tools I have found for web related tasks.</p>
<p>I will be adding these to the site shortly and also trying to think of some more content that I feel other people may find useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/im-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Singleton Database Class</title>
		<link>http://www.matthewelliston.com/php-singleton-database-class/</link>
		<comments>http://www.matthewelliston.com/php-singleton-database-class/#comments</comments>
		<pubDate>Tue, 12 May 2009 21:14:16 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Database Class]]></category>
		<category><![CDATA[Singleton Database Class]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=67</guid>
		<description><![CDATA[A php singleton database class which allows your database queries to be performed quickly and with very few lines of code.]]></description>
			<content:encoded><![CDATA[<p>Hi this is my first post in the way of development on my blog.</p>
<p>I have decided to upload my database class that I use for projects. Its by no means perfect. There is quite a heated debate on Singleton classes themselves. However I like how it works for me. I can query query a database quicklyby simply using:</p>
<pre class="brush: php">&lt;?php

$db = Database::getInstance();
$results = $db-&gt;query("SELECT * FROM test WHERE name = :name",array(":name" =&gt; "matthew"));

print_r($results);

?&gt;</pre>
<p><span id="more-67"></span></p>
<p>The function query can be passed an array of arguments that can be used when wanting to sanitize the data before querying the database. This uses the standard PDO::prepare() function to create the prepared statement. It can accept the :foo or ? format of statement.</p>
<p>Here is the full listing of the class.</p>
<pre class="brush: php">
&lt;?php
/**
* Database access class.
* Used in applications where one point of database access is required
*
* Typical Usage:
* $db = Database::getInstance();
* $results = $db-&gt;query("SELECT * FROM test WHERE name = :name",array(":name" =&gt; "matthew"));
* print_r($results);
*
* @author Matthew Elliston &lt;matt@e-titans.com&gt;
* @version 1.0
*/
class Database {

/**
* Instance of the database class
* @static Database $instance
*/
private static $instance;
/**
* Database connection
* @access private
* @var PDO $connection
*/
private $connection;

/**
* Constructor
* @param $dsn The Data Source Name. eg, "mysql:dbname=testdb;host=127.0.0.1"
* @param $username
* @param $password
*/
private function __construct(){
$this-&gt;connection = new PDO("mysql:dbname=spaceinteriors;host=127.0.0.1","root","");
$this-&gt;connection-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}

/**
* Gets an instance of the Database class
*
* @static
* @return Database An instance of the database singleton class.
*/
public static function getInstance(){
if(empty(self::$instance)){
try{
self::$instance = new Database();
} catch (PDOException $e) {
echo 'Connection failed: ' . $e-&gt;getMessage();
}
}
return self::$instance;
}

/**
* Runs a query using the current connection to the database.
*
* @param string query
* @param array $args An array of arguments for the sanitization such as array(":name" =&gt; "foo")
* @return array Containing all the remaining rows in the result set.
*/
public function query($query, $args){
$tokens = explode(" ",$query);
try{
$sth = $this-&gt;connection-&gt;prepare($query);
if(empty($args)){
$sth-&gt;execute();
}
else{
$sth-&gt;execute($args);
}
if($tokens[0] == "SELECT"){
$sth-&gt;setFetchMode(PDO::FETCH_ASSOC);
$results = $sth-&gt;fetchAll();
return $results;
}
} catch (PDOException $e) {
echo 'Query failed: ' . $e-&gt;getMessage();
echo '&lt;br /&gt;Query : ' . $query;
}
return 1;
}

/**
* Returns the last inserted ID
*
* @return int ID of the last inserted row
*/
public function lastInsertId(){
return $this-&gt;connection-&gt;lastInsertId();
}
}
?&gt;
</pre>
<p>Please let me know your thoughts on this and any tips to improve it.</p>
<p>I don&#8217;t claim it to be perfect but it fits what I need, so please be kind!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/php-singleton-database-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updated Gallery</title>
		<link>http://www.matthewelliston.com/updated-gallery/</link>
		<comments>http://www.matthewelliston.com/updated-gallery/#comments</comments>
		<pubDate>Fri, 01 May 2009 23:58:44 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=52</guid>
		<description><![CDATA[Its been a while. Too long in fact! I have updated the gallery with some pics I have taken while out and about.
I need to get some of my other work up here that I think could be useful to other people. My aim is to get my PHP scaffolding class up onto this site. [...]]]></description>
			<content:encoded><![CDATA[<p>Its been a while. Too long in fact! I have updated the gallery with some pics I have taken while out and about.</p>
<p>I need to get some of my other work up here that I think could be useful to other people. My aim is to get my PHP scaffolding class up onto this site. I use it for lots of things its really good.</p>
<p>I will make it my May mission to get this online!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/updated-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://www.matthewelliston.com/welcome/</link>
		<comments>http://www.matthewelliston.com/welcome/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 13:21:03 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://www.matthewelliston.com/?p=3</guid>
		<description><![CDATA[Thanks for stopping by and visiting my blog. I intend to use this blog as a reference for anything I think people may find useful.
Please take time to check back in the future, hopefully more content will have been added.
]]></description>
			<content:encoded><![CDATA[<p>Thanks for stopping by and visiting my blog. I intend to use this blog as a reference for anything I think people may find useful.</p>
<p>Please take time to check back in the future, hopefully more content will have been added.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewelliston.com/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
