<?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>code and effect &#187; php</title>
	<atom:link href="http://codeandeffect.co.uk/blog/category/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeandeffect.co.uk/blog</link>
	<description>@AM_Doherty</description>
	<lastBuildDate>Fri, 03 Feb 2012 15:01:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Final thoughts on PHP North West 2011</title>
		<link>http://codeandeffect.co.uk/blog/2011/programming/php/final-thoughts-on-php-north-west-2011/</link>
		<comments>http://codeandeffect.co.uk/blog/2011/programming/php/final-thoughts-on-php-north-west-2011/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 16:01:16 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[phpnw]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=822</guid>
		<description><![CDATA[Sunday&#8217;s track choices My second day at the PHP North West Conference 2011 kicked off with Paul Lemon&#8217;s &#8216;Feeling Secure?&#8217; talk. Paul used succinct code samples and made a point of covering the basic attack methods, assuming no great depth &#8230; <a href="http://codeandeffect.co.uk/blog/2011/programming/php/final-thoughts-on-php-north-west-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3><a href="http://conference.phpnw.org.uk/phpnw11/"><img class="alignright" style="border: 1px solid #c0c0c0; background-color: #000000; padding: 10px; margin-bottom: 10px; margin-left: 10px;" title="PHP NW 2011 information" src="http://conference.phpnw.org.uk/phpnw11/files/2011/05/phpnw11_details_140x1001.png" alt="PHP NW 2011 information" width="140" height="100" /></a>Sunday&#8217;s track choices</h3>
<p>My second day at the PHP North West Conference 2011 kicked off with <a href="http://conference.phpnw.org.uk/phpnw11/schedule/paul-lemon/" target="_blank">Paul Lemon&#8217;s</a> &#8216;Feeling Secure?&#8217; talk.</p>
<p>Paul used succinct code samples and made a point of covering the basic attack methods, assuming no great depth of knowledge for some and the need to re-iterate its importance to the rest of us. For each attack type, variant methods were demonstrated that perhaps would have been unfamiliar to some &#8211; this was certainly borne out during the Q&amp;A session. Paul had far more topics to cover and hopefully there&#8217;ll be an extended security presentation at a future conference.</p>
<p>Following this I attended <a href="http://conference.phpnw.org.uk/phpnw11/schedule/walter-ebert/" target="_blank">Walter Ebert</a>&#8216;s talk on URL design. Walter had gone to some trouble to locate examples of good practice in human-readable, RESTful web addressing as well as some neat workarounds for common problems &#8211; for example url handling routines for those long descriptive links that email clients break when they wrap text.</p>
<p>Finally I listened to <a href="http://conference.phpnw.org.uk/phpnw11/schedule/richard-backhouse/" target="_blank">Richard Backhouse</a> talk about compiling PHP to .NET using open source tool <a title="Phalanger open source PHP-.Net Compiler" href="http://www.php-compiler.net/" target="_blank">Phalanger</a>. Richard covered  the background to his company&#8217;s adoption of the approach, client considerations, use cases and opportunities for mixing languages &amp; libraries for a best-of-both approach.</p>
<h3>Take Away</h3>
<p>I tend to take away both strong themes and important (though sometimes small) messages from conferences that stick with me, influencing the design decisions and  production routes on current and future projects. They&#8217;re not always from a favourite or most enjoyable presentation, but they highlight the event&#8217;s greater whole.</p>
<p><a title="@elblinkin" href="http://twitter.com/#!/elblinkin" target="_blank">Laura Beth Denker</a>&#8216;s Saturday track 1 talk emphasised the need to retain practicality and perspective in software production (in particular, testing). Yes we have the tools, but are we using them effectively, are we curtailing our own faculties in favour automated methods, do we put enough trust in our collaborators?</p>
<p>The major frameworks has a strong showing, but Alistair Stead and Paul Lemon provided timely reminders of those areas that still require careful thought and action &#8211; response times, the right caching techniques regardless of chosen technology, the importance of validation and knoweldge of protocols and security basics.</p>
<p>Finally, <a title="@ianbarber" href="http://twitter.com/#!/ianbarber" target="_blank">Ian Barber</a>&#8216;s keynote brings all this together &#8211; the tools exist to allow you to contribute to great developments and create new ones. Use the right tools for right purpose and keep a keen eye on what&#8217;s around you &#8211; in programming, and in the wider world.</p>
<p>PHPNW11 was all about (as <a title="elblinkin" href="http://twitter.com/#!/elblinkin" target="_blank">@Elblinkin</a> put it)  &#8216;Keyboard, mouse and You&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2011/programming/php/final-thoughts-on-php-north-west-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saturday at PHP North West 2011</title>
		<link>http://codeandeffect.co.uk/blog/2011/programming/php/saturday-at-php-north-west-2011/</link>
		<comments>http://codeandeffect.co.uk/blog/2011/programming/php/saturday-at-php-north-west-2011/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 07:18:53 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[php phpnw]]></category>
		<category><![CDATA[Symfony2]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=799</guid>
		<description><![CDATA[The PHP North West conference gets bigger and better every year, and 2011 sees the Saturday and Sunday conference enlived by a Friday tutorial day and an unconference running alongside the scheduled tracks. Saturday morning kicked off with keynote speaker &#8230; <a href="http://codeandeffect.co.uk/blog/2011/programming/php/saturday-at-php-north-west-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The PHP North West conference gets bigger and better every year, and 2011 sees the Saturday and Sunday conference enlived by a Friday tutorial day and an <em>unconference</em> running alongside the scheduled tracks.</p>
<p>Saturday morning kicked off with keynote speaker <a href="http://conference.phpnw.org.uk/phpnw11/schedule/ian-barber/">Ian Barber</a>&#8216;s revealing tour of the small steps that made great software even better, and the ways that diverse personal interests, hobbies and a willingness to ignore conventional wisdom led to innovations that we in turn can build upon and contribute to.<br />
Having a broad range of work and hobby interests, I could only agree with Ian on his belief in cross-fertilisation of ideas and approaches, and it was good to be reminded that being interested and aware is often more effective than aiming high.</p>
<p>Starting off Track 1, <a href="http://conference.phpnw.org.uk/phpnw11/schedule/enrico-zimuel/">Enrico Zimuel</a> introduced the new features and architecture of Zend Framework 2 followed by <a href="http://conference.phpnw.org.uk/phpnw11/schedule/sebastian-bergmann/">Sebastian Bergmann</a>&#8216;s  talk on PHP Testing tools. Sebastian compared the various approaches and features of the most ubiquitous and newly released tools including his own project <em>PHPUnit</em> , the <em>Atoum</em> framework and the behaviour / scenario driven <em>BeHat</em>.</p>
<p>In the afternoon I attended <a href="http://conference.phpnw.org.uk/phpnw11/schedule/alistair-stead/">Alistair Stead</a>&#8216;s track 2 talk about the <em>Varnish</em> reverse proxy cache. In addition to presenting Varnish&#8217;s impressive capabilities, Alistair examined the pitfalls of adding multiple cache layers, configuration gotchas, as well as privacy and security concerns in good depth.</p>
<p>Track 2 continued with <a href="http://conference.phpnw.org.uk/phpnw11/schedule/stefan-koopmanschap/">Stefan Koopmanschap</a>&#8216;s introduction to the recently released <em>Symfony2</em> framework. For those of us with experience of prior releases, <em>Symfony2</em> appears to differ significantly and will take some getting used to. The <em>Bundles</em> approach follows the components theme running through the conference this year.</p>
<p>The final talk in track 1 was <a href="http://conference.phpnw.org.uk/phpnw11/schedule/laura-beth-denker/">Laura Beth Denker</a>&#8216;s &#8216;Are your tests really helping?&#8217;. After informing the crowd that her company pushed code every 20 minutes or so, you would have expected a breakdown of intensive automated test routines, but what was presented was a practical approach involving well organised unit testing; having faith in fellow developers and trust in the external services (and if you don&#8217;t have faith or trust, you should probably replace both) in order to reduce the need for extensive integration and functional testing.</p>
<p><a href="http://conference.phpnw.org.uk/phpnw11/schedule/">PHPNW11</a> continues today, Sunday 9th October. Feedback for talks can be read and provided on <a title="PHPNW11 on JoindIn" href="http://joind.in/event/view/677">JoindIn</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2011/programming/php/saturday-at-php-north-west-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mixing Object and Form Helpers in Symfony</title>
		<link>http://codeandeffect.co.uk/blog/2008/programming/symfony-object-form-helpers/</link>
		<comments>http://codeandeffect.co.uk/blog/2008/programming/symfony-object-form-helpers/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 08:00:17 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Web Computing]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=285</guid>
		<description><![CDATA[Being new to Symfony I&#8217;m still getting my head around some of its paradigms. Two months with the manual before embarking on any development taught me that it was worth pursuing, but there&#8217;re always areas you need to see working. &#8230; <a href="http://codeandeffect.co.uk/blog/2008/programming/symfony-object-form-helpers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Being new to Symfony I&#8217;m still getting my head around some of its paradigms. Two months with the manual before embarking on any development taught me that it was worth pursuing, but there&#8217;re always areas you need to <em>see </em>working.</p>
<p>The Object form helpers looked particularly useful, so for my first production development I aim to use them wherever possible. These helpers allow you edit objects directly, simplifying the update process back in your actions.</p>
<p>sample form in <em>editformSuccess.php</em> template:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php echo form_tag('editform/updatetitle'); ?&amp;gt;<br />
&amp;lt;?php echo object_input_hidden_tag($newsletter, 'getID') ;?&amp;gt;<br />
Title: &amp;lt;?php echo object_input_tag($newsletter, 'getTitle') ;?&amp;gt;<br />
&amp;lt;?php echo submit_tag('update'); ?&amp;gt;</div></div>
<p>and in <em>actions.class.php</em>:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php<br />
public function executeEditform($request)<br />
{<br />
$this-&amp;gt;newsletter = &nbsp;&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
NewsletterPeer::retrieveByPk($request-&amp;gt;getParameter('id'));<br />
$this-&amp;gt;forward404Unless($this-&amp;gt;newsletter);<br />
}<br />
&lt;br /&gt;<br />
public function executeUpdatetitle($request)<br />
{<br />
$nltoupdate = NewsletterPeer::retrieveByPk($request-&amp;gt;getParameter('id'));<br />
$this-&amp;gt;forward404Unless($nltoupdate );<br />
$nltoupdate-&amp;gt;fromArray(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
$this-&amp;gt;getRequest()-&amp;gt;getParameterHolder()-&amp;gt;getAll(),BasePeer::TYPE_FIELDNAME);<br />
$nltoupdate-&amp;gt;save();<br />
return $this-&amp;gt;redirect(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
'newsletters/view?id='.$request-&amp;gt;getParameter('id'));<br />
}</div></div>
<p>The update code uses the <em>fromArray </em>method to update any properties of your object it holds data for, received from your form. Adding fields to your form doesn&#8217;t require changes to the action.</p>
<p>I got into difficulties when it came to setting a boolean field for my object, called &#8220;IsPublished&#8221;. Wishing to stick with the Object form helpers I investigated the <a title="ObjectHelper::object_select_tag()" href="http://www.symfony-project.org/api/1_1/ObjectHelper#method_object_select_tag">Object_select_tag</a>, however this has a different use altogether &#8211; allowing you to grab properties of other objects to match with your current object. The classic example being choosing an <em>author </em>from the <em>authors </em>object to match up to a <em>post </em>object.</p>
<p>I still wanted to save a property for my object, but I didn&#8217;t want to have it select from the object, or grab values from other objects. Further searches revealed I wasn&#8217;t alone in wondering how to set default selected values and generally get to grips with <em>object_select_tag</em>.</p>
<p>Mixing Object and Form helpers seemed the best solution, using <a title="FormHelper::select_tag()" href="http://www.symfony-project.org/api/1_1/FormHelper#method_select_tag">select_tag</a> for my boolean field. However this meant I wasn&#8217;t using the Object helper exclusively, so would it still work with <em>fromArray</em>?</p>
<p>The form code generated looked promisingly simple, so I tried a mix of <a title="ObjectHelper::object_input_tag()" href="http://http://www.symfony-project.org/api/1_1/ObjectHelper#method_object_input_tag">object_input_tag</a> and <em>select_tag</em> in my <em>editformSuccess.php</em> template:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php<br />
$defaultOption = &nbsp;&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
$newsletter-&amp;gt;getIsPublished() == 1?1:0; &lt;span style=&quot;color: #99cc00;&quot;&gt;# get current, set default&lt;/span&gt;<br />
echo select_tag('&lt;span style=&quot;color:red;&quot;&gt;in_published&lt;/span&gt;', options_for_select(array(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
0, 1),<br />
$defaultOption));<br />
?&amp;gt;</div></div>
<p>Note the highlighted property in <em>select_tag</em>. My Object Property is called &#8220;IsPublished&#8221;. To object-generate a plain text input field I&#8217;d have used:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php<br />
Published: &amp;lt;?php echo object_input_tag($newsletter, 'getIsPublished') ;<br />
?&amp;gt;</div></div>
<p>So my current field value would be retrieved, and the Object helper generates form fields using <em>BasePeer::TYPE_FIELDNAME</em> which in turn is used in my <em>fromArray </em>method to update the Db.</p>
<p>Normally one would use <em>select_tag</em> with internal field names (<em>BasePeer:: TYPE:PHP_NAME</em>) and write more action code to marry them up before a save(), however here I have to add my database field name into my view code.</p>
<p>Tethering your templates to your database schema is a route no-one should go down. So the internal name should be converted to the Db name on-the-fly in your template. The Peer classes have a function for this, and its public. The following call converts your usual internal field name for you, ready to drop into your <em>select_tag</em>:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php<br />
$IsPublished_translated = BaseNewsletterPeer::translateFieldName(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;'IsPublished',BasePeer::TYPE_PHPNAME, BasePeer::TYPE_FIELDNAME )<br />
?&amp;gt;</div></div>
<p>You could assign this in your action, but it works just as well in the template:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php<br />
echo select_tag(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
'&lt;span style=&quot;color:red;&quot;&gt;BaseNewsletterPeer::translateFieldName(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
'IsPublished',BasePeer::TYPE_PHPNAME, BasePeer::TYPE_FIELDNAME&lt;/span&gt;',&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
&nbsp;options_for_select(array(&lt;span style=&quot;color: #99cc00;&quot;&gt;Â»&lt;/span&gt;<br />
0, 1),<br />
$defaultOption));<br />
?&amp;gt;</div></div>
<p>A final step would be to migrate this into a function higher up that so as to make templates a little prettier when editing.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2008/programming/symfony-object-form-helpers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First spam attempt on Drag n&#8217; Drop captcha</title>
		<link>http://codeandeffect.co.uk/blog/2008/programming/php/dande_first-spam-attempt/</link>
		<comments>http://codeandeffect.co.uk/blog/2008/programming/php/dande_first-spam-attempt/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 08:52:54 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=241</guid>
		<description><![CDATA[As its still in development, I&#8217;ve set the drag n&#8217; drop captcha mechanism to report failures in full as well as forwarding legitimate responses. I&#8217;ve had the first (update: two now) such failure notice from a live installation today &#8211; &#8230; <a href="http://codeandeffect.co.uk/blog/2008/programming/php/dande_first-spam-attempt/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As its still in development, I&#8217;ve set the drag n&#8217; drop captcha mechanism to report failures in full as well as forwarding legitimate responses.<br />
I&#8217;ve had the first (<span style="color: #008000;">update:</span> two now) such failure notice from a live installation today &#8211; subject line: &#8216;yGAQJUnxHNOw&#8217; and just a few web addresses I won&#8217;t repeat here.</p>
<p>Positive so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2008/programming/php/dande_first-spam-attempt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag n&#8217; Drop captcha updated</title>
		<link>http://codeandeffect.co.uk/blog/2008/programming/php/dragndrop-captcha_updated/</link>
		<comments>http://codeandeffect.co.uk/blog/2008/programming/php/dragndrop-captcha_updated/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 12:19:46 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[captcha]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=238</guid>
		<description><![CDATA[I finally have this released into production environments which will no doubt help me to improve it. There&#8217;ve been some updates to the mechanism to dissociate image filenames from the puzzle fields. Next I need to make the names more &#8230; <a href="http://codeandeffect.co.uk/blog/2008/programming/php/dragndrop-captcha_updated/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I finally have this released into production environments which will no doubt help me to improve it. There&#8217;ve been some updates to the mechanism to dissociate image filenames from the puzzle fields.</p>
<p>Next I need to make the names more variable, and perhaps cache them and generate random permutations. Accessibility remains a concern.</p>
<p><a title="Drag and Drop Captcha" href="http://www.codeandeffect.co.uk/blog/2006/programming/php/dragndrop-captcha/">dragndrop-captcha</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2008/programming/php/dragndrop-captcha_updated/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Post Index for WordPress</title>
		<link>http://codeandeffect.co.uk/blog/2006/programming/php/post-index-for-wordpress/</link>
		<comments>http://codeandeffect.co.uk/blog/2006/programming/php/post-index-for-wordpress/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 15:49:19 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=70</guid>
		<description><![CDATA[My first WordPress Plugin. I couldn&#8217;t find anything that would get me the index of the current displayed post, so this does the job: userpostindex_v1 Once in The Loop, it counts the current author&#8217;s other, older posts to arrive at &#8230; <a href="http://codeandeffect.co.uk/blog/2006/programming/php/post-index-for-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img align="right" style="padding: 0px 0px 0px 5px" id="image69" alt="no.229" src="http://www.codeandeffect.co.uk/blog/wp-content/uploads/2006/12/ala229.gif" />My first <a target="_blank" href="http://www.wordpress.org">WordPress</a> Plugin.</p>
<p>I couldn&#8217;t find anything that would get me the index of the current displayed post, so this does the job:</p>
<p><strong><a title="User Post Index WordPress Plugin" target="_blank" href="http://www.codeandeffect.co.uk/wordpressplugins/codeandeffect_userpostindex_v1.rar">userpostindex_v1</a></strong></p>
<p>Once in <em>The Loop</em>, it counts the current author&#8217;s other, older posts to arrive at the index for the current post, ignoring private posts, attachments and the like.</p>
<p>My own implementation is only in text for now, the idea ccoming from the more stylish treatment of the edition number flash on <a target="_blank" href="http://alistapart.com/">AListApart</a>&#8216;s homepage.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2006/programming/php/post-index-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2006/12/ala229.gif" length="1533" type="image/jpg" />	</item>
		<item>
		<title>MVC nesting</title>
		<link>http://codeandeffect.co.uk/blog/2006/programming/php/mvc-nesting/</link>
		<comments>http://codeandeffect.co.uk/blog/2006/programming/php/mvc-nesting/#comments</comments>
		<pubDate>Mon, 13 Nov 2006 11:35:53 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=51</guid>
		<description><![CDATA[Coursework for the MSc has been going at varying speeds for a week now. I lost sleep earlier on when trying fine tune the MVC setup (no Cake here). Then things sped up nicely over the weekend when I began &#8230; <a href="http://codeandeffect.co.uk/blog/2006/programming/php/mvc-nesting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Coursework for the MSc has been going at varying speeds for a week now. I lost sleep earlier on when trying fine tune the <a href="http://www.phppatterns.com/docs/design/mvc_pattern_version_2">MVC</a> setup (no <a title="The Cake PHP project" href="http://cakephp.org/">Cake</a> here). Then things sped up nicely over the weekend when I began happily juggling tabled views around.</p>
<p>Then I thought it might be nice to display the user&#8217;s basket on all relevant pages, as a courtesy. This was easier than I&#8217;d thought. I simply add a new <em>MVC</em> and merge it&#8217;s results.</p>
<p>I have a master array of values matching each area of my template, I <a href="http://uk.php.net/manual/en/function.array-merge.php">array_merge</a> it with that which I receive from <em>View</em> to populate the page. If a user is logged in, a new step merges the user info <em>MVC</em> set with the main View prior to overwriting the defaults. This handles and returns all their account/basket details neatly into a sidebar, all without breaking the rules or setting up problems for later.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2006/programming/php/mvc-nesting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag n&#8217; Drop CAPTCHA puzzle</title>
		<link>http://codeandeffect.co.uk/blog/2006/programming/php/dragndrop-captcha/</link>
		<comments>http://codeandeffect.co.uk/blog/2006/programming/php/dragndrop-captcha/#comments</comments>
		<pubDate>Fri, 08 Sep 2006 13:33:09 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=28</guid>
		<description><![CDATA[Simply re-arrange the images to make a visible key before clicking submit. Fiddling with Scriptaculous earlier today I had an idea for a CAPTCHA mechanism. Cycling through the $_POST array in PHP gives you the form data, in order of &#8230; <a href="http://codeandeffect.co.uk/blog/2006/programming/php/dragndrop-captcha/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="border: 0px solid #c0c0c0; padding: 0pt 0px 10px 5px; float: right; width: 218px"><a href="/tests/draganddropcaptcha/"><img id="image30" style="border: 0px none " alt="Drag n Drop CAPTCHA mechanism screenie" src="http://www.codeandeffect.co.uk/blog/wp-content/uploads/2006/09/dragndropcaptcha.png" /></a></p>
<div style="padding: 0pt 0px 5px 5px; text-align: center; font-family: serif; font-size: 90%">Simply re-arrange the images to make a visible key before clicking submit.</div>
</div>
<p>Fiddling with <a title="visit http://script.aculo.us/" href="http://script.aculo.us/">Scriptaculous</a> earlier today I had an idea for a <a title="Wikipedia" href="http://en.wikipedia.org/wiki/Captcha">CAPTCHA</a> mechanism. Cycling through the $_POST array in PHP gives you the form data, in order of submission.Scriptaculous&#8217; <em>sortable</em> feature allows you to change order of items in a List, so adding an image with corresponding hidden input field gives you a basic puzzle  to satisfy the CAPTCHA requirement.</p>
<div><a title="Clickety" href="http://www.codeandeffect.co.uk/tests/draganddropcaptcha/">Simple Drag n&#8217; Drop CAPTCHA</a> (written 8th September, 2006, code available on request).</div>
<p>Still comes with all the same accessibility problems most mechanisms have (with the added JS requirement), but saves the need for image generation.This version *can* use any naming convention for the images and input field names, they&#8217;re generated and checked by an array so don&#8217;t need to be numerically ordered &#8211; which could be a giveaway.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2006/programming/php/dragndrop-captcha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2006/09/dragndropcaptcha.thumbnail.png" length="3664" type="image/jpg" />	</item>
		<item>
		<title>Phorum module updated</title>
		<link>http://codeandeffect.co.uk/blog/2006/programming/phorum-module-updated/</link>
		<comments>http://codeandeffect.co.uk/blog/2006/programming/phorum-module-updated/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 13:55:13 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Web Computing]]></category>

		<guid isPermaLink="false">http://www.codeandeffect.co.uk/blog/?p=23</guid>
		<description><![CDATA[No way to spend a BH Monday. Started the day reading a mail from someone about my mod_change_username thingy for Phorum. Decided it was high time I address the rather tight restriction on username formats (tighter than Phorum&#8217;s own). Tested &#8230; <a href="http://codeandeffect.co.uk/blog/2006/programming/phorum-module-updated/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>No way to spend a BH Monday.</p>
<p>Started the day reading a mail from someone about my <em>mod_change_username</em> thingy for Phorum. Decided it was high time I address the rather tight restriction on username formats (tighter than Phorum&#8217;s own).</p>
<p>Tested it with Phorum 5.1.15 while I was at it &#8211; and barring some anomalies in the upgrade it seems to work as expected. V1.2 now available in the downloads section.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2006/programming/phorum-module-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

