<?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>CoffeePowered &#187; Development</title>
	<atom:link href="http://coffeepowered.co.uk/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeepowered.co.uk</link>
	<description>The online ramblings of Paul Stanton</description>
	<lastBuildDate>Wed, 30 Jun 2010 19:46:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using PHP&#8217;s alternate syntaxes</title>
		<link>http://coffeepowered.co.uk/2010/01/using-phps-alternate-syntaxes-to-aid-code-readability/</link>
		<comments>http://coffeepowered.co.uk/2010/01/using-phps-alternate-syntaxes-to-aid-code-readability/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 08:00:57 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[control structures]]></category>
		<category><![CDATA[elseif]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/?p=348</guid>
		<description><![CDATA[If you&#8217;ve ever worked with PHP you&#8217;ll be more than familiar with the use of if/elseif/else conditional statements, these statements often become large and unweildy, especially when HTML is mixed in with PHP, causing a problems with code readability. There are a couple of alternate ways to write these statements which can improve your code. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever worked with PHP you&#8217;ll be more than familiar with the use of if/elseif/else conditional statements, these statements often become large and unweildy, especially when HTML is mixed in with PHP, causing a problems with code readability. There are a couple of alternate ways to write these statements which can improve your code.</p>
<h3>if..endif syntax</h3>
<p>We&#8217;ll start with a simple example of a &#8216;regular&#8217; statement which includes a foreach and an if statement which is extremely common among PHP scripts.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array_expression</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$expression1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Result1'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Result2'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>Now, just for funzies, let&#8217;s make this a tiny bit more complex and mix in some HTML markup in there for good measure, just like you&#8217;d see in, say, a WordPress template where we&#8217;re jumping back and forth between HTML and PHP mode.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array_expression</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$expression1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;Result1&lt;/p&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> &nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;Result2&lt;/p&gt; <br />
<span style="color: #000000; font-weight: bold;">&lt;?</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>See the closing braces on lines 9 &#038; 10? With a relatively small example like this you can scan back through the code to see wether they close the if or the elseif. Now imagine a much larger statement, the only way to find out what the closing brace actually closes is to either pay attention to the tab levels (providing the tab levels have been maintained properly), or to read back through the whole statement and match them up. There is an alternate syntax which makes life a little easier. </p>
<h4>Alternate syntax</h4>
<p>By using the alternate if..elseif syntax we can replace those closing braces with something a little more useful.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array_expression</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$expression1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;Result1&lt;/p&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> &nbsp;<span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;Result2&lt;/p&gt; <br />
<span style="color: #000000; font-weight: bold;">&lt;?</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>This alternate syntax is expecially useful when mixing PHP and HTML and works for <strong>if/while/for</strong> control structures.</p>
<h3>Ternary operator</h3>
<p>For simple evaluations you can use the ternary operator which is a slimline version of an if/else statement, for example, the following statement which pluralises a string based on an integer variable.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">==</span> 1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'comment'</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'comments'</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$comments</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h4>Alternate syntax</h4>
<p>Using the ternary operator this can be condensed to a single line:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'comment'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'comments'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$comments</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h3>Have a try!</h3>
<p>By learning and adopting these alternate syntaxes you will ensure that your code remains readable and maintainable, especially if you&#8217;re writing code to be used by other people. Give them a try!</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2010/01/using-phps-alternate-syntaxes-to-aid-code-readability/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick and dirty dropdown pagination in CakePHP</title>
		<link>http://coffeepowered.co.uk/2009/10/quick-and-dirty-dropdown-pagination-in-cakephp/</link>
		<comments>http://coffeepowered.co.uk/2009/10/quick-and-dirty-dropdown-pagination-in-cakephp/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 08:49:46 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[homeofmuppets]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[moblog]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=147</guid>
		<description><![CDATA[I&#8217;ve been slowly rebuilding my Moblog application using the CakePHP framework over the past year when I have the time and motivation. Over the past few evenings I&#8217;ve been refining a small element of my Moblog site which has started to dramatically increase user interaction with the site and allow old content to bubble back [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been slowly rebuilding my <a href="http://homeofmuppets.com/moblogs">Moblog</a> application using the CakePHP framework over the past year when I have the time and motivation. Over the past few evenings I&#8217;ve been refining a small element of my Moblog site which has started to dramatically increase user interaction with the site and allow old content to bubble back up to the top.</p>
<p>The Cake <a href="http://book.cakephp.org/view/656/Methods">paginator helper</a> works fine if you&#8217;re using basic anchor links to trigger sort options, but I wanted to use a dropdown select element so that the user can choose how to order the moblogs.</p>
<p>So I know this is most likely a horrible solution to the problem and certainly not very &#8216;cakey&#8217;, but it&#8217;s quick, dirty, and it works for what I need it to do.</p>
<p>In the view we need a valid form element, even though the javascript hijacks the onChange event and doesn&#8217;t actually post the result. At the moment this does mean that this doesn&#8217;t work without javascript but I plan on improving this soon by only using $paginator->sort links in the view, and replacing them with the form completely in javascript.</p>
<p>in the view:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?=</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Moblog'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'index'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'controller'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'moblogs'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'get'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'div'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?=</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">input</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'order'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'sort:'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'modified'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'recent activity'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'date added'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'commented'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'last commented'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'moblog_comment_count'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'most commented'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'rand()'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'random'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'selected'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'div'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">end</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'go'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>In the jQuery we take whichever value was selected on change, build the relevant &#8216;paginator compatible&#8217; url which the helper will use to return the required data on page load and then redirect the browser.</p>
<p>jQuery:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#MoblogOrder'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/moblogs/index'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#MoblogOrder option:selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'modified'</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'/page:1/sort:modified/direction:desc/'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'id'</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'/page:1/sort:id/direction:desc/'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'commented'</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'/page:1/sort:commented/direction:desc/'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'moblog_comment_count'</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'/page:1/sort:moblog_comment_count/direction:desc/'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'rand()'</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'/page:1/order:rand()/'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">default</span> <span style="color: #339933;">:</span> url <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'/page:1/sort:modified/direction:desc/'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; window.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> url<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>In this particular example, I&#8217;m using a random order also, which needs to be an &#8216;order&#8217; param instead of a &#8216;sort&#8217;, so in the controller I&#8217;m checking which params are being used, and setting a consistant order variable which is used in the view to maintain the selected state of the select element.</p>
<p>in the index method in the controller</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> index<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'named'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sort'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'named'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sort'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'named'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'named'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'modified'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>If any Cake ninjas are reading this and have any suggestions, or better methods, please do leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2009/10/quick-and-dirty-dropdown-pagination-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deliciously Timed Tweets</title>
		<link>http://coffeepowered.co.uk/2009/09/deliciously-timed-tweets/</link>
		<comments>http://coffeepowered.co.uk/2009/09/deliciously-timed-tweets/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 09:52:02 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=132</guid>
		<description><![CDATA[What is it? Deliciously Timed Tweets (or DTT for short) is a collection of API&#8217;s which allow you to bookmark links in Delicious, and then automatically tweet them at a specified time interval. What&#8217;s the point? Delicious does already allow you to tweet your bookmarked links, the only problem is that this can result in [...]]]></description>
			<content:encoded><![CDATA[<h3>What is it?</h3>
<p>Deliciously Timed Tweets (or DTT for short) is a collection of API&#8217;s which allow you to bookmark links in <a href="http://delicious.com">Delicious</a>, and then automatically tweet them at a specified time interval.</p>
<h3>What&#8217;s the point?</h3>
<p>Delicious does already allow you to tweet your bookmarked links, the only problem is that this can result in Twitter spam if you bookmark lots of links in quick succession. DTT queues up your recent bookmarks, and allows you to specify a rate (say, every 60 minutes) for them to be tweeted at.</p>
<p>DTT powers the <a href="http://twitter.com/boaglinks">@boaglinks</a> twitter feed.</p>
<h3>What do I need?</h3>
<ul>
<li>PHP 4+ with cURL support</li>
<li>MySQL</li>
<li>Access to <a id="Requirements" href="http://en.wikipedia.org/wiki/Cron">cron</a></li>
<li>A <a rel="nofollow" href="http://del.icio.us/">Delicious</a> account and some bookmarks.</li>
</ul>
<h3>How do I get it?</h3>
<p><strong>Git :</strong> git clone http://coffeepowered.co.uk/labs/dtt/.git</p>
<p><strong>Zip :</strong> <a href="http://coffeepowered.co.uk/labs/dtt/dtt.zip">http://coffeepowered.co.uk/labs/dtt/dtt.zip</a></p>
<p><strong>Tar :</strong> <a href="http://coffeepowered.co.uk/labs/dtt/dtt.tar">http://coffeepowered.co.uk/labs/dtt/dtt.tar</a></p>
<h3>How do I install it?</h3>
<ol>
<li>Grab the source from any of the locations above and extract/upload it to a location on your own server</li>
<li>Modify config.php with your own details</li>
<li>CHMOD install.php to 755</li>
<li>Visit the install.php file in your browser (http://yoursite.com/path/to/file/install.php)</li>
</ol>
<p>The default setting is for DTT to sync with delicious every hour, and new bookmarks will be tweeted out at a an rate of 1 per hour.</p>
<h3>Support?</h3>
<p>Officially, this is provided &#8220;as is&#8221; and is an unsupported script, however I&#8217;ll endeavour to provide support for anyone who does have problems but I can&#8217;t promise anything!</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2009/09/deliciously-timed-tweets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printable logos</title>
		<link>http://coffeepowered.co.uk/2009/08/printable-logos/</link>
		<comments>http://coffeepowered.co.uk/2009/08/printable-logos/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 18:33:57 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips and tricks]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=50</guid>
		<description><![CDATA[This is one of those tips where I think &#8220;surely everyone knows this already?&#8221; but it&#8217;s a solution to a problem that I found which was quite neat and I&#8217;ll use all the time from now on. When it comes to embedding a company logo into a page, quite often the logo won&#8217;t be suitable [...]]]></description>
			<content:encoded><![CDATA[<p>This is one of those tips where I think &#8220;surely everyone knows this already?&#8221; but it&#8217;s a solution to a problem that I found which was quite neat and I&#8217;ll use all the time from now on.</p>
<p>When it comes to embedding a company logo into a page, quite often the logo won&#8217;t be suitable for print. For example, the website may be dark and the logo might be light and while this works fine when the site is viewed on-screen, it can look out of place when used in a print stylesheet or if the site is viewed with CSS disabled.</p>
<p>While building the new University of Leeds corporate website we got to the stage where we needed to build our print stylesheet, the page header has a white logo on a dark background.</p>
<p>Originally, the logo was inserted into the design using a standard CSS image-replacement technique:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.leeds.ac.uk&quot;</span>&gt;</span>University of Leeds<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#logo</span> a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">logo_black.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">53px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">184px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<div id="attachment_59" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-59" title="University of Leeds header" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/University-of-Leeds_1249982729324.png" alt="Light logo on dark header" width="500" height="272" /><p class="wp-caption-text">Light logo on dark header</p></div>
<p>When you&#8217;re using a CSS image replacement, the image doesn&#8217;t exist in the markup, it&#8217;s applied as a background image and only the h2 text is displayed. We toyed with the idea of using the same image replacement technique in our print.css, replacing the logo with the black-on-white variant. This quickly fell on it&#8217;s arse, as most browsers are set by default to not print background images as seen below.</p>
<div id="attachment_72" class="wp-caption aligncenter" style="width: 209px"><img class="size-full wp-image-72" title="University of Leeds - no logo - no css" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/universityofleeds_nologo_nocss.png" alt="Image replacement with CSS disabled" width="199" height="319" /><p class="wp-caption-text">Image replacement with CSS disabled</p></div>
<h3>Putting the image back into the markup</h3>
<p>In order to get around this, we decided to stop using image replacement and go back to having the image in the markup. Initially I was curious as to the effect of this from an SEO standpoint and had a quick chat with an <a href="http://thehodge.co.uk">SEO friend</a> about the disadvantage of not having our corporate logo as a heading. He pointed out that there would be no disadvantage to us as we&#8217;re not trying to rank on the &#8216;University of Leeds&#8217; as a keyword and that as it&#8217;s mentioned everywhere else in the thousands of pages we manage, it&#8217;s not going to make a difference. (Your mileage may vary and this might not be suitable for everyone)</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo_black.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;University of Leeds logo&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<h3>Doing it bass-ackwards</h3>
<p>Once we&#8217;d put the image back into the markup, it showed up as expected in our print stylesheet, however our white-on-black logo wasn&#8217;t really suited.</p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 209px"><img class="size-full wp-image-63" title="University of Leeds - CSS disabled" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/universityofleeds_dark_nocss1.png" alt="Same logo with CSS disabled" width="199" height="320" /><p class="wp-caption-text">Same logo with CSS disabled</p></div>
<p>We already knew that we couldn&#8217;t use CSS to replace this with the black-on-white logo in our print.css, so we decided to do it the other way round. Rather than the have the white-on-black logo as default, we changed to having the black-on white as the default meaning that our no-css and print.css got the correct logo. We used a &#8220;hidden&#8221; class so we could hide the default image and a CSS overlay on the anchor tag to bring back our white-on-black logo to fit in with the rest of the design.</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.leeds.ac.uk&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo_white.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;University of Leeds logo&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#logo</span> a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">logo_black.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
.<span style="color: #993333;">hidden</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<div id="attachment_59" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-59" title="University of Leeds header" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/University-of-Leeds_1249982729324.png" alt="Light logo on dark header" width="500" height="272" /><p class="wp-caption-text">CSS enabled</p></div>
<div id="attachment_61" class="wp-caption aligncenter" style="width: 209px"><img class="size-full wp-image-61" title="University of Leeds - No CSS" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/universityofleeds_nocss.png" alt="Black on white logo" width="199" height="320" /><p class="wp-caption-text">CSS disabled / print stylesheet</p></div>
<h3>Conclusion</h3>
<p>Because most browsers disable background images when printing by default, you need to be aware that any important images that are using image-replacement techniques may not work. Working around these limitations is possible with a bit of planning.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2009/08/printable-logos/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Meaningful milestones</title>
		<link>http://coffeepowered.co.uk/2009/08/meaningful-milestones/</link>
		<comments>http://coffeepowered.co.uk/2009/08/meaningful-milestones/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 08:13:36 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[project management]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=16</guid>
		<description><![CDATA[For the past 12 months I&#8217;ve been working exclusively on the same project, if you follow me on Twitter (and if you don&#8217;t, you really should) you might have heard me refer to it as Überproject as it&#8217;s without doubt the biggest project I&#8217;ve ever been involved with in my career so far. It&#8217;s handover [...]]]></description>
			<content:encoded><![CDATA[<p>For the past 12 months I&#8217;ve been working exclusively on the same project, if you <a href="http://twitter.com/stanton" target="_blank">follow me on Twitter</a> (and if you don&#8217;t, you really should) you might have heard me refer to it as <em>Überproject</em> as it&#8217;s without doubt the biggest project I&#8217;ve ever been involved with in my career so far.</p>
<p>It&#8217;s handover time for Überproject and as we&#8217;re wrapping up our development I&#8217;ve been taking stock of the last 12 months and thinking along the lines of &#8220;If we had to do this all over again, what would we do differently?&#8221; aka &#8220;What gave us grief, and how can we avoid doing it again&#8221;.</p>
<h3>Meaningful milestones</h3>
<p>One particular aspect of Überproject was a large section of bespoke functionality which was, in effect, a project within a project which I&#8217;ll refer to as #up1 for the purposes of this blog (It&#8217;s not gone public yet, so I can&#8217;t name it specifically).</p>
<p>Early on, we attached two milestones to key stages in the project, a <strong>testing</strong> milestone, and a <strong>go-live</strong> milestone.</p>
<p>The <strong>testing</strong> milestone was defined as a date when functionality was to be delivered to our development environment ready to be put through it&#8217;s paces where any bugs would be logged as tickets in <a href="http://trac.edgewall.org/">Trac</a> (our project management / source control platform) and we would then work through any outstanding tickets before the <strong>go-live</strong> milestone date.</p>
<p>#up1 was given milestones consistent with the rest of the project with a couple of months between testing and go-live, the development of the back end was going well and the front end development would be taken care of later with the rest of the front-end build (which had it&#8217;s own milestone).</p>
<p>About a week before the testing milestone was due for #up1 I was hit with a bombshell. The definition of &#8216;testing&#8217; in this instance meant that the back-end had to be fully functional and production-ready for the end-users to start populating the module with data. This meant that the back-end should have entered testing weeks ago and had bugs ironed out before the end-users ever got close. The back-end needed be go-live ready.</p>
<p>Fortunately, a week&#8217;s worth of frantic coding meant that I got #up1 fully functional before the users were allowed in and this was only done on a limited basis, users were aware that we were still in development and we turned the situation to our favour by deputizing them as bug testers by asking for and encouraging feedback.</p>
<h3>The moral of the story?</h3>
<p>Going forward, we will need to be absolutely clear of what&#8217;s expected to be delivered at each milestone and avoiding vague terms like &#8216;testing&#8217;, as we&#8217;ve seen, the definition of testing can vary wildly between different aspects of the same project.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2009/08/meaningful-milestones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
