<?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>scurker.com</title>
	<atom:link href="http://scurker.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://scurker.com</link>
	<description>Blog &#38; Portfolio of Jason Wilson</description>
	<lastBuildDate>Fri, 04 Jun 2010 05:12:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Particle Generator using HTML5&#8217;s Canvas</title>
		<link>http://scurker.com/blog/2010/06/particle-generator-using-html5s-canvas/</link>
		<comments>http://scurker.com/blog/2010/06/particle-generator-using-html5s-canvas/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 05:10:51 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://scurker.com/?p=251</guid>
		<description><![CDATA[Particle effects are pretty awesome. Particles by themselves are fairly simple, but by generating multitudes of particles with set variables you can create a range of effects such as fire, smoke, or water. A particle generator or emitter allows you to adjust the variables giving you control over the types of effects you can generate.
I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Particle effects are pretty awesome. Particles by themselves are fairly simple, but by generating multitudes of particles with set variables you can create a range of effects such as fire, smoke, or water. A particle generator or emitter allows you to adjust the variables giving you control over the types of effects you can generate.</p>
<p><a href="/projects/particles"><img class="alignleft" src="/images/particles.png" alt="Particle Generator" title="Particle Generator"/></a>I&#8217;ve been working on another project that needed a particle generator, thus this demonstration was born.</p>
<p>There are several presets I&#8217;ve included, but you can easily generate new types of effects by playing around with the available variables on the presets.</p>
<p>The demo does not give you access to everything so in order to create more fine tuned options, here&#8217;s all the currently available variables:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
  shape<span style="color: #339933;">:</span> <span style="color: #3366CC;">'circle'</span><span style="color: #339933;">,</span>		  <span style="color: #006600; font-style: italic;">// square or circle</span>
  velocity<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Vector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>y<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #006600; font-style: italic;">// movement vector; only y is used</span>
  xVariance<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>			  <span style="color: #006600; font-style: italic;">// +/- start x position (random)</span>
  yVariance<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>			  <span style="color: #006600; font-style: italic;">// +/- start y position (random)</span>
  spawnSpeed<span style="color: #339933;">:</span> <span style="color: #CC0000;">25</span><span style="color: #339933;">,</span>		  <span style="color: #006600; font-style: italic;">// # particles spawned per cycle</span>
  generations<span style="color: #339933;">:</span> <span style="color: #CC0000;">100000</span><span style="color: #339933;">,</span>		  <span style="color: #006600; font-style: italic;">// # of cycles to run for</span>
  maxParticles<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>		  <span style="color: #006600; font-style: italic;">// max # of particles allowed on screen</span>
  size<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span>			  <span style="color: #006600; font-style: italic;">// size of particles</span>
  sizeVariance<span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>		  <span style="color: #006600; font-style: italic;">// +/- size of particles (random)</span>
  life<span style="color: #339933;">:</span> <span style="color: #CC0000;">30</span><span style="color: #339933;">,</span>			  <span style="color: #006600; font-style: italic;">// # of cycles a particle can live</span>
  lifeVariance<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>    		  <span style="color: #006600; font-style: italic;">// +/- lifetime of particle (random)</span>
  direction<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>			  <span style="color: #006600; font-style: italic;">// initial start direction</span>
  directionVariance<span style="color: #339933;">:</span> <span style="color: #CC0000;">15</span><span style="color: #339933;">,</span>          <span style="color: #006600; font-style: italic;">// +/- direction (random)</span>
  color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#fff'</span><span style="color: #339933;">,</span>		  <span style="color: #006600; font-style: italic;">// can be hex code or rgb</span>
  opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span>			  <span style="color: #006600; font-style: italic;">// particle opacity</span>
  onDraw<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// onDraw passes in the current particle and is called before each</span>
    <span style="color: #006600; font-style: italic;">// particle is displayed on the screen. This function is used in </span>
    <span style="color: #006600; font-style: italic;">// several of the presets to adjust the color or opacity given</span>
    <span style="color: #006600; font-style: italic;">// the particle's current age and lifespan.</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>If you are using Firefox and Firebug, you can create your own objects and update the particle generator by using <code>particles.update(myObject);</code> via the command line.</p>
<p>As usual, HTML5 and Canvas is not currently supported by IE7/IE8, so you&#8217;ll need to use another browser in order for this to work. The demo has been tested in Firefox, Safari and Chrome, but I highly recommend using Chrome for the demo as it seems to run the most efficient.</p>
<p><a href="/projects/particles">On to the demo!</a> Or alternatively, view the source <a href="/projects/particles/js/particle.js">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurker.com/blog/2010/06/particle-generator-using-html5s-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Clock using HTML5 and Canvas</title>
		<link>http://scurker.com/blog/2010/04/javascript-clock-using-html5-and-canvas/</link>
		<comments>http://scurker.com/blog/2010/04/javascript-clock-using-html5-and-canvas/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:09:27 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://scurker.com/?p=191</guid>
		<description><![CDATA[
  $(window).ready(function() {
    new jClock('/projects/jclock/clock.png', $('canvas').get(0));
  });


  #jclock {
    padding-top: 15px;
    padding-right: 15px;
    float: left;
  }

I&#8217;ve been finding myself becoming more interested in what HTML5 can do. As I see it HTML5 stands to be a potential replacement for [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="/projects/jclock/jclock.js"></script><script type="text/javascript">
  $(window).ready(function() {
    new jClock('/projects/jclock/clock.png', $('canvas').get(0));
  });
</script></p>
<style type="text/css">
  #jclock {
    padding-top: 15px;
    padding-right: 15px;
    float: left;
  }
</style>
<p>I&#8217;ve been finding myself becoming more interested in what HTML5 can do. As I see it HTML5 stands to be a potential replacement for flash, in addition to the features and interactivity that are made available by various javascript frameworks out there.</p>
<p>A good starting point would be to start off with something simple, i.e. a clock. Here&#8217;s a sample project I threw together to help make myself more familiar with HTML5&#8217;s canvas.</p>
<div id="jclock">
  <canvas height="125" width="125"><img src="/projects/jclock/clock.png" alt="HTML5 isn't supported!" title="HTML5 isn't supported!"/></canvas>
</div>
<p>The clock you see on the left is written completely in javascript and takes advantage of <a href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">HTML5 and the canvas element</a> &#8212; no flash necessary.</p>
<p>If you see a blank clock face with no hands, that means that your browser does not support HTML5. You will need to be using the latest version of <a href="http://www.google.com/chrome">Chrome</a>, <a href="http://getfirefox.com">Firefox</a>, <a href="http://opera.com">Opera</a> or <a href="http://apple.com/safari">Safari</a> in order for the clock to work. IE does not currently natively support the canvas element.</p>
<p>There are <a href="https://developer.mozilla.org/en/Canvas_tutorial">several</a> <a href="http://developer.apple.com/mac/library/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/Canvas.html">good</a> <a href="http://dev.opera.com/articles/view/html-5-canvas-the-basics/">canvas</a> <a href="http://carsonified.com/blog/dev/html-5-dev/how-to-draw-with-html-5-canvas/">tutorials</a> out there so please check those if you want a more in-depth introduction to HTML5&#8217;s canvas element.</p>
<p>In order to use this clock, you&#8217;ll need to setup your canvas element:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;canvas id=&quot;jclock&quot; height=&quot;125&quot; width=&quot;125&quot;&gt;
  Content or message to display if the browser does not support Canvas/HTML5.
&lt;/canvas&gt;</pre></div></div>

<p>Initializing the clock:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">new</span> jClock<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'my-clock-face-image.png'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#jclock'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can also pass in additional options to change items such as the hand colors, or image size. Here&#8217;s the defaults as defined in the plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// override default options:</span>
<span style="color: #006600; font-style: italic;">// i.e. new jClock('image.png', $('#canvas').get(0), {shadow: false});</span>
&nbsp;
jClock.<span style="color: #660066;">defaults</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>   
  height<span style="color: #339933;">:</span> <span style="color: #CC0000;">125</span><span style="color: #339933;">,</span>       <span style="color: #006600; font-style: italic;">// default height</span>
  width<span style="color: #339933;">:</span> <span style="color: #CC0000;">125</span><span style="color: #339933;">,</span>        <span style="color: #006600; font-style: italic;">// default width</span>
  secondHand<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>  <span style="color: #006600; font-style: italic;">// show the second hand</span>
  shadow<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>      <span style="color: #006600; font-style: italic;">// display shadows across all hands</span>
  second<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>          <span style="color: #006600; font-style: italic;">// second hand style options</span>
    color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#f00'</span><span style="color: #339933;">,</span>
    width<span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span>
    start<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>
    end<span style="color: #339933;">:</span> <span style="color: #CC0000;">35</span><span style="color: #339933;">,</span>
    alpha<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  minute<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>          <span style="color: #006600; font-style: italic;">// minute hand style options</span>
    color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#fff'</span><span style="color: #339933;">,</span>
    width<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span>
    start<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span>
    end<span style="color: #339933;">:</span> <span style="color: #CC0000;">30</span><span style="color: #339933;">,</span>
    alpha<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  hour<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>            <span style="color: #006600; font-style: italic;">// hour hand style options</span>
    color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#fff'</span><span style="color: #339933;">,</span>
    width<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">,</span>
    start<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span>
    end<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span>
    alpha<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span>
  <span style="color: #009900;">&#125;</span>     
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Feel free to download the source code and play around with it, or ask any questions you may have in the comments below.</p>
<p><a href="/projects/jclock/jclock.js">Download jclock.js (2.4k)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scurker.com/blog/2010/04/javascript-clock-using-html5-and-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Planterguy.com</title>
		<link>http://scurker.com/blog/2010/03/planterguy-com/</link>
		<comments>http://scurker.com/blog/2010/03/planterguy-com/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:45:16 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://scurker.com/?p=36</guid>
		<description><![CDATA[ I&#8217;m proud to add planterguy.com to my portfolio! Planterguy is the blog of Guy Walker who works with the Association of Related Churches.
I was more than happy to put together this wordpress theme for Guy Walker and wanted a &#8220;dirty&#8221; feel to go along with the name &#8220;planterguy&#8221;. Theme was built from the ground [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.planterguy.com"><img class="alignright" title="planterguy.com" src="http://scurker.com/images/planterguy.png" alt="planterguy" width="230" height="164" /></a> I&#8217;m proud to add <a href="http://planterguy.com">planterguy.com</a> to my portfolio! Planterguy is the blog of Guy Walker who works with the <a href="http://www.relatedchurches.com/">Association of Related Churches</a>.</p>
<p>I was more than happy to put together this wordpress theme for Guy Walker and wanted a &#8220;dirty&#8221; feel to go along with the name &#8220;planterguy&#8221;. Theme was built from the ground up and includes several custom widgets tuned for Guy Walker&#8217;s needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurker.com/blog/2010/03/planterguy-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration from Drupal 6.x to Wordpress 2.9x</title>
		<link>http://scurker.com/blog/2010/02/migration-from-drupal-6-x-to-wordpress-2-9x/</link>
		<comments>http://scurker.com/blog/2010/02/migration-from-drupal-6-x-to-wordpress-2-9x/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 17:22:58 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://scurker.com/?p=50</guid>
		<description><![CDATA[I recently found myself wanting to move my personal blog (blog.scurker.com) from Drupal 6.x to Wordpress for various reasons. I primarily followed this tutorial, but wanted to outline some additional information in the transfer.
Database Conversion Table



Drupal 6.x Table(s)
Wordpress 2.9x Equivalent




term_data, term_hierarchy
wp_terms


node, node_revisions
wp_posts


term_node
wp_term_relationships


comments
wp_comments



Truncate Wordpress Tables
First, I needed to remove any data that is currently in certain [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found myself wanting to move my personal blog (<a href="http://blog.scurker.com">blog.scurker.com</a>) from <a href="http://drupal.org">Drupal 6.x</a> to <a href="http://wordpress.org">Wordpress</a> for various reasons. I primarily followed <a href="http://socialcmsbuzz.com/convert-import-a-drupal-6-based-website-to-wordpress-v27-20052009/">this tutorial</a>, but wanted to outline some additional information in the transfer.</p>
<h2>Database Conversion Table</h2>
<table class="data-table">
<thead>
<tr>
<th>Drupal 6.x Table(s)</th>
<th>Wordpress 2.9x Equivalent</th>
</tr>
</thead>
<tbody>
<tr>
<td>term_data, term_hierarchy</td>
<td>wp_terms</td>
</tr>
<tr>
<td>node, node_revisions</td>
<td>wp_posts</td>
</tr>
<tr>
<td>term_node</td>
<td>wp_term_relationships</td>
</tr>
<tr>
<td>comments</td>
<td>wp_comments</td>
</tr>
</tbody>
</table>
<h2>Truncate Wordpress Tables</h2>
<p>First, I needed to remove any data that is currently in certain wordpress tables so I could work with a fresh slate.</p>
<p><strong>Note:</strong> By default when you install wordpress all tables are prefixed with <code>wp_</code> unless you changed it to something else. The below queries will need to be modified if you used anything else other than <code>wp_</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_comments;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_postmeta;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_posts;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_term_relationships;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_term_taxonomy;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_terms;</pre></div></div>

<h2>Import Taxonomy Terms</h2>
<p>The next sets of queries imports taxonomy terms.</p>
<p><strong>Note:</strong> Table names pre-pended with <code>drupal.</code> needs to be the actual name of your drupal database. You will need to change this to whatever you have your drupal database named.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_terms <span style="color: #66cc66;">&#40;</span>term_id<span style="color: #66cc66;">,</span> name<span style="color: #66cc66;">,</span> slug<span style="color: #66cc66;">,</span> term_group<span style="color: #66cc66;">&#41;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> d<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> d<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>LOWER<span style="color: #66cc66;">&#40;</span>d<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">' '</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'-'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span>
  <span style="color: #993333; font-weight: bold;">FROM</span> drupal<span style="color: #66cc66;">.</span>term_data d
  <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> drupal<span style="color: #66cc66;">.</span>term_hierarchy h
  <span style="color: #993333; font-weight: bold;">USING</span><span style="color: #66cc66;">&#40;</span>tid<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>By default, Wordpress has several taxonomy types available; <code>categories</code>, <code>post_tag</code>, and <code>link_category</code>. In my Drupal instance I used taxonomy primarily as tags, but you may have a different need. You may need to modify the 3rd line in the below query depending on how you want taxonomies imported:</p>
<ul>
<li><strong>Categories</strong>: <code>category</code></li>
<li><strong>Link Categories</strong>: <code>link_category</code></li>
<li><strong>Post Tags</strong>: <code>post_tag</code></li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_term_taxonomy <span style="color: #66cc66;">&#40;</span>term_taxonomy_id<span style="color: #66cc66;">,</span> term_id<span style="color: #66cc66;">,</span> taxonomy<span style="color: #66cc66;">,</span> 
                              description<span style="color: #66cc66;">,</span> parent<span style="color: #66cc66;">&#41;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> d<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> d<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'post_tag'</span><span style="color: #66cc66;">,</span> d<span style="color: #66cc66;">.</span>description<span style="color: #66cc66;">,</span> h<span style="color: #66cc66;">.</span>parent
  <span style="color: #993333; font-weight: bold;">FROM</span> drupal<span style="color: #66cc66;">.</span>term_data d
  <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> drupal<span style="color: #66cc66;">.</span>term_hierarchy h
  <span style="color: #993333; font-weight: bold;">USING</span><span style="color: #66cc66;">&#40;</span>tid<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h2>Import Post Content</h2>
<p>Drupal allows for custom post types, while as of Wordpress 2.9x, custom post types are only available via plugins. You can use the below query unmodified and it will convert all stories to posts, and everything else will transfer over as is. If you need to convert additional post types, you can add additional case statements.</p>
<p>Example:<br />
<code>WHEN 'book' THEN 'post'</code></p>
<p>I also adjusted the query so that &#8216;post_date_gmt&#8217; would be populated correctly based on my GMT offset of -6:00 (Central Time). If you are in a different timezone you will need to adjust <code>FROM_UNIXTIME(created+21600)</code> to subtract or add correctly based on your location.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span>
    wp_posts <span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">,</span> post_date<span style="color: #66cc66;">,</span> post_date_gmt<span style="color: #66cc66;">,</span> post_content<span style="color: #66cc66;">,</span> post_title<span style="color: #66cc66;">,</span>
    post_excerpt<span style="color: #66cc66;">,</span> post_name<span style="color: #66cc66;">,</span> post_type<span style="color: #66cc66;">,</span> post_modified<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span>
    n<span style="color: #66cc66;">.</span>nid<span style="color: #66cc66;">,</span> FROM_UNIXTIME<span style="color: #66cc66;">&#40;</span>created<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> 
    FROM_UNIXTIME<span style="color: #66cc66;">&#40;</span>created<span style="color: #66cc66;">+</span><span style="color: #cc66cc;">21600</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> body<span style="color: #66cc66;">,</span> n<span style="color: #66cc66;">.</span>title<span style="color: #66cc66;">,</span> teaser<span style="color: #66cc66;">,</span> LOWER<span style="color: #66cc66;">&#40;</span>n<span style="color: #66cc66;">.</span>title<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
    <span style="color: #66cc66;">&#40;</span>CASE n<span style="color: #66cc66;">.</span>type
      WHEN <span style="color: #ff0000;">'story'</span> THEN <span style="color: #ff0000;">'post'</span>
      ELSE n<span style="color: #66cc66;">.</span>type
    END<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> type<span style="color: #66cc66;">,</span>
    FROM_UNIXTIME<span style="color: #66cc66;">&#40;</span>changed<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">FROM</span> drupal<span style="color: #66cc66;">.</span>node n<span style="color: #66cc66;">,</span> drupal<span style="color: #66cc66;">.</span>node_revisions r
<span style="color: #993333; font-weight: bold;">WHERE</span> n<span style="color: #66cc66;">.</span>vid <span style="color: #66cc66;">=</span> r<span style="color: #66cc66;">.</span>vid;</pre></div></div>

<h2>Import Post and Taxonomy Relationships</h2>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_term_relationships <span style="color: #66cc66;">&#40;</span>object_id<span style="color: #66cc66;">,</span> term_taxonomy_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> nid<span style="color: #66cc66;">,</span> tid <span style="color: #993333; font-weight: bold;">FROM</span> drupal<span style="color: #66cc66;">.</span>term_node;</pre></div></div>

<h2>Category Count Updating</h2>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> wp_term_taxonomy tt
  <span style="color: #993333; font-weight: bold;">SET</span> count <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> COUNT<span style="color: #66cc66;">&#40;</span>tr<span style="color: #66cc66;">.</span>object_id<span style="color: #66cc66;">&#41;</span>
    <span style="color: #993333; font-weight: bold;">FROM</span> wp_term_relationships tr
    <span style="color: #993333; font-weight: bold;">WHERE</span> tr<span style="color: #66cc66;">.</span>term_taxonomy_id <span style="color: #66cc66;">=</span> tt<span style="color: #66cc66;">.</span>term_taxonomy_id
  <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h2>Import Comments</h2>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_comments <span style="color: #66cc66;">&#40;</span>comment_post_ID<span style="color: #66cc66;">,</span> comment_date<span style="color: #66cc66;">,</span> 
            comment_content<span style="color: #66cc66;">,</span> comment_parent<span style="color: #66cc66;">,</span> comment_author<span style="color: #66cc66;">,</span> 
            comment_author_email<span style="color: #66cc66;">,</span> comment_author_url<span style="color: #66cc66;">,</span> comment_approved<span style="color: #66cc66;">&#41;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> nid<span style="color: #66cc66;">,</span> FROM_UNIXTIME<span style="color: #66cc66;">&#40;</span>timestamp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> comment<span style="color: #66cc66;">,</span> thread<span style="color: #66cc66;">,</span> 
              name<span style="color: #66cc66;">,</span> mail<span style="color: #66cc66;">,</span> homepage<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">STATUS</span> 
  <span style="color: #993333; font-weight: bold;">FROM</span> drupal<span style="color: #66cc66;">.</span>comments;</pre></div></div>

<h2>Update Comment Count</h2>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> wp_posts 
  <span style="color: #993333; font-weight: bold;">SET</span> comment_count <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> COUNT<span style="color: #66cc66;">&#40;</span>comment_post_id<span style="color: #66cc66;">&#41;</span> 
  <span style="color: #993333; font-weight: bold;">FROM</span> wp_comments 
  <span style="color: #993333; font-weight: bold;">WHERE</span> wp_posts<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> wp_comments<span style="color: #66cc66;">.</span>comment_post_id<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h2>Update Post Slugs</h2>
<p>Drupal&#8217;s URL aliases is equivalent to Wordpress&#8217; permalinks. Drupal has a much more aggressive title sanitation than Wordpress. I wanted the ability to keep my titles the same for SEO reasons when migrating over to Wordpress.</p>
<p>In order to keep my old titles, I need to hook into Wordpress&#8217; <a href="http://codex.wordpress.org/Function_Reference/sanitize_title">title sanitation</a> with similar rules to Drupal. The below code will need to be placed somewhere in the <code>functions.php</code> file of your current theme.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sanitize_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_sanitize_title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_sanitize_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\b(a|an|as|at|before|but|by|for|from|is|in|into|like|of|off|on|onto|per|since|than|the|this|that|to|up|via|with)\b/i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/-+/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'-'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You will need to save the below code to a file i.e. &#8220;fix-slugs.php&#8221; in your main Wordpress directory and run it through your browser.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
&nbsp;
  <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp-load.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$posts</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">&quot;SELECT ID, post_title, post_name FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span>&quot;</span>
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$ignored</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$errors</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$posts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post</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: #990000;">strcmp</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$slug</span> <span style="color: #339933;">=</span> sanitize_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_name</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: #009900;">&#123;</span>
      <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_errors</span><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: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UPDATE <span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span> SET post_name='<span style="color: #006699; font-weight: bold;">$slug</span>' WHERE ID=<span style="color: #006699; font-weight: bold;">$post-&gt;ID</span>&quot;</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: #000088;">$errors</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$ignore</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: #000088;">$count</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000088;">$ignored</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;strong&gt;<span style="color: #006699; font-weight: bold;">$count</span> post slug(s) sanitized.&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$ignored</span> post(s) ignored.&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$errors</span> error(s).&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you were following along with <a href="http://socialcmsbuzz.com/convert-import-a-drupal-6-based-website-to-wordpress-v27-20052009/">this tutorial</a>, I&#8217;ve made a few changes based on my Drupal setup using <a href="http://codex.wordpress.org/Database_Description">Wordpress database description</a> as a reference when I ran into issues. There may be some additional steps to be completed if you uploaded images through Drupal&#8217;s interface, but the above queries were able to successfully migrate my data from Drupal to Wordpress.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurker.com/blog/2010/02/migration-from-drupal-6-x-to-wordpress-2-9x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A New Beginning</title>
		<link>http://scurker.com/blog/2010/01/a-new-beginning/</link>
		<comments>http://scurker.com/blog/2010/01/a-new-beginning/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 21:38:17 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[scurker.com]]></category>

		<guid isPermaLink="false">http://scurker.com/?p=20</guid>
		<description><![CDATA[You&#8217;ve undoubtedly reached this site through either word of mouth, or via my personal blog, but I&#8217;d like to formally welcome you to the new scurker.com! I&#8217;ve been hard at work over the past week in order to get everything up and running and am happy to finally be at this point.
One of my big [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve undoubtedly reached this site through either word of mouth, or via my <a href="http://blog.scurker.com">personal blog</a>, but I&#8217;d like to formally welcome you to the new scurker.com! I&#8217;ve been hard at work over the past week in order to get everything up and running and am happy to finally be at this point.</p>
<p>One of my big reasons for rolling over to a new design was the limitations my old site was giving me. I wanted to have a new fresher design in addition to having more flexibility with the content on the site. Now with the addition of <a href="http://wordpress.org">Wordpress</a>, I can easily outline new projects or post about some dramatic revolution in web design. In addition the new site will help me give a better showcase for my skills and abilities for any future clients and/or employers.</p>
<p>You are not seeing the final version of this roll-out, but features will slowly be added as I get time. Please feel free to post a comment if you notice any issues, or <a href="/contact">contact me</a> if you have any opportunities you would like to discuss.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurker.com/blog/2010/01/a-new-beginning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
