<?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>Cultivate Web Design Melbourne - Development Blog &#187; Uncategorized</title>
	<atom:link href="http://cultivatewebdesign.com.au/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://cultivatewebdesign.com.au/blog</link>
	<description></description>
	<lastBuildDate>Thu, 12 Aug 2010 04:16:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Regular expression to remove in-line styles</title>
		<link>http://cultivatewebdesign.com.au/blog/regular-expression-to-remove-in-line-styles/</link>
		<comments>http://cultivatewebdesign.com.au/blog/regular-expression-to-remove-in-line-styles/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 04:16:42 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[remove inline styles]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=202</guid>
		<description><![CDATA[style=&#34;[a-zA-Z0-9_;:%# -]+&#34;]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain;">
style=&quot;[a-zA-Z0-9_;:%# -]+&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/regular-expression-to-remove-in-line-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple mootools form validator</title>
		<link>http://cultivatewebdesign.com.au/blog/simple-mootools-form-validator/</link>
		<comments>http://cultivatewebdesign.com.au/blog/simple-mootools-form-validator/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 04:26:45 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=199</guid>
		<description><![CDATA[$$('form.validate').addEvent('submit',function (e){ var no_errors = true; $$('.required').each(function(input_el){ if(!$(input_el).get('value')) { input_el.addClass('error'); no_errors = false; } }); if(!no_errors) alert('Please fill all required fields'); return no_errors; });]]></description>
			<content:encoded><![CDATA[<pre class="brush: jscript;">
	$$('form.validate').addEvent('submit',function (e){

		var no_errors = true;
		$$('.required').each(function(input_el){
			if(!$(input_el).get('value'))
			{	input_el.addClass('error');
				no_errors = false;
			}
		});
		if(!no_errors)
			alert('Please fill all required fields');
		return no_errors;
	});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/simple-mootools-form-validator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dynamically populate a select box with options using mootools</title>
		<link>http://cultivatewebdesign.com.au/blog/dynamically-populate-a-select-box-with-options-using-mootools/</link>
		<comments>http://cultivatewebdesign.com.au/blog/dynamically-populate-a-select-box-with-options-using-mootools/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 02:03:10 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[melbourne]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=189</guid>
		<description><![CDATA[window.addEvent('domready',function(){ $$('input[name=Enquiry_type]').addEvent('change',function() { var Enquiry_Categories = [['option 1','option 2','option 3'],['option 4','option 5','option 6'],['option 7','option 8','option 9']]; $('Enquiry_Sub_Category').empty(); for(i=0; i&#60;Enquiry_Categories[$(this).get('value')].length; i++) { var option = Enquiry_Categories[$(this).get('value')][i]; $('Enquiry_Sub_Category').grab(new Element('option',{value: option, html: option})); } }); }); &#60;!-- when this is selected--&#62; &#60;select name=&#34;Enquiry_type&#34;&#62; &#60;option value=&#34;0&#34;&#62;select this for options 1,2,3&#60;/option&#62; &#60;option value=&#34;1&#34;&#62;select this for options 4,5,6&#60;/option&#62; &#60;option value=&#34;2&#34;&#62;select this [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: jscript;">

window.addEvent('domready',function(){
	$$('input[name=Enquiry_type]').addEvent('change',function()
	{	var Enquiry_Categories = [['option 1','option 2','option 3'],['option 4','option 5','option 6'],['option 7','option 8','option 9']];

		$('Enquiry_Sub_Category').empty();

		for(i=0; i&lt;Enquiry_Categories[$(this).get('value')].length; i++)
		{	var option = Enquiry_Categories[$(this).get('value')][i];
			$('Enquiry_Sub_Category').grab(new Element('option',{value: option, html: option}));
		}
	});
});
</pre>
<pre class="brush: xml;">
&lt;!-- when this is selected--&gt;
&lt;select name=&quot;Enquiry_type&quot;&gt;
&lt;option value=&quot;0&quot;&gt;select this for options 1,2,3&lt;/option&gt;
&lt;option value=&quot;1&quot;&gt;select this for options 4,5,6&lt;/option&gt;
&lt;option value=&quot;2&quot;&gt;select this for options 7,8,9&lt;/option&gt;
&lt;/select&gt;

&lt;!--this will get populated--&gt;
&lt;select name=&quot;Enquiry_Sub_Category&quot;&gt;
&lt;/select&gt;
</pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 10px; width: 1px; height: 1px; overflow: hidden;">
<pre>'option 1','option 1',</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/dynamically-populate-a-select-box-with-options-using-mootools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mootools font enlarge / text resize</title>
		<link>http://cultivatewebdesign.com.au/blog/mootools-font-enlarge-text-resize/</link>
		<comments>http://cultivatewebdesign.com.au/blog/mootools-font-enlarge-text-resize/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 06:37:41 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[font enlarge]]></category>
		<category><![CDATA[font resize]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[text enlarge]]></category>
		<category><![CDATA[text resize]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=187</guid>
		<description><![CDATA[$(body).toggleClass('enlarge'); //enlarge text link onclick body p{ font-size:12px; } body,enlarge p{ font-size:16px; } Now you dont have to reload css files and have all the css in one file too.]]></description>
			<content:encoded><![CDATA[<pre class="brush: jscript;">
$(body).toggleClass('enlarge'); //enlarge text link onclick
</pre>
<pre class="brush: css;">
body p{
   font-size:12px;
}

body,enlarge p{
   font-size:16px;
}
</pre>
<p>Now you dont have to reload css files and have all the css in one file too.</p>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/mootools-font-enlarge-text-resize/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find out which package to install when faced with a missing file/lib error</title>
		<link>http://cultivatewebdesign.com.au/blog/find-out-which-package-to-install-when-faced-with-a-missing-filelib-error/</link>
		<comments>http://cultivatewebdesign.com.au/blog/find-out-which-package-to-install-when-faced-with-a-missing-filelib-error/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 03:49:38 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dependancy]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=180</guid>
		<description><![CDATA[Get errors like this? Warning: dl(): Unable to load dynamic library 'libwebpayclient.so' - libssl.so.4: cannot open shared object file: Not sure which package to install? Run the code below to find out! sudo apt-get install apt-file sudo apt-file update apt-file search libssl.so]]></description>
			<content:encoded><![CDATA[<pre>Get errors like this?

Warning: dl(): Unable to load dynamic library 'libwebpayclient.so' - libssl.so.4: cannot open shared object file:
Not sure which package to install? Run the code below to find out!
<pre class="brush: bash;">
 sudo apt-get install apt-file
 sudo apt-file update
 apt-file search libssl.so
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/find-out-which-package-to-install-when-faced-with-a-missing-filelib-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegant way to construct SQL statements</title>
		<link>http://cultivatewebdesign.com.au/blog/elegant-way-to-construct-sql-statements/</link>
		<comments>http://cultivatewebdesign.com.au/blog/elegant-way-to-construct-sql-statements/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 07:41:30 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=176</guid>
		<description><![CDATA[I saw this method used in an old c cook book. Can&#8217;t remeber what it&#8217;s called, cascading switch anyone?? switch($section) { case 'year': if(empty($select)) $select = ' * '; if(!empty($year)) $where .= &#34;    AND        `Year Range`    LIKE '%$year%' &#34;; case 'submodel': if(empty($select)) $select = ' TRIM(`Year Range`)'; if(!empty($submodel)) $where .= &#34;    AND        `Model [...]]]></description>
			<content:encoded><![CDATA[<p>I saw this method used in an old c cook book. Can&#8217;t remeber what it&#8217;s called, cascading switch anyone??</p>
<pre class="brush: php;">

switch($section)
 {
 case 'year':
 if(empty($select))
 $select = ' * ';
 if(!empty($year))
 $where .= &quot;    AND        `Year Range`    LIKE '%$year%' &quot;;

 case 'submodel':
 if(empty($select))
 $select = ' TRIM(`Year Range`)';
 if(!empty($submodel))
 $where .= &quot;    AND        `Model ID`         LIKE '%$submodel%' &quot;;

 case 'engine':
 if(empty($select))
 $select = ' TRIM(`Model ID`) ';
 if(!empty($engine))
 $where .= &quot;    AND        `Engine Size`     LIKE '%$engine%' &quot;;

 case 'model':
 if(empty($select))
 $select = ' TRIM(`Engine Size`) ';
 if(!empty($model))
 $where .= &quot;    AND     `Model Name`    LIKE '%$model%' &quot;;

 case 'make':
 if(empty($select))
 $select = ' TRIM(`Model Name`) ';
 if(!empty($make))
 $where .= &quot;    AND     `Make`             LIKE '%$make%' &quot;;
 }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/elegant-way-to-construct-sql-statements/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Recursively append folder name to file name</title>
		<link>http://cultivatewebdesign.com.au/blog/recursively-append-folder-name-to-file-name/</link>
		<comments>http://cultivatewebdesign.com.au/blog/recursively-append-folder-name-to-file-name/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 07:27:10 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=173</guid>
		<description><![CDATA[This is a simple script to go though a files inside a folder recursively and append the folder name to the file name. The script is written for a windows system, just replace the \\ to / for unix. function getDirectory( $path = '.', $level = 0 ) {    $dir_separator = '__'; $ignore = array( [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple script to go though a files inside a folder recursively and append the folder name to the file name.</p>
<p>The script is written for a windows system, just replace the \\ to / for unix.</p>
<pre class="brush: php;">

function getDirectory( $path = '.', $level = 0 )
{    $dir_separator = '__';
 $ignore = array( 'cgi-bin', '.', '..','default.asp','index.php','PUT SELF IN THERE' );
 // Directories to ignore when listing output. Many hosts
 // will deny PHP access to the cgi-bin.

 $dh = @opendir( $path );
 // Open the directory to the handle $dh

 while( false !== ( $file = readdir( $dh ) ) ){
 // Loop through the directory

 if( !in_array( $file, $ignore ) &amp;&amp; !strstr($file, $dir_separator))
 {    // Check that this file is not to be ignored
 //AND ALSO CHECK IF WE HAVENT ALRADY DONE THIS

 $spaces = str_repeat( '&amp;nbsp;', ( $level * 4 ) );
 // Just to add spacing to the list, to better
 // show the directory tree.

 if( is_dir( &quot;$path\\$file&quot; ) )
 {    // Its a directory, so we need to keep reading down...

 //echo &quot;&lt;strong&gt;$spaces $file&lt;/strong&gt;&lt;br /&gt;&quot;;
 getDirectory( &quot;$path\\$file&quot;, ($level+1) );
 // Re-call this same function but on a new directory.
 // this is what makes function recursive.
 } else {
 $rooot_path = 'C:\\xampp\\htdocs\\Documents';
 $old_filename = $rooot_path.substr(&quot;$path\\$file&quot;,1);
 $new_filename = substr($path,2);
 $new_filename = $rooot_path.substr('.\\'.$new_filename.'\\'.str_replace('\\',$separator,$new_filename).$separator.$file,1);
 echo &quot;$old_filename -&gt; $new_filename &lt;br /&gt;&quot;;
 rename($old_filename,$new_filename);
 }
 }

 }
 closedir( $dh );
 // Close the directory handle
}

//run the function
getDirectory( &quot;.&quot; );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/recursively-append-folder-name-to-file-name/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Redirect the whole site to https</title>
		<link>http://cultivatewebdesign.com.au/blog/redirect-the-whole-site-to-https/</link>
		<comments>http://cultivatewebdesign.com.au/blog/redirect-the-whole-site-to-https/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 01:45:08 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/redirect-the-whole-site-to-https/</guid>
		<description><![CDATA[RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://cultivatewebdesign.com.au%{REQUEST_URI}]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain;">
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://cultivatewebdesign.com.au%{REQUEST_URI}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/redirect-the-whole-site-to-https/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cultivate web design Melbourne &#8211; Firefox persona</title>
		<link>http://cultivatewebdesign.com.au/blog/cultivate-web-design-melbourne-firefox-persona/</link>
		<comments>http://cultivatewebdesign.com.au/blog/cultivate-web-design-melbourne-firefox-persona/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 05:29:31 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=167</guid>
		<description><![CDATA[Check out the: Firefox 3 Persona by Cultivate web design Melbourne They are easy to create and offers great viral marketing value for your business.]]></description>
			<content:encoded><![CDATA[<div id="attachment_168" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-168" title="Cultivate Firefox persona" src="http://cultivatewebdesign.com.au/blog/wp-content/uploads/2009/08/persona-300x173.png" alt="Cultivate Firefox persona" width="300" height="173" /><p class="wp-caption-text">Cultivate Firefox persona</p></div>
<p>Check out the:</p>
<p><a href="http://www.getpersonas.com/persona/38050">Firefox 3 Persona by Cultivate web design Melbourne</a></p>
<p>They are easy to create and offers great viral marketing value for your business.</p>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/cultivate-web-design-melbourne-firefox-persona/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Resize iframe to fit content (all code in parent window)</title>
		<link>http://cultivatewebdesign.com.au/blog/resize-iframe-to-fit-content-all-code-in-parent-window/</link>
		<comments>http://cultivatewebdesign.com.au/blog/resize-iframe-to-fit-content-all-code-in-parent-window/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 02:49:55 +0000</pubDate>
		<dc:creator>Chris Gunn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cultivatewebdesign.com.au/blog/?p=163</guid>
		<description><![CDATA[While iframes are not good to use normaly, I use it to mix different server side languages. (eg: pulling through perl/ASP scripts to display on a php page). Please only use this for non indexed (admin/managemt/report) pages because iframes are no good for SEO. Javascript for the parent page, //this uses mootools. This code should [...]]]></description>
			<content:encoded><![CDATA[<p>While iframes are not good to use normaly, I use it to mix different server side languages. (eg: pulling through perl/ASP scripts to display on a php page). Please only use this for non indexed (admin/managemt/report) pages because iframes are no good for SEO.</p>
<p>Javascript for the parent page,</p>
<pre class="brush: jscript;">
//this uses mootools. This code should be placed inside domready or load event of the window
$('my-iframe').addEvent('load',function()
{	innerDoc = ($('my-iframe').contentDocument) ? $('my-iframe').contentDocument : $('my-iframe').contentWindow.document;
	objToResize = ($('my-iframe').style) ? $('my-iframe').style : $('my-iframe');
	objToResize.height = (innerDoc.body.scrollHeight + 50) + 'px';
	objToResize.width = (innerDoc.body.scrollWidth + 20) + 'px';
	window.scrollTo(0, 0);//optional code to scroll the parent window back to top
});
</pre>
<p>And the iframe should look like this,</p>
<pre class="brush: xml;">
&lt;iframe id=&quot;my-iframe&quot; src=&quot;my_page_to_iframe.php&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot; &gt;&lt;/iframe&gt;
</pre>
<p>Thats it! If the sites are on two domains, take a look at <a href="http://cultivatewebdesign.com.au/blog/cross-site-scripting-hack/">this post</a> to get around that.</p>
]]></content:encoded>
			<wfw:commentRss>http://cultivatewebdesign.com.au/blog/resize-iframe-to-fit-content-all-code-in-parent-window/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

