<?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>Matt&#039;s Blog</title>
	<atom:link href="http://www.roaringmoon.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.roaringmoon.com/blog</link>
	<description>Odds and Ends from inside my head...</description>
	<lastBuildDate>Thu, 03 Jun 2010 16:33:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Windows 7 God Mode</title>
		<link>http://www.roaringmoon.com/blog/2010/06/03/windows-7-god-mode/</link>
		<comments>http://www.roaringmoon.com/blog/2010/06/03/windows-7-god-mode/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 16:33:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[God Mode]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=80</guid>
		<description><![CDATA[Windows 7 includes a neat feature called God Mode. Although the name is a bit of overkill, the feature is handy because it offers an easy way to access all Windows settings from a single folder. To use God Mode: Create a new folder with the following name: GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}. You can change the name “God [...]]]></description>
			<content:encoded><![CDATA[<p>Windows 7 includes a neat feature called God Mode. Although the name  is a bit of overkill, the feature is handy because it offers an easy way  to access all Windows settings from a single folder.</p>
<p>To use God  Mode:</p>
<ol>
<li>Create a new folder with the following name:  GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}. You can change the name  “God Mode.” However, the period and numbers must remain as is.</li>
<li>Once  you rename the folder, the folder icon will change to resemble a  Control Panel.</li>
<li>Double click the folder. A window will appear,  which looks similar to the Control Panel, with dozens of options.</li>
</ol>
<p>From: http://www.lockergnome.com/windows/2010/06/02/windows-7s-god-mode/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2010/06/03/windows-7-god-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Money with the Nationwide Bulding Society</title>
		<link>http://www.roaringmoon.com/blog/2010/01/27/microsoft-money-with-the-nationwide-bulding-society/</link>
		<comments>http://www.roaringmoon.com/blog/2010/01/27/microsoft-money-with-the-nationwide-bulding-society/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:10:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[Microsoft Money]]></category>
		<category><![CDATA[MT2OFX]]></category>
		<category><![CDATA[Nationwide Building Society]]></category>
		<category><![CDATA[OFX]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=70</guid>
		<description><![CDATA[As a Microsoft Money user, I&#8217;ve recently discovered the need to convert CSV files into OFX files. My bank, the Nationwide Building Society, ended support for Microsoft Money online services in October 2009. You can still download your statements as CSV files, but Microsoft Money is not able to import them. After a spot of [...]]]></description>
			<content:encoded><![CDATA[<p>As a Microsoft Money user, I&#8217;ve recently discovered the need to convert CSV files into OFX files. My bank, the Nationwide Building Society, ended support for Microsoft Money online services in October 2009. You can still download your statements as CSV files, but Microsoft Money is not able to import them. After a spot of Googling, I stumbled across MT2OFX. So far, it seems to have been able to convert my statements without any trouble, although I have only been using it for a short time.</p>
<p>You can find it at the following website:</p>
<p><a href="http://www.xs4all.nl/~csmale/mt2ofx/en/">http://www.xs4all.nl/~csmale/mt2ofx/en/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2010/01/27/microsoft-money-with-the-nationwide-bulding-society/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>O2 PAYG Mobile Broadband</title>
		<link>http://www.roaringmoon.com/blog/2010/01/27/o2-payg-mobile-broadband/</link>
		<comments>http://www.roaringmoon.com/blog/2010/01/27/o2-payg-mobile-broadband/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:01:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[mobile broadband]]></category>
		<category><![CDATA[O2]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[wvdial]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=68</guid>
		<description><![CDATA[Having Googled unsuccessfully for the settings needed to use wvdial or a Solwise 3G router with O2 Pay-As-You-Go Mobile Broadband, I thought I would share the correct settings here. In order to connect you need the following details: APN: m-bb.o2.co.uk Username: o2bb Password: password The URL to visit to buy credit is: https://mobilebroadbandaccess.o2.co.uk/ Happy surfing!]]></description>
			<content:encoded><![CDATA[<p>Having Googled unsuccessfully for the settings needed to use wvdial or a Solwise 3G router with O2 Pay-As-You-Go Mobile Broadband, I thought I would share the correct settings here. In order to connect you need the following details:</p>
<p>APN: m-bb.o2.co.uk<br />
Username: o2bb<br />
Password: password</p>
<p>The URL to visit to buy credit is:</p>
<p><a href="https://mobilebroadbandaccess.o2.co.uk/">https://mobilebroadbandaccess.o2.co.uk/</a></p>
<p>Happy surfing! <img src='http://www.roaringmoon.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2010/01/27/o2-payg-mobile-broadband/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better image quality from UMTS using Privoxy</title>
		<link>http://www.roaringmoon.com/blog/2010/01/22/better-image-quality-from-umts-using-privoxy/</link>
		<comments>http://www.roaringmoon.com/blog/2010/01/22/better-image-quality-from-umts-using-privoxy/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 15:56:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cache-Control]]></category>
		<category><![CDATA[mobile broadband]]></category>
		<category><![CDATA[Pragma]]></category>
		<category><![CDATA[Privoxy]]></category>
		<category><![CDATA[UMTS]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=61</guid>
		<description><![CDATA[If you are a mobile broadband user you will notice that your image quality is degraded by UMTS. Firefox can overcome this problem by virtue of the Modify Headers plugin. Essentially you need to add two headers to your outgoing request: Pragma: no-cache Cache-Control: no-cache The same effect can be achieved for Internet Explorer and [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a mobile broadband user you will notice that your image quality is degraded by <a href="http://en.wikipedia.org/wiki/Universal_Mobile_Telecommunications_System">UMTS</a>. Firefox can overcome this problem by virtue of the <a href="https://addons.mozilla.org/en-US/firefox/addon/967">Modify Headers</a> plugin. Essentially you need to add two headers to your outgoing request:</p>
<p>Pragma: no-cache</p>
<p>Cache-Control: no-cache</p>
<p>The same effect can be achieved for Internet Explorer and other Windows applications by running <a href="http://www.privoxy.org/">Privoxy</a> and adding the following rule to the actions file:</p>
<p><code><br />
{+add-header{Pragma: no-cache}\<br />
+add-header{Cache-Control: no-cache}}<br />
/<br />
</code></p>
<p>More details here: <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=2913535&amp;group_id=11118&amp;atid=211118">http://sourceforge.net/tracker/index.php?func=detail&amp;aid=2913535&amp;group_id=11118&amp;atid=211118</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2010/01/22/better-image-quality-from-umts-using-privoxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One free week of StarTiger</title>
		<link>http://www.roaringmoon.com/blog/2009/12/14/one-free-week-of-startiger/</link>
		<comments>http://www.roaringmoon.com/blog/2009/12/14/one-free-week-of-startiger/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 19:57:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[autographs]]></category>
		<category><![CDATA[coupon]]></category>
		<category><![CDATA[free week]]></category>
		<category><![CDATA[StarTiger]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=58</guid>
		<description><![CDATA[Coupon Code: FREE-5DDC-A48A Just follow these steps: Go to http://www.startiger.com Click on &#8220;Join Now&#8221; Enter the coupon code in the coupon code field Enter your valid e-mail address and click on &#8220;Next&#8221; Select your username and password on the following page and click on &#8220;Next&#8221;. Enjoy your free week at StarTiger!]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Arial; font-size: x-small;"><strong>Coupon Code: FREE-5DDC-A48A</strong></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">Just follow these steps: </span></span></p>
<ul><span style="font-family: Arial; font-size: x-small;"></p>
<li>Go to <a href="http://www.startiger.com">http://www.startiger.com</a></li>
<li>Click on &#8220;Join Now&#8221;</li>
<li>Enter the coupon code in the coupon code field</li>
<li>Enter your <strong>valid</strong> e-mail address and click on &#8220;Next&#8221;</li>
<li>Select your username and password on the following page and click on &#8220;Next&#8221;.</li>
<li>Enjoy your free week at StarTiger!</li>
<p></span></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2009/12/14/one-free-week-of-startiger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tesco Internet Phone + Linksys PAP2</title>
		<link>http://www.roaringmoon.com/blog/2009/10/25/tesco-internet-phone-linksys-pap2/</link>
		<comments>http://www.roaringmoon.com/blog/2009/10/25/tesco-internet-phone-linksys-pap2/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 12:46:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linksys]]></category>
		<category><![CDATA[PAP2]]></category>
		<category><![CDATA[SIP]]></category>
		<category><![CDATA[Tesco Internet Phone]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[voicemail]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=53</guid>
		<description><![CDATA[So the good news is that Tesco Internet Phone have started letting people use SIP to access their service. This means that I can now set up the second line on my PAP2 to connect to it. All well and good until I tried to access my voicemail by dialling *123. It turns out the [...]]]></description>
			<content:encoded><![CDATA[<p>So the good news is that Tesco Internet Phone have started letting people use SIP to access their service. This means that I can now set up the second line on my PAP2 to connect to it. All well and good until I tried to access my voicemail by dialling *123.</p>
<p>It turns out the dial plan on the PAP2 is set to only allow 2 digit numbers following the * symbol (mostly used as command codes to the PAP2 itself).</p>
<p>The default dial plan reads:</p>
<p><code>(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)</code></p>
<p>but to allow calling *123 it needs to be adjusted to:</p>
<p><code>(*xxx|[123469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)</code></p>
<p>After contacting their customer services it also turns out that the current version of the onscreen TIP will not work properly with Windows Vista. In order to retrieve your voicemail when running on Vista you need an updated version, available here:</p>
<p><a href="http://www.tescointernetphone.com/images/tescoip-3.3.2.8126-live-setup.exe">http://www.tescointernetphone.com/images/tescoip-3.3.2.8126-live-setup.exe</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2009/10/25/tesco-internet-phone-linksys-pap2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wooden Puzzle Box</title>
		<link>http://www.roaringmoon.com/blog/2009/10/25/wooden-puzzle-box/</link>
		<comments>http://www.roaringmoon.com/blog/2009/10/25/wooden-puzzle-box/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 12:32:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magic]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[wood]]></category>
		<category><![CDATA[wooden puzzle box]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=55</guid>
		<description><![CDATA[A couple of days ago I found a Wooden Puzzle Box on Firebox.com. It works on the same principle as a plastic version bought for me a few years back by a relative (I think it was bought from a Hawkins Bazaar). When you don&#8217;t know the answer it is fiendishly difficult to open.]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I found a Wooden Puzzle Box on <a href="http://www.firebox.com/product/2528/Magic-IQ-Box">Firebox.com</a>. It works on the same principle as a plastic version bought for me a few years back by a relative (I think it was bought from a Hawkins Bazaar). When you don&#8217;t know the answer it is fiendishly difficult to open.</p>
<p><a title="Wooden Puzzle Box by vivaceuk, on Flickr" href="http://www.flickr.com/photos/vivaceuk/4040829018/"><img src="http://farm3.static.flickr.com/2696/4040829018_1e48fe110e_m.jpg" alt="Wooden Puzzle Box" width="240" height="180" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2009/10/25/wooden-puzzle-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GameCube Animal Crossing Floating Presents</title>
		<link>http://www.roaringmoon.com/blog/2009/06/28/gamecube-animal-crossing-floating-presents/</link>
		<comments>http://www.roaringmoon.com/blog/2009/06/28/gamecube-animal-crossing-floating-presents/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 17:19:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Animal Crossing]]></category>
		<category><![CDATA[gamecube]]></category>
		<category><![CDATA[video games]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=49</guid>
		<description><![CDATA[At long last I have figured out how to get floating presents down from the sky in Animal Crossing on the GameCube. In the later version, &#8220;Animal Crossing: Wild World&#8221; for the DS, you can use a slingshot to pop the balloons the presents are attached to. Alas, in the original version on the cube [...]]]></description>
			<content:encoded><![CDATA[<p>At long last I have figured out how to get floating presents down from the sky in Animal Crossing on the GameCube. In the later version, &#8220;Animal Crossing: Wild World&#8221; for the DS, you can use a slingshot to pop the balloons the presents are attached to. Alas, in the original version on the cube there is no slingshot. The answer is infuriatingly simple (and logical if you think about it)&#8230; all you do is follow the present until it floats directly over a tree, and then shake the tree. Voila!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2009/06/28/gamecube-animal-crossing-floating-presents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shopping Cart for CodeIgniter</title>
		<link>http://www.roaringmoon.com/blog/2009/06/09/shopping-cart-for-codeigniter/</link>
		<comments>http://www.roaringmoon.com/blog/2009/06/09/shopping-cart-for-codeigniter/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 13:17:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cart]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=41</guid>
		<description><![CDATA[Despite much Googling, I haven&#8217;t been able to find a ready made shopping cart for the CodeIgniter PHP framework. Unfortunately one of my current projects requires such a thing, so I decided to roll my own. Starting from the code here: http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart, I made a few changes to fit the CodeIgniter way of doing things. [...]]]></description>
			<content:encoded><![CDATA[<p>Despite much Googling, I haven&#8217;t been able to find a ready made shopping cart for the <a href="http://codeigniter.com/">CodeIgniter</a> PHP framework. Unfortunately one of my current projects requires such a thing, so I decided to roll my own. Starting from the code here: <a href="http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart">http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart</a>, I made a few changes to fit the CodeIgniter way of doing things.</p>
<p>The revised version looks like this:</p>
<style>
<!--
ol {
list-style-image:none;
list-style-position:outside;
list-style-type:decimal;
}
ol.code li, code {
background:#F7EDEB none repeat scroll 0 0;
line-height:130%;
margin-bottom:5px;
}
-->
</style>
<ol>
<li><code>&lt;?php</code></li>
<li><code>// Based on http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart</code></li>
<li><code>class Cart extends Controller {</code></li>
<li><code>function Cart()</code></li>
<li><code>{</code></li>
<li><code>parent::Controller();</code></li>
<li><code>$this-&gt;load-&gt;library('session');</code></li>
<li><code>$this-&gt;load-&gt;helper('url');</code></li>
<li><code>}</code></li>
<li><code>function index()</code></li>
<li><code>{</code></li>
<li><code>$cart = $this-&gt;session-&gt;userdata('cart');</code></li>
<li><code>if ($cart) {</code></li>
<li><code>$items = explode(',',$cart);</code></li>
<li><code>$contents = array();</code></li>
<li><code>foreach ($items as $item) {</code></li>
<li><code>$contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1;</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>if ($contents)</code></li>
<li><code>{</code></li>
<li><code>$id_list = '';</code></li>
<li><code>foreach(array_keys($contents) as $val)</code></li>
<li><code>$id_list .=  $this-&gt;db-&gt;escape($val) .',';</code></li>
<li><code>$id_list = substr($id_list,0,len($id_list) - 1);</code></li>
<li><code>$query_string = "SELECT * FROM stock_table WHERE id IN(".$id_list.")";</code></li>
<li><code>$query = $this-&gt;db-&gt;query($query_string);</code></li>
<li><code>f ($query-&gt;num_rows() &gt; 0)</code></li>
<li><code>{</code></li>
<li><code>$basket = array();</code></li>
<li><code>foreach ($query-&gt;result() as $row)</code></li>
<li><code>{</code></li>
<li><code>$basket[] = array('id' =&gt; $row-&gt;id, 'caption' =&gt; $row-&gt;caption, 'price' =&gt; $row-&gt;price,<br />
'qty' =&gt; $contents[$row-&gt;id], 'total' =&gt; $contents[$row-&gt;id] * $row-&gt;price);</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>$data = array();</code></li>
<li><code>if ($basket)</code></li>
<li><code>{</code></li>
<li><code>$data['basket'] = $basket;</code></li>
<li><code>$grand_total = 0;</code></li>
<li><code>foreach($basket as $item)</code></li>
<li><code>$grand_total += $item[total];</code></li>
<li><code>$data['grand_total'] = sprintf("%01.2f", $grand_total);</code></li>
<li><code>}</code></li>
<li><code>else</code></li>
<li><code>$data['grand_total'] = sprintf("%01.2f", 0);</code></li>
<li><code>$data['page'] = 'cart_view';</code></li>
<li><code>$data['title'] = "Your basket";</code></li>
<li><code>$this-&gt;load-&gt;view('template/container',$data);</code></li>
<li><code>}</code></li>
<li><code>function add_item($item_id='')</code></li>
<li><code>{</code></li>
<li><code>$cart = $this-&gt;session-&gt;userdata('cart');</code></li>
<li><code>if ($cart) {</code></li>
<li><code>$cart .= ','.$item_id;</code></li>
<li><code>} else {</code></li>
<li><code>$cart = $item_id;</code></li>
<li><code>}</code></li>
<li><code>$this-&gt;session-&gt;set_userdata(array('cart' =&gt;</code></li>
<li><code>$cart));</code></li>
<li><code>redirect('/cart/', 'refresh');</code></li>
<li><code>}</code></li>
<li><code>function delete_item($item_id='')</code></li>
<li><code>{</code></li>
<li><code>$cart = $this-&gt;session-&gt;userdata('cart');</code></li>
<li><code>if ($cart) {</code></li>
<li><code>$items = explode(',',$cart);</code></li>
<li><code>$newcart = '';</code></li>
<li><code>foreach ($items as $item) {</code></li>
<li><code>if ($item_id != $item) {</code></li>
<li><code>if ($newcart != '') {</code></li>
<li><code>$newcart .= ','.$item;</code></li>
<li><code>} else {</code></li>
<li><code>$newcart = $item;</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>$cart = $newcart;</code></li>
<li><code>}</code></li>
<li><code>$this-&gt;session-&gt;set_userdata(array('cart' =&gt;</code></li>
<li><code>$cart));</code></li>
<li><code>redirect('/cart/', 'refresh');</code></li>
<li><code>}</code></li>
<li><code>function delete_all()</code></li>
<li><code>{</code></li>
<li><code>$this-&gt;session-&gt;unset_userdata('cart');</code></li>
<li><code>redirect('/cart/', 'refresh');</code></li>
<li><code>}</code></li>
<li><code>function update_cart()</code></li>
<li><code>{</code></li>
<li><code>if ($cart) {</code></li>
<li><code>$newcart = '';</code></li>
<li><code>foreach ($_POST as $key=&gt;$value) {</code></li>
<li><code>if (stristr($key,'qty')) {</code></li>
<li><code>$id = str_replace('qty','',$key);</code></li>
<li><code>$items = ($newcart != '') ? explode(',',$newcart) : explode(',',$cart);</code></li>
<li><code>$newcart = '';</code></li>
<li><code>foreach ($items as $item) {</code></li>
<li><code>if ($item_id != $item) {</code></li>
<li><code>if ($newcart != '') {</code></li>
<li><code>$newcart .= ','.$item;</code></li>
<li><code>} else {</code></li>
<li><code>$newcart = $item;</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>for ($i=1;$i&lt;=$value;$i++) {</code></li>
<li><code>if ($newcart != '') {</code></li>
<li><code>$newcart .= ','.$id;</code></li>
<li><code>} else {</code></li>
<li><code>$newcart = $id;</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
<li><code>$this-&gt;session-&gt;set_userdata(array('cart' =&gt;</code></li>
<li><code>$newcart));</code></li>
<li><code>redirect('/cart/', 'refresh');</code></li>
<li><code>}</code></li>
<li><code>function checkout()</code></li>
<li><code>{</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
</ol>
<p>The associated view looks like this:</p>
<ol>
<li><code>&lt;p&gt;Basket Total: &amp;pound;&lt;?=$grand_total?&gt;&lt;/p&gt;</code></li>
<li><code>&lt;?php</code></li>
<li><code>if (isset($basket))</code></li>
<li><code>{</code></li>
<li><code>?&gt;</code></li>
<li><code>&lt;form method="post" id="cart-form" action="&lt;?=site_url().'update_cart'?&gt;"&gt;</code></li>
<li><code>&lt;table&gt;</code></li>
<li><code>&lt;tr&gt;&lt;td&gt;ID:&lt;/td&gt;&lt;td&gt;Desc:&lt;/td&gt;&lt;td&gt;Price:&lt;/td&gt;&lt;td&gt;Quantity:&lt;/td&gt;&lt;td&gt;Total:&lt;/td&gt;&lt;td&gt;Delete?&lt;/td&gt;&lt;/tr&gt;</code></li>
<li><code>&lt;?php</code></li>
<li><code>foreach ($basket as $val)</code></li>
<li><code>{</code></li>
<li><code>?&gt;</code></li>
<li><code>&lt;tr&gt;&lt;td&gt;&lt;?=$val['id']?&gt;&lt;/td&gt;&lt;td&gt;&lt;?=$val['caption']?&gt;&lt;/td&gt;&lt;td&gt;&lt;?=$val['price']?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type="text" name="qty'&lt;?=$val['id']?&gt;'" value="&lt;?=$val['qty']?&gt;" size="3" maxlength="3" /&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;?=$val['total']?&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="&lt;?=site_url().'delete_item/'.$val['id']?&gt;"&gt;[x]&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;</code></li>
<li><code>&lt;?php</code></li>
<li><code>}</code></li>
<li><code>?&gt;</code></li>
<li><code>&lt;/table&gt;</code></li>
<li><code>&lt;input type="submit" name="submit" value="Update Cart" /&gt;</code></li>
<li><code>&lt;/form&gt;</code></li>
<li><code>&lt;p&gt;&lt;a href="&lt;?=site_url().'delete_all'?&gt;"&gt;Empty Cart&lt;/a&gt;&lt;/p&gt;</code></li>
<li><code>&lt;p&gt;&lt;a href="&lt;?=site_url().'checkout'?&gt;"&gt;Checkout&lt;/a&gt;&lt;/p&gt;</code></li>
<li><code>&lt;?php</code></li>
<li><code>}</code></li>
<li><code>else</code></li>
<li><code>{</code></li>
<li><code>?&gt;</code></li>
<li><code>&lt;p&gt;Your shopping basket is empty.&lt;/p&gt;</code></li>
<li><code>&lt;?php</code></li>
<li><code>}</code></li>
<li><code>?&gt;</code></li>
</ol>
<p>The code also assumes a database &#8220;stock_table&#8221; with the following structure:</p>
<ol>
<li><code>--</code></li>
<li><code>-- Table structure for table `stock_table`</code></li>
<li><code>--</code></li>
<li><code>CREATE TABLE IF NOT EXISTS `stock_table` (</code></li>
<li><code>`id` int(10) unsigned NOT NULL auto_increment,</code></li>
<li><code>`caption` varchar(20) NOT NULL,</code></li>
<li><code>`quantity` int(10) NOT NULL default '0',</code></li>
<li><code>`price` float NOT NULL,</code></li>
<li><code>PRIMARY KEY  (`id`)</code></li>
<li><code>) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;</code></li>
</ol>
<p>This code has yet to be put to the test in a production environment, so use it entirely at your own risk. You will also notice that the checkout function has not been completed. This is a project for another day, and it&#8217;s worth looking at the CodeIgniter PayPal library <a href="http://codeigniter.com/wiki/PayPal_Lib/">http://codeigniter.com/wiki/PayPal_Lib/</a> to help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2009/06/09/shopping-cart-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Caffeine Level for Today</title>
		<link>http://www.roaringmoon.com/blog/2009/05/19/my-caffeine-level-for-today/</link>
		<comments>http://www.roaringmoon.com/blog/2009/05/19/my-caffeine-level-for-today/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:17:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.roaringmoon.com/blog/?p=39</guid>
		<description><![CDATA[LJRICH posted a cool link on Twitter that tells you how caffeinated you are. 153 clicks in 30 seconds earned me the rating of &#8220;Very High &#8211; Productive Worker, Jittery&#8221;. Bear in mind that this is not an entirely scientific test, but I do drink PG Tips by the gallon. Created by OnePlusYou &#8211; Free [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/LJRICH">LJRICH</a> posted a cool link on Twitter that tells you how caffeinated you are. 153 clicks in 30 seconds earned me the rating of &#8220;Very High &#8211; Productive Worker, Jittery&#8221;. Bear in mind that this is not an entirely scientific test, but I do drink PG Tips by the gallon. <img src='http://www.roaringmoon.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://www.oneplusyou.com/q/v/caffeine"><img src="http://www.oneplusyou.com/q/img/badges/caffeine_very_high__productive_worker_jittery.jpg" border="0" alt="The Caffeine Click Test - How Caffeinated Are You?" /></a><br />
Created by OnePlusYou &#8211; <a href="http://www.oneplusyou.com">Free Online Dating</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roaringmoon.com/blog/2009/05/19/my-caffeine-level-for-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
