<?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>Beaver6813.com</title>
	<atom:link href="http://beaver6813.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://beaver6813.com</link>
	<description>Web Developer Extraordinaire!</description>
	<lastBuildDate>Tue, 29 Jan 2013 13:33:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6-alpha-23334</generator>
		<item>
		<title>Selectors in Infinite-Scroll</title>
		<link>http://beaver6813.com/2012/01/selectors-in-infinite-scroll/</link>
		<comments>http://beaver6813.com/2012/01/selectors-in-infinite-scroll/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 20:33:26 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=310</guid>
		<description><![CDATA[I get asked a lot how/what the selectors are in infinite-scroll and how to figure them out. So lets start from the beginning.. infinite-scroll uses jQuery selectors (which are based on CSS selectors) to find content and posts in order &#8230; <a href="http://beaver6813.com/2012/01/selectors-in-infinite-scroll/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/' rel='bookmark' title='Select/Invite all friends on Facebook automatically'>Select/Invite all friends on Facebook automatically</a></li>
<li><a href='http://beaver6813.com/2009/10/under-construction/' rel='bookmark' title='Under Construction!'>Under Construction!</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I get asked a lot how/what the selectors are in infinite-scroll and how to figure them out. So lets start from the beginning.. infinite-scroll uses jQuery selectors (which are based on CSS selectors) to find content and posts in order to load the content from the next page. Because web pages are different, we need to define ourselves what selectors infinite-scroll should use.</p>
<p>Infinite-Scroll uses four selectors, these are:</p>
<ul>
<li>nextSelector</li>
<li>navSelector</li>
<li>contentSelector</li>
<li>itemSelector</li>
</ul>
<p>It&#8217;s probably easiest<span id="more-310"></span> if you check out my beautiful diagram below to see what they relate to:</p>
<p><a href="http://beaver6813.com/wp-content/uploads/2012/01/bananasint.png"><img class="aligncenter size-full wp-image-312" title="Bananas International Diagram" src="http://beaver6813.com/wp-content/uploads/2012/01/bananasint.png" alt="" width="640" height="480" /></a></p>
<p>And now finally we get to some code (its kind of unavoidable..), you need to look at your site. (easiest way is by going to the homepage, right click and choose view source).</p>
<p>We&#8217;re looking for something like this:</p>
<pre>&lt;div id="content"&gt;
&lt;div class="post"&gt;This is my post 1, it has a lot of content in it about Bananas...&lt;/div&gt;
&lt;div class="post"&gt;This is my post 2, it has a lot of content in it about Bananas...&lt;/div&gt;
&lt;div class="post"&gt;This is my post 3, it has a lot of content in it about Bananas...&lt;/div&gt;
&lt;div class="post"&gt;This is my post 4, it has a lot of content in it about Bananas...&lt;/div&gt;
&lt;/div&gt;
&lt;div id="navigation"&gt;
&lt;div class='next'&gt;
&lt;a href='/page/2/'&gt;Next Page&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<p>In jQuery/CSS if we want to select something by its ID we use &#8216;#&#8217;, if we want to select something by its class we use &#8216;.&#8217;. And finally if we want to drill into something we leave a space&#8230; see my selectors below and hopefully you&#8217;ll get it! Selectors for above:</p>
<ul>
<li>nextSelector: #navigation .next a:first</li>
<li>navSelector: #navigation</li>
<li>contentSelector: #content</li>
<li>itemSelector: #content .post</li>
</ul>
<p>Hope you enjoyed reading my self-help guide on getting to know your selectors! If you need any help just leave a comment or (preferably) open a ticket in the <a href="http://wordpress.org/tags/infinite-scroll?forum_id=10">wordpress forums</a> or <a href="https://github.com/paulirish/infinite-scroll/issues?sort=created&amp;direction=desc&amp;state=open">infinite-scroll site</a>.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/' rel='bookmark' title='Select/Invite all friends on Facebook automatically'>Select/Invite all friends on Facebook automatically</a></li>
<li><a href='http://beaver6813.com/2009/10/under-construction/' rel='bookmark' title='Under Construction!'>Under Construction!</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2012/01/selectors-in-infinite-scroll/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP: unset() not freeing memory fully on objects</title>
		<link>http://beaver6813.com/2011/06/php-unset-not-freeing-memory-fully-on-objects/</link>
		<comments>http://beaver6813.com/2011/06/php-unset-not-freeing-memory-fully-on-objects/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 20:35:00 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=290</guid>
		<description><![CDATA[I spent a while trying to figure this out; but it&#8217;s quite simple (though I find rather counter-intuitive). Essentially when you create an object in PHP you are allocating memory to that object. When you want to remove that object &#8230; <a href="http://beaver6813.com/2011/06/php-unset-not-freeing-memory-fully-on-objects/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/case-of-the-missinghidden-ie8-developer-tools-window/' rel='bookmark' title='Case of the missing/hidden IE8 Developer Tools window'>Case of the missing/hidden IE8 Developer Tools window</a></li>
<li><a href='http://beaver6813.com/2009/10/bash-bad-interpreter/' rel='bookmark' title='Bash, Bad Interpreter'>Bash, Bad Interpreter</a></li>
<li><a href='http://beaver6813.com/2010/05/decor-scene/' rel='bookmark' title='Decor Scene'>Decor Scene</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I spent a while trying to figure this out; but it&#8217;s quite simple (though I find rather counter-intuitive). Essentially when you create an object in PHP you are allocating memory to that object. When you want to remove that object you can use the unset() function (just like on most things in PHP). The problem occurs when there are variables stored inside the object &#8212; unset() doesn&#8217;t delete these from memory. This is because unset() doesn&#8217;t trigger the object&#8217;s destructor. A simple way around it is to explicitly call the destructor and then unset the object like so:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p290code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2902"><td class="code" id="p290code2"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$myobject</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CrazySystem<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myobject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">LargeVariable</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;VeryLargeFile.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Now we want to delete the object and everything it contains</span>
<span style="color: #000088;">$myobject</span><span style="color: #339933;">-&gt;</span>__destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myobject</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//It's now all gone!</span></pre></td></tr></table></div>

<p>Hope that helps anyone who was wondering why unsetting object still wasn&#8217;t freeing memory!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/case-of-the-missinghidden-ie8-developer-tools-window/' rel='bookmark' title='Case of the missing/hidden IE8 Developer Tools window'>Case of the missing/hidden IE8 Developer Tools window</a></li>
<li><a href='http://beaver6813.com/2009/10/bash-bad-interpreter/' rel='bookmark' title='Bash, Bad Interpreter'>Bash, Bad Interpreter</a></li>
<li><a href='http://beaver6813.com/2010/05/decor-scene/' rel='bookmark' title='Decor Scene'>Decor Scene</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2011/06/php-unset-not-freeing-memory-fully-on-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Select/Invite all friends on Facebook automatically</title>
		<link>http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/</link>
		<comments>http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/#comments</comments>
		<pubDate>Tue, 10 May 2011 21:05:44 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=283</guid>
		<description><![CDATA[Facebook recently updated the way they allow you to invite friends. Purposely or, as a side effect, it means that the popular javascript code that lets you select all friends no longer works. The following code courtesy of John P. &#8230; <a href="http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/' rel='bookmark' title='PHP Search and Replace Directory Recursively'>PHP Search and Replace Directory Recursively</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Facebook recently updated the way they allow you to invite friends. Purposely or, as a side effect, it means that the popular javascript code that lets you select all friends no longer works. The following code courtesy of <a href="http://onemansblog.com/2009/08/30/how-to-invite-all-facebook-friends-to-a-group-event-or-page/">John P</a>. allows you to select all friends on the new version. (Yay!)</p>
<p>There is one catch. Because Facebook now only loads a few of your friends at a time, you have to scroll all the way down the invite list until you hit the very bottom (all your friends are displayed). You then just paste the following into the URL bar and hit enter:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p283code4'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2834"><td class="code" id="p283code4"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span> check_all_in_document<span style="color: #009900;">&#40;</span>doc<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #003366; font-weight: bold;">var</span> c<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>c<span style="color: #339933;">=</span>doc.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>for<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>c.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">type</span><span style="color: #339933;">==</span><span style="color: #3366CC;">'checkbox'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>c<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>check_all_in_document<span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">document</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>for<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span>window.<span style="color: #660066;">frames</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>check_all_in_document<span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">frames</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">document</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Happy inviting! (If the code doesn&#8217;t work then make sure you click &#8220;View Code&#8221; in the box above.)</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/' rel='bookmark' title='PHP Search and Replace Directory Recursively'>PHP Search and Replace Directory Recursively</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Regular Expression for Passwords</title>
		<link>http://beaver6813.com/2011/01/regular-expression-for-passwords/</link>
		<comments>http://beaver6813.com/2011/01/regular-expression-for-passwords/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:49:40 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=266</guid>
		<description><![CDATA[This is just a note to myself really, below is the regular expression for a string or in my case password where you require it to have at least one letter, one number, a limited selection of special characters (optional) &#8230; <a href="http://beaver6813.com/2011/01/regular-expression-for-passwords/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/' rel='bookmark' title='Select/Invite all friends on Facebook automatically'>Select/Invite all friends on Facebook automatically</a></li>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2009/10/php-get-current-time-in-milliseconds/' rel='bookmark' title='[PHP] Get current time in milliseconds'>[PHP] Get current time in milliseconds</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>This is just a note to myself really, below is the regular expression for a string or in my case password where you require it to have at least one letter, one number, a limited selection of special characters (optional) and a minimum of 8 characters in length:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p266code6'); return false;">View Code</a> REGEX</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2666"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p266code6"><pre class="regex" style="font-family:monospace;">^(?=.{8,})(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z0-9@#$%^&amp;+=\*]*$</pre></td></tr></table></div>

<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/' rel='bookmark' title='Select/Invite all friends on Facebook automatically'>Select/Invite all friends on Facebook automatically</a></li>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2009/10/php-get-current-time-in-milliseconds/' rel='bookmark' title='[PHP] Get current time in milliseconds'>[PHP] Get current time in milliseconds</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2011/01/regular-expression-for-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amersham Dec</title>
		<link>http://beaver6813.com/2010/09/amersham-dec/</link>
		<comments>http://beaver6813.com/2010/09/amersham-dec/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 11:55:00 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[amersham]]></category>
		<category><![CDATA[amersham dec]]></category>
		<category><![CDATA[crown]]></category>
		<category><![CDATA[cuprinol]]></category>
		<category><![CDATA[decorating]]></category>
		<category><![CDATA[dulux]]></category>
		<category><![CDATA[intuitive]]></category>
		<category><![CDATA[merchants]]></category>
		<category><![CDATA[professional]]></category>
		<category><![CDATA[retail]]></category>
		<category><![CDATA[sadolin]]></category>
		<category><![CDATA[trade]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=241</guid>
		<description><![CDATA[Amersham Dec is a brilliant example of a simple informational website for a shop that currently has its main presence in a physical location. The elegant and user-intuitive interface enables visitors to easily find out which range of products/brands the &#8230; <a href="http://beaver6813.com/2010/09/amersham-dec/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2010/05/decor-scene/' rel='bookmark' title='Decor Scene'>Decor Scene</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
<li><a href='http://beaver6813.com/2009/10/my-skills/' rel='bookmark' title='My Skills'>My Skills</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><img src='http://beaver6813.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/241.png&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p><a href="http://amershamdec.co.uk" target="_blank">Amersham Dec</a> is a brilliant example of a simple informational website for a shop that currently has its main presence in a physical location. The elegant and user-intuitive interface enables visitors to easily find out which range of products/brands the store stocks and details of how visitors can contact the shop either by phone, post or using the built-in contact form that uses CAPTCHA to help prevent spam posts. The vast majority of the target audience; decorating trade<span id="more-241"></span> professionals, are not tech-savvy and this was one of the main reasons behind making the site appear so simple and straight-forward.</p>
<p>Like with past projects I again worked with Michiel from <a title="Visit Webslash" href="http://webslash.be">Webslash</a> to create the design drafts and final design. Once this was finalised and shown to the client I then proceeded to first slice the design into its component parts and then to code it into WC3 valid XHTML/CSS. I opted to use the established method of image sprites for the rounded corners rather than using the new CSS3 rounded corners as many of the target audience may not keep their browsers up to date and a majority will use Internet Explorer 8 which still does not fully support CSS3.</p>
<p>After the first pass of coding I then converted the XHTML/CSS to a WordPress theme to enable easy self management by the owner for minor content modifications.</p>

<a href='http://beaver6813.com/2010/09/amersham-dec/fireshot-capture-030-home-i-amersham-dec-amershamdec_co_uk/' title='Home Page'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/09/FireShot-capture-030-Home-I-Amersham-Dec-amershamdec_co_uk-150x150.png" class="attachment-thumbnail" alt="Home Page" /></a>
<a href='http://beaver6813.com/2010/09/amersham-dec/fireshot-capture-031-health-safety-datasheets-i-amersham-dec-amershamdec_co_uk_health-safety-datasheets/' title='Health &amp; Safety Page'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/09/FireShot-capture-031-Health-Safety-Datasheets-I-Amersham-Dec-amershamdec_co_uk_health-safety-datasheets-150x150.png" class="attachment-thumbnail" alt="Health &amp; Safety Page" /></a>
<a href='http://beaver6813.com/2010/09/amersham-dec/fireshot-capture-032-contact-us-i-amersham-dec-amershamdec_co_uk_contact-us/' title='Contact Us Page'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/09/FireShot-capture-032-Contact-Us-I-Amersham-Dec-amershamdec_co_uk_contact-us-150x150.png" class="attachment-thumbnail" alt="Contact Us Page" /></a>
<a href='http://beaver6813.com/2010/09/amersham-dec/fireshot-capture-033-find-us-i-amersham-dec-amershamdec_co_uk_find-us/' title='Find Us Page'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/09/FireShot-capture-033-Find-Us-I-Amersham-Dec-amershamdec_co_uk_find-us-150x150.png" class="attachment-thumbnail" alt="Find Us Page" /></a>

<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2010/05/decor-scene/' rel='bookmark' title='Decor Scene'>Decor Scene</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
<li><a href='http://beaver6813.com/2009/10/my-skills/' rel='bookmark' title='My Skills'>My Skills</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2010/09/amersham-dec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Compilation (Cannot find -lltdl)</title>
		<link>http://beaver6813.com/2010/07/php-compilation-cannot-find-lltdl/</link>
		<comments>http://beaver6813.com/2010/07/php-compilation-cannot-find-lltdl/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 18:15:10 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[php php5 mcrypt lltdl source compile]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=234</guid>
		<description><![CDATA[When compiling PHP from source (in my case version 5.3.2) on CentOS 5.4 I kept getting the following error when trying to compile with mcrypt: "/usr/bin/ld: cannot find -lltdl" This seems to be due to a missing development library with &#8230; <a href="http://beaver6813.com/2010/07/php-compilation-cannot-find-lltdl/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/case-of-the-missinghidden-ie8-developer-tools-window/' rel='bookmark' title='Case of the missing/hidden IE8 Developer Tools window'>Case of the missing/hidden IE8 Developer Tools window</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>When compiling PHP from source (in my case version 5.3.2) on CentOS 5.4 I kept getting the following error when trying to compile with mcrypt:</p>
<p><code>"/usr/bin/ld: cannot find -lltdl"</code></p>
<p>This seems to be due to a missing development library with the obscure name of <span style="font-family: Courier New;">libtool-ltdl-devel</span> to fix this simply use:</p>
<p><code>yum install libtool-ltdl-devel</code></p>
<p>Which should include the package along with several dependencies.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">libltdl3-dev</div>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/case-of-the-missinghidden-ie8-developer-tools-window/' rel='bookmark' title='Case of the missing/hidden IE8 Developer Tools window'>Case of the missing/hidden IE8 Developer Tools window</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2010/07/php-compilation-cannot-find-lltdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpGSB &#8211; PHP Google Safe Browsing</title>
		<link>http://beaver6813.com/2010/06/phpgsb-php-google-safe-browsing/</link>
		<comments>http://beaver6813.com/2010/06/phpgsb-php-google-safe-browsing/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 15:14:36 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=231</guid>
		<description><![CDATA[For the past couple of weeks I&#8217;ve been working on a PHP system that uses the Google Safe Browsing API to download blacklists and perform lookups on them with the goal of limiting the destructiveness of phishing and malware websites. &#8230; <a href="http://beaver6813.com/2010/06/phpgsb-php-google-safe-browsing/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2009/10/new-project-vbulletin-bridge/' rel='bookmark' title='New Project: vBulletin-Bridge'>New Project: vBulletin-Bridge</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
<li><a href='http://beaver6813.com/2010/04/htc-desire-release-dates/' rel='bookmark' title='HTC Desire Release Dates'>HTC Desire Release Dates</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>For the past couple of weeks I&#8217;ve been working on a PHP system that uses the Google Safe Browsing API to download blacklists and perform lookups on them with the goal of limiting the destructiveness of phishing and malware websites. Its still in a very early development phase (alpha) and there is still a lot left to be done but&#8230; it works! I&#8217;ve started<span id="more-231"></span> a Google Code project for this at: http://code.google.com/p/phpgsb/ Any contributions or testers would be greatly appreciated!</p>
<blockquote>
<div id="wikicontent">
<p><strong>phpGSB Main Version – 0.1 (ALPHA)</strong></p>
<p>phpGSB is  a PHP implementation using the Google Safe Browsing API. At current it <em>does</em> allow the following:</p>
<ul>
<li>Updating of GSB lists to a MySQL  database</li>
</ul>
<ul>
<li>Basic checking of URL’s against lists and then full-hash checks against the full GSB database</li>
<li>Caching of full-hash keys to minimise requests to the Google server</li>
</ul>
<p>At current it <em>does  not</em> allow the following:</p>
<ul>
<li>Requests using MAC keys  (integrity checks)</li>
</ul>
<p>The  main class is definitely not as efficient as it could be and has  developed very quickly to meet the basic GSB specification; any  contributions, bug fixes etc are <strong>very</strong> welcome!</p>
<p>If you have any problems please post in the Issues section, <em>give as  much information as you can,</em> the more information given, the easier  it is to find any problems you may be having.</p>
<p>Modified Post 14/08/10 (Now caches full-hashes)</p>
</div>
</blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/10/new-project-vbulletin-bridge/' rel='bookmark' title='New Project: vBulletin-Bridge'>New Project: vBulletin-Bridge</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
<li><a href='http://beaver6813.com/2010/04/htc-desire-release-dates/' rel='bookmark' title='HTC Desire Release Dates'>HTC Desire Release Dates</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2010/06/phpgsb-php-google-safe-browsing/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>[PHP] TLD List, Inc. Level 2 &amp; 3</title>
		<link>http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/</link>
		<comments>http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 16:48:19 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[All Level]]></category>
		<category><![CDATA[Automatic]]></category>
		<category><![CDATA[Levels 2 - 3]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[TLD List]]></category>
		<category><![CDATA[Top Level]]></category>
		<category><![CDATA[Updater]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=225</guid>
		<description><![CDATA[Whilst working on a new open-source project I needed to be able to be able to detect/remove the TLD&#8217;s from hostnames. This is no easy task algorithmically as example.co.uk (level 2) is just as valid as example.com (level 1) which &#8230; <a href="http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/' rel='bookmark' title='Select/Invite all friends on Facebook automatically'>Select/Invite all friends on Facebook automatically</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Whilst working on a new open-source project I needed to be able to be able to detect/remove the TLD&#8217;s from hostnames. This is no easy task algorithmically as example.co.uk (level 2) is just as valid as example.com (level 1) which is also just as valid as example.bob.shiga.jp (level 3). I came across a project from Mozilla that lists all TLDs. This isn&#8217;t the easiest format to work with each time you want to test hostnames. So I&#8217;ve built an auto-updater that will sort and serialize the domains into a format like:<br />
<span id="more-225"></span><br />
[uk] =&gt;</p>
<p style="padding-left: 30px;">*.uk</p>
<p style="padding-left: 30px;">!parliament.uk</p>
<p style="padding-left: 30px;">!nhs.uk</p>
<p>The updater then serializes the array for easy access via PHP at a later date. You may be wondering what the * and !&#8217;s mean. To put it simply it means that there could be anything just before the .uk and it should be counted as the domain such as .co.uk, .gov.uk. The ! before means that its an exception to the * (wildcard) rule, so in the case of parliament.uk, the parliament part should <strong>not</strong> be counted as part of the domain. A full explanation of this can be found at <a href="http://publicsuffix.org/format/" class="broken_link">http://publicsuffix.org/format/</a></p>
<p>Please find below the actual code for the updater. I decided against just posting the serialized list as the list will change over time where as this post may not.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p225code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2258"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code" id="p225code8"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//TLD List Updater (Formats to Serialized PHP)</span>
<span style="color: #666666; font-style: italic;">//Created by Beaver6813 (Beaver6813.com). Big thanks to the Mozilla community!</span>
<span style="color: #000088;">$tldlist</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$toplist</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tldlist</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr_count"><span style="color: #990000;">substr_count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;//&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">&amp;&amp;!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr_count"><span style="color: #990000;">substr_count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$sublist</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$dotxplode</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$dotxplode</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_reverse"><span style="color: #990000;">array_reverse</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dotxplode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sublist</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$dotxplode</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/file_put_contents"><span style="color: #990000;">file_put_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;effective_tld_sublist.dat&quot;</span><span style="color: #339933;">,</span><a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sublist</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2011/05/selectinvite-all-friends-on-facebook-automatically/' rel='bookmark' title='Select/Invite all friends on Facebook automatically'>Select/Invite all friends on Facebook automatically</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decor Scene</title>
		<link>http://beaver6813.com/2010/05/decor-scene/</link>
		<comments>http://beaver6813.com/2010/05/decor-scene/#comments</comments>
		<pubDate>Fri, 21 May 2010 11:32:27 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[decor scene]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[DIY store]]></category>
		<category><![CDATA[elegant]]></category>
		<category><![CDATA[family run]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=211</guid>
		<description><![CDATA[Decor Scene was a smaller, simpler project I worked on. Mike from Decor Scene tasked me with creating a simple, user-friendly website that gave Decor Scene, a family run DIY store, a web presence. For the main design I approached &#8230; <a href="http://beaver6813.com/2010/05/decor-scene/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2010/03/city-coupons/' rel='bookmark' title='City Coupons'>City Coupons</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
<li><a href='http://beaver6813.com/2010/09/amersham-dec/' rel='bookmark' title='Amersham Dec'>Amersham Dec</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><img src='http://beaver6813.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/211.png&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>Decor Scene was a smaller, simpler project I worked on. Mike from <a href="http://www.decorscene.co.uk">Decor Scene</a> tasked me with creating a simple, user-friendly website that gave <a href="http://www.decorscene.co.uk">Decor Scene</a>, a family run DIY store, a web presence. For the main design I approached a company I had recently worked with <a href="http://beaver6813.com/2010/03/jokepants/">Webslash</a> to design a simple, elegant and modern website that made an impact on any user who visited. After a few drafts we were there and it was down to me to slice the design and code it. As the site itself i<span id="more-211"></span>s rather simple I wanted to use the most efficient methods available and so split the website into three parts:</p>
<ul>
<li>Header &#8211; Template</li>
<li>Content &#8211; Custom for each page</li>
<li>Footer &#8211; Template</li>
</ul>
<p>By making the header and footer both templates it saved greatly on development times and served to make the website easier to update in the future.</p>
<p>A problem I encountered with this however arrived when it came to adding Google Maps to make it easier for potential customers to find the shop. Google Maps code is usually added to the head parts of the HTML and then an onload function is added to the body, so when the body is fully loaded Google Maps loads. It would be very inefficient to include the code on each page and could potentially generate errors so I simply included a check to see if it exists. I could then create this function just on the &#8220;Find Us&#8221; page and then use a small bit of javascript that checks if &#8220;runjavascript()&#8221; is defined, if it is, it runs it:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p211code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p21110"><td class="code" id="p211code10"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> window.<span style="color: #660066;">runjavascript</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'function'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
runjavascript<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I think this is the more efficient or at least simplest way to do this, if anyone has a better way then let me know!</p>
<p>Some SEO work was also done on the website to ensure it hit page 1 on Google on some terms such as &#8220;DIY Store Rickmansworth&#8221;, &#8220;Decor Scene&#8221;, &#8220;Decor Scene Rickmansworth&#8221;, &#8220;DIY Shop Rickmansworth&#8221;; part of this was adding the business to Google Maps which benefits both customers and the business.</p>
<p>On final presentation to the client the response was very positive and whilst the website is fairly simple at the moment it certainly has left room for expansion in the future!</p>

<a href='http://beaver6813.com/2010/05/decor-scene/decorscene-home/' title='Decor Scene - Homepage'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/05/DecorScene-Home-150x150.png" class="attachment-thumbnail" alt="Decor Scene Homepage" /></a>
<a href='http://beaver6813.com/2010/05/decor-scene/decorscene-about/' title='Decor Scene - About Us'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/05/DecorScene-About-150x150.png" class="attachment-thumbnail" alt="Decor Scene - About Us" /></a>
<a href='http://beaver6813.com/2010/05/decor-scene/decorscene-products/' title='Decor Scene - Products'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/05/DecorScene-Products-150x150.png" class="attachment-thumbnail" alt="Decor Scene - Products" /></a>
<a href='http://beaver6813.com/2010/05/decor-scene/decorscene-findus/' title='Decor Scene - Find Us'><img width="150" height="150" src="http://beaver6813.com/wp-content/uploads/2010/05/DecorScene-Findus-150x150.png" class="attachment-thumbnail" alt="Decor Scene - Find Us" /></a>

<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2010/03/city-coupons/' rel='bookmark' title='City Coupons'>City Coupons</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Jokepants'>Jokepants</a></li>
<li><a href='http://beaver6813.com/2010/09/amersham-dec/' rel='bookmark' title='Amersham Dec'>Amersham Dec</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2010/05/decor-scene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Search and Replace Directory Recursively</title>
		<link>http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/</link>
		<comments>http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 16:04:11 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[find and replace]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[recurse]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[search and replace]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=207</guid>
		<description><![CDATA[On a message forum I regularily visit a member was having issues with code being placed in multiple files that he wanted to remove or change without having to edit each and every file manually. For this I created a &#8230; <a href="http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://beaver6813.com/2009/10/new-project-vbulletin-bridge/' rel='bookmark' title='New Project: vBulletin-Bridge'>New Project: vBulletin-Bridge</a></li>
<li><a href='http://beaver6813.com/2009/10/bash-bad-interpreter/' rel='bookmark' title='Bash, Bad Interpreter'>Bash, Bad Interpreter</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>On a message forum I regularily visit a member was having issues with code being placed in multiple files that he wanted to remove or change without having to edit each and every file manually. For this I created a search and replace function which will recursively search the directory and every file<span id="more-207"></span> for a specific piece of code and will replace with whatever:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p207code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20712"><td class="code" id="p207code12"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>?php
<span style="color: #000088;">$stringsearch</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;texttosearchfor&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$stringreplace</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;texttoreplacewith&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;./&quot;</span><span style="color: #339933;">;</span>
SearchandReplace<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">,</span><span style="color: #000088;">$stringsearch</span><span style="color: #339933;">,</span><span style="color: #000088;">$stringreplace</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> SearchandReplace<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">,</span> <span style="color: #000088;">$stringsearch</span><span style="color: #339933;">,</span> <span style="color: #000088;">$stringreplace</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Starting search for <span style="color: #006699; font-weight: bold;">$stringsearch</span> within directory <span style="color: #006699; font-weight: bold;">$dir</span>
&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$listDir</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handler</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/opendir"><span style="color: #990000;">opendir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sub</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/readdir"><span style="color: #990000;">readdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handler</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$sub</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$sub</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;..&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$sub</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;Thumb.db&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_file"><span style="color: #990000;">is_file</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr_count"><span style="color: #990000;">substr_count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sub</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$getfilecontents</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr_count"><span style="color: #990000;">substr_count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$getfilecontents</span><span style="color: #339933;">,</span><span style="color: #000088;">$stringsearch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
                            <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$replacer</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stringsearch</span><span style="color: #339933;">,</span><span style="color: #000088;">$stringreplace</span><span style="color: #339933;">,</span><span style="color: #000088;">$getfilecontents</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #666666; font-style: italic;">// Let's make sure the file exists and is writable first.</span>
                              <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_writable"><span style="color: #990000;">is_writable</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/fopen"><span style="color: #990000;">fopen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                       <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Cannot open file (&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span>
                                       <a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span>
                                  <span style="color: #009900;">&#125;</span>
                                  <span style="color: #666666; font-style: italic;">// Write $somecontent to our opened file.</span>
                                  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/fwrite"><span style="color: #990000;">fwrite</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replacer</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Cannot write to file (&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span>
                                      <a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span>
                                  <span style="color: #009900;">&#125;</span>
                                  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Success, removed searched content from:&quot;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;
&quot;</span><span style="color: #339933;">;</span>
                                  <a href="http://www.php.net/fclose"><span style="color: #990000;">fclose</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                              <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                                  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;The file &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #0000ff;">&quot; is not writable
&quot;</span><span style="color: #339933;">;</span>
                              <span style="color: #009900;">&#125;</span>
                            <span style="color: #009900;">&#125;</span>
                            <span style="color: #009900;">&#125;</span>
                        <span style="color: #000088;">$listDir</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$sub</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_dir"><span style="color: #990000;">is_dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$listDir</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$sub</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> SearchandReplace<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sub</span><span style="color: #339933;">,</span><span style="color: #000088;">$stringsearch</span><span style="color: #339933;">,</span><span style="color: #000088;">$stringreplace</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <a href="http://www.php.net/closedir"><span style="color: #990000;">closedir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$listDir</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
?<span style="color: #339933;">--&gt;</span></pre></td></tr></table></div>

<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/10/new-project-vbulletin-bridge/' rel='bookmark' title='New Project: vBulletin-Bridge'>New Project: vBulletin-Bridge</a></li>
<li><a href='http://beaver6813.com/2009/10/bash-bad-interpreter/' rel='bookmark' title='Bash, Bad Interpreter'>Bash, Bad Interpreter</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
