<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Pirate Cove</title>
	
	<link>http://piratecove.org</link>
	<description>A Safe Haven for Designers and Programmers</description>
	<lastBuildDate>Mon, 19 Apr 2010 14:17:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PirateCove" /><feedburner:info uri="piratecove" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>GMail Offline Backups</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/hM5b1kN0iiM/</link>
		<comments>http://piratecove.org/gmail-offline-backups/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 13:13:12 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[fetchmail]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=173</guid>
		<description><![CDATA[We all know that GMail has offline mode. But in my case it wasn't exactly what I wanted. What I was looking for was a way to backup my GMail as well make it searchable while offline. In this tutorial I'll show you how to configure your OSX system to download your GMail as well as configuring Thunderbird to read the mail.]]></description>
			<content:encoded><![CDATA[<p>We all know that GMail has offline mode. But in my case it wasn&#8217;t exactly what I wanted. What I was looking for was a way to backup my GMail as well make it searchable while offline.</p>
<p>To accomplish this I looked into what it would take to get a script running that I could schedule on my MBP to have it jump out and download my email every day.<br />
<span id="more-173"></span><br />
This is going to require you to be comfortable using the command line so take that as the one of the first warnings of this post. What we will be doing in this tutorial is as follows.</p>
<p>1. Install Proper Certificates on our system so we can connect to GMail via the command line<br />
2. Configure fetchmail to properly download email<br />
3. Configure Thunderbird to read our newly downloaded email</p>
<p>The prep work will be to download and install Thunderbird. Feel free to use whatever standalone mail reader that you are familiar with but I&#8217;ll be showing what it takes to get Thunderbird to work.</p>
<p><strong>Installing Certificates</strong></p>
<p>First thing we need to do is to go download the root certificate and ensure its installed in our system for this tutorial. Go out to <a href="https://www.geotrust.com/resources/root-certificates/index.html" target="_blank">GeoTrust</a> and <a href="https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer" target="_blank">download the certificate.</a></p>
<p>Open the commandline and we&#8217;ll create the directory that we need to save these certificates into.</p>
<pre class="brush: php">mkdir ~/.ssl/certs/</pre>
<p>Download the previous certificate into that folder but ensure that the extension is now &#8216;.pem&#8217;. Now we need to gather the appropriate GMail certificates.</p>
<pre class="brush: php">openssl s_client -connect pop.gmail.com:995 -showcerts</pre>
<p>You will find two sections like this.</p>
<pre class="brush: php">-----BEGIN CERTIFICATE-----
[large text block]
-----END CERTIFICATE-----</pre>
<p>Save the first one as googlepop.pem in the same folder as the last certificate.</p>
<p>Rehash this folder with c_rehash.</p>
<pre class="brush: php">c_rehash ~/.ssl/certs/</pre>
<p>This is where I encountered my first problem with this tutorial. When I ran that command I got a &#8216;bad command interpreter&#8217; error. The scripting nerd that I am knew that it meant the first line in the c_rehash script wasnt pointing at the right thing. So I went to check on it and it had this.</p>
<pre class="brush: php">#!/usr/bin/perl5</pre>
<p>Well there is no file there, nor a link named perl5 to the current perl5 version installed on my system. So rather than just creating a link I decided to just edit the c_rehash script. But to do this you need root access at the command line in OSX. To enabled root on your OSX machine follow this KB article.</p>
<p><a href="http://support.apple.com/kb/HT1528" target="_blank">http://support.apple.com/kb/HT1528</a></p>
<p>After that is done you can switch to root like any normal Unix system and then update the file however you are comfortable with, vi/sed/awk/etc.</p>
<p><strong>Configuring Fetchmail</strong></p>
<p>Create the following file and set the permissions</p>
<pre class="brush: php">~/.fetchmailrc
chmod 710 ~/.fetchmailrc</pre>
<p>Enter the following text in the fetchmailrc file that we just created.</p>
<pre class="brush: php">poll pop.gmail.com with proto POP3 and options no dns user 'GMAIL_USERNAME@gmail.com' there with password 'GMAIL_PASSWORD' is 'LOCAL_USERNAME' here and wants mda "/usr/bin/procmail -d %T"  options ssl keep sslcertck sslcertpath "/Users/LOCAL_USERNAME/.ssl/certs"</pre>
<p>Update the following Variables with your appropriate information</p>
<p>GMAIL_USERNAME = Your GMail username<br />
GMAIL_PASSWORD = Your GMail password<br />
LOCAL_USERNAME = Your username on your system</p>
<p><strong>Configure Thunderbird</strong></p>
<p>In Thunderbird, go to Tools &gt; Account Settings &gt; Local Folders to get to the Local directory path. Go into this directory and create a symbolic link there that points to the mail spool file (/var/mail/LOCAL_USERNAME)</p>
<pre class="brush: php">cd [Folder you just found above]
ln -s /var/mail/LOCAL_USERNAME ./GMailBackups</pre>
<p>Now wend you open Thunderbird, down in the Local Folders section you will see a new folder named &#8216;GMailBackups&#8217; and it will contain all the email that you have downloaded. But we haven&#8217;t downloaded any yet! Here is how you will download your email.</p>
<p><strong>Downloading Email</strong><br />
Downloading it is simple, just run the following command.</p>
<pre class="brush: php">fetchmail -v</pre>
<p>If you are like most OSX users you have <a href="http://growl.info/">Growl</a> installed. You can write wrapper scripts in whatever language that they support to hook into Growl and show status updates as fetchmail pulls down your mail. I need to write a nice wrapper for this still.</p>
<p><strong>Scheduling the Mail Backups</strong><br />
If you have a scheduler installed already on your system that you are comfortable with feel free to use that. You can also set it up in crontab. Rather than give a tutorial on crontab here, I&#8217;ll just send you guys <a href="http://www.tutorial5.com/content/view/95/51/" target="_blank">here</a>.</p>
<p><strong>Thoughts</strong></p>
<p>The first time you will run the script you will need to run it multiple times depending how much mail you have. It was only downloading 300-500 emails at a time for me. The script was also taking about 5 minutes to run each time as well. So after a few runs everything was done and when I fired up Thunderbird all the email was there in my nice little archive.</p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/hM5b1kN0iiM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/gmail-offline-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/gmail-offline-backups/</feedburner:origLink></item>
		<item>
		<title>Testing IE Versions on OSX</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/oqz2BIcLoio/</link>
		<comments>http://piratecove.org/testing-ie-versions-on-osx/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 04:52:04 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[pc]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[virtual pc]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=166</guid>
		<description><![CDATA[While designing your current project at some point you get to the point where you need to start doing browser testing.  I recently wanted to find a way to get the various versions of Internet Explorer running on my new MacBook and decided to share with you the process I came up with for [...]]]></description>
			<content:encoded><![CDATA[<p>While designing your current project at some point you get to the point where you need to start doing browser testing.  I recently wanted to find a way to get the various versions of Internet Explorer running on my new MacBook and decided to share with you the process I came up with for getting this all setup.<br />
<span id="more-166"></span><br />
Before I started in on this process I had already installed <a href="http://www.vmware.com/products/fusion/">VMware Fusion</a> to install a copy of Windows Vista to run various applications and browsers.  My initial thoughts were to see if someone had created some Fusion Virtual Machines (VMs) and I could just use those.</p>
<p>After some searching I found that <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;displaylang=en">Microsoft actually created VMs</a> for the various versions of Internet Explorer for testing and development.  Yes, I was amazed as you are when I found this out.  The bad part is that they are Virtual PC (VPC) VMs and incompatible with VMware Fusion.  That is expected, and works fine if you develop on Windows 100% of the time and you can install VPC (Windows Only).  I wanted to see if I could get these up and running in VMware Fusion, so that they could run along with my other VMs.</p>
<p>In doing the research to figure out how to do this I came across a nice tool that we can use to convert the Microsoft VMs to VMware VMs.  The application is called Q (<a href="http://www.kju-app.org/">found here</a>) and we will use one of the command line tools it installs on your system.  It does also have a nice GUI for managing some VMs and doing other things but we will only need one of the command line tools to get this job done.</p>
<p>There is a tricky part to this if you intend to do it all on your Mac.  You will need to find an application that can extract windows .exe files that are just fancy zip files as the default one on the Mac cannot handle these files.  I already had a Windows Vista VM running so I just downloaded and extracted it in there and then moved it to the shared folder between the VM and my Mac. However you manage this process is up to you and should be fairly straightforward.</p>
<p>Keep in mind that while these files, even extracted aren&#8217;t that large you will need 10-20GB free per VM instance you want to setup. Now that we have the VPC file on our Mac we can use Q to convert it to a VMware VM.</p>
<p>Open a Terminal session and switch into the directory that has the VPC file.  Use the following command to convert the image, this process should not take that long on newer hardware, 5-10 minutes.</p>
<p>/Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk -f vpc [VPC File] [VMDK Outfile]</p>
<p>- VPC File is the file name of the downloaded file<br />
- VMDK Outfile is the name of the new image, with the .vmdk extension</p>
<p>Now you can start up VMware Fusion and create a new VM.  When asked about the disk you select to use an existing disk and select the new VMDK file that you created.</p>
<p>Power the VM on and when it has finished prompting you to install drivers, install the VMware Tools and reboot.  You will get some more driver errors and there are a few ways to handle these.  This is really only being setup to test IE, which will work fine at this point, so you have a few options.  You can simply disable all the devices in question in the Device Manager and leave it alone or you can start hunting down files.  </p>
<p>The hunting that you need to do  will get you to download the latest service pack for the OS and keep the extracted files somewhere in the VM, and also an original WIndows CD of that particular version.  I just went ahead and used the Service Pack and skipped the CD part, it cleared up some things and the others were just disabled.  After all of these things were done I must say that I have a very stable version of Windows XP with IE6.</p>
<p>The catch with these Windows VMs is that they are set to expire after a certain amount of time.  So you will need to take note of that when you download them and then repeat this process as you need it.  This has been a much cleaner process than I have seen so far.</p>
<p>I hope this helps you out and makes your designing and development go easier.  Here again are the tools you need to download to get this up and running .</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&#038;displaylang=en">Internet Explorer Application Compatibility VPC Images</a></li>
<li><a href="http://www.vmware.com/products/fusion/">VMware Fusion</a></li>
<li><a href="http://www.kju-app.org/">Q</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/oqz2BIcLoio" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/testing-ie-versions-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/testing-ie-versions-on-osx/</feedburner:origLink></item>
		<item>
		<title>My Tools</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/bHpt8kxxBKM/</link>
		<comments>http://piratecove.org/my-tools/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 05:00:53 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[editors]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=157</guid>
		<description><![CDATA[I think everyone that does some design work and/or programming inevitably gets asked by their peers and other friends starting out, what kind of tools they use.  After doing this for awhile there are a few things that you figure out, and mostly it is that your tools change as you change.  But [...]]]></description>
			<content:encoded><![CDATA[<p>I think everyone that does some design work and/or programming inevitably gets asked by their peers and other friends starting out, what kind of tools they use.  After doing this for awhile there are a few things that you figure out, and mostly it is that your tools change as you change.  But there are some staples in the list that I&#8217;m sure many of you will recognize.  Let&#8217;s take a look at the applications I use on a daily basis.</p>
<p><span id="more-157"></span></p>
<p><u>Text Editor</u><br />
<a href="http://notepad-plus.sourceforge.net" target="_blank">Notepad++</a></p>
<p>This is probably the single most changing section of this list over the years.  Notable past editors were TextPad and UltraEdit.  Notepad++ replaced them with its light footprint, speed and all of its plugins and functionality.  Really great editor for editing just about anything very quickly when you dont need or want to fire up your entire IDE.</p>
<p><u>IDE</u><br />
<a href="http://www.eclipse.org" target="_blank">Eclipse</a></p>
<p>This entire section really didn&#8217;t even exist for me until a few years ago.  It was about 2007 when I started looking into PHP IDE&#8217;s specifically.  At the time I was using Zend&#8217;s IDE, which is great in its own right.  I moved to Eclipse, for one, because it is free and well maintained.  It is still very robust but more lightweight than Zend&#8217;s IDE.  Eclipse also has a nice plugin system which even makes it integrate very well with the Subversion system I have setup.</p>
<p><u>Code Repository</u><br />
<a href="http://subversion.tigris.org/" target="_blank">Subversion</a></p>
<p>Most of you know what a Code Repository is or even know what CVS might be.  Long and short of it is that a code repository is where you store you code when you are working on it.  Then whomever is working on it can check files in/out and update files as needed without having to worry about who else is working on the files.  It can get more complicated and involved than that but that is as deep as we will get in to it today.  I never really had a need for one.  But as I started working on larger projects, even by myself, and from different computers/locations, it has already proven itself invaluable.  Combine this with the plugin to Eclipse and I can check files in/out of my repository and update them right there in my IDE.</p>
<p><u>FTP Client</u><br />
<a href="http://www.flashfxp.com" target="_blank">Flash FXP</a></p>
<p>Some things are better not updated and stored in the Code Repository, for example images.  Along with doing many other things you&#8217;ll still need a decent FTP client and let&#8217;s be honest, there are quite a few terrible ones out there.  I have been using Flash FXP for years and recommend it to everyone.  Tons of features, security options, everything you can think of as well as supporting server to server transfers (assuming your server support this behavior).  This is trialware, but is worth every penny!</p>
<p><u>Design / Graphics</u><br />
<a href="http://www.adobe.com/products/photoshop/photoshopextended/" target="_blank">Adobe Photoshop</a><br />
<a href="http://www.adobe.com/products/illustrator/" target="_blank">Adobe Illustrator</a></p>
<p>I could go into a lot of detail here but I think we all know what these are great for.  I typically use Photoshop for all my site mockups.  Illustrator gets used for logos as well as print media.</p>
<p>So what do you use?</p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/bHpt8kxxBKM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/my-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/my-tools/</feedburner:origLink></item>
		<item>
		<title>Leveraging Google’s AJAX Library API</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/YprqkUER31g/</link>
		<comments>http://piratecove.org/leveraging-googles-ajax-library-api/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 23:43:34 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=133</guid>
		<description><![CDATA[When you get to writing a website you inevitably get to the point of needing to include some libraries to help you out.  Before now everyone had to go get these libraries in some form or another and include them in their code in their own way.  Now with Google&#8217;s AJAX Library API [...]]]></description>
			<content:encoded><![CDATA[<p>When you get to writing a website you inevitably get to the point of needing to include some libraries to help you out.  Before now everyone had to go get these libraries in some form or another and include them in their code in their own way.  Now with Google&#8217;s AJAX Library API you no longer need to host or even track these files down any longer.<br />
<span id="more-133"></span><br />
The downside to hosting these files yourself is for one, maintenance.  Are you sure you are keeping your libraries up to date?  Secondly you&#8217;d have to host and serve at times a 100k+ file from your site to everyone.  This can take some people awhile to get.  Why not leverage Google&#8217;s CDN to get these libraries distributed to your readers?  If your readers are visiting lots of sites that are using this method they will only have to cache one version as well.</p>
<p>For most cases, using this method should speed up your site, your users experience and your development time.  It is very simple to implement, let&#8217;s take a look at what it takes.</p>
<p>First you need this line no matter what library you want to load.</p>
<pre class="brush: html">
&lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;
</pre>
<p><a href="http://code.google.com/apis/ajaxlibs/documentation/">Google&#8217;s Documentation for their API</a> has the current list of supported versions and the libraries they are hosting.  To load the library you desire it is as simple as this.</p>
<pre class="brush: js">
google.load("jquery", "1.3.1");
google.load("prototype", "1.6.0.3");
google.load("scriptaculous", "1.8.2");
</pre>
<p>Quite easy and it saves you a lot of trouble!</p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/YprqkUER31g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/leveraging-googles-ajax-library-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/leveraging-googles-ajax-library-api/</feedburner:origLink></item>
		<item>
		<title>jQuery: Tabbed Navigation</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/UHSRnYN9Wok/</link>
		<comments>http://piratecove.org/jquery-tabbed-navigation/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 12:00:27 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=122</guid>
		<description><![CDATA[Tabbed navigation is something that many of us encounter on a daily basis to some extent while browsing the web.  We will be talking about how to create this effect with jQuery and have each tab loaded dynamically.  I will work through an example based on a project I am currently developing as [...]]]></description>
			<content:encoded><![CDATA[<p>Tabbed navigation is something that many of us encounter on a daily basis to some extent while browsing the web.  We will be talking about how to create this effect with jQuery and have each tab loaded dynamically.  I will work through an example based on a project I am currently developing as well as review what jQuery is for those that are new to the technology.<br />
<span id="more-122"></span><br />
To achieve our tabbed navigation, and to do it dynamically, we are going to use the <a href="http://jquery.com">jQuery Javascript library</a>.  That in combination with some simple HTML/CSS can get you to have your own tabbed navigation system working on your site in no time.</p>
<p>On the jQuery site you will find versions of their library to include on your site, so you can download those.  They are also hosted at Google Code so you can search for them there and just load the Google hosted versions if you&#8217;d rather do that.  This is a bit more of an advanced tutorial.  I may go back and write a more basic &#8220;Intro to jQuery&#8221; for those of you that are unfamiliar with the library.  If this flies over your head bear with me as I&#8217;ll try and break it down as well as I can.</p>
<p>Let&#8217;s write some HTML for the navigation list.</p>
<pre class="brush: html">
<div id="nav">
<ul class="tabs-nav">
<li class="tab-selected"><a href="ajax/tab.php?tab=Home">Home</a></li>
<li class=""><a href="ajax/tab.php?tab=News">News</a></li>
<li class=""><a href="ajax/tab.php?tab=Forum">Forum</a></li>
</ul>
</div>
<div id="View_News"></div>
</pre>
<p>This is just a pretty standard navigation setup.  Take note of the class on the first list item as well as the extra div named &#8220;View_News&#8221;.  This extra div is where the tabs are going to be dynamically loaded.</p>
<p>Let&#8217;s setup the jQuery needed for this navigation system now.</p>
<pre class="brush: js">
$(document).ready(function(){

  $("#View_News").load("ajax/tab.php?tab=Home");

  $("#nav li>a").click(function(){
    $("#View_News").load($(this).attr("href"));
      $("#nav li").each(function () {
        $(this).removeClass("tab-selected");
      });
      $(this).parent().addClass("tab-selected");
      return false;
    });
});
</pre>
<p>Let&#8217;s step through this line by line.</p>
<p>The first line is how you start a jQuery section of code.  The next line is setting the default tab to be loaded.  We setup the HTML to have the Home tab as default, so here is where we get it to load the Home section. </p>
<p>This next section is the handler for the rest of the tabs and the browsing/loading of them.  This event you are creating on this line is fired every time an anchor link, inside a list item in your nav section is clicked.  You should be able to read that CSS selector if you have done CSS before.  That brings up a good point about jQuery.  CSS Selectors are its primary way of finding items in the DOM to manipulate.  This makes it very easy to jump right into a project and get things moving fairly smoothly.</p>
<p>After you click that link we move to the next line which tells it to look up the href attribute of the link and then fetch that URL.  It will then load it into the #View_News div.  This handles the loading.  Pretty simple huh!</p>
<p>This next section of code is going to handle changing the look and styling of the tabs.  Normally we would make some visual styling to indicate which tab you are currently on.  The way I chose to do it for this particular project goes like this.</p>
<p>We first clear the class of all of the tabs, the default look and feel for the tabs in your CSS should be the &#8216;not selected&#8217; style.  Then I search the DOM for the parent object of the Anchor link we just clicked.  Knowing that the parent is always going to be a list item, and that it will be the one that I will need to style as the &#8217;selected&#8217; tab.  That is how I build the final line, adding the class to the list item that we want to reflect the tab we are on.</p>
<p>Now you are thinking &#8220;What the heck is this &#8216;tab.php&#8217; in his links?&#8221;.  Well that is the script that I wrote that handles what section is returned (based off of the querystring) as well as what format it is sent back.  There are many ways to do this in a fully programmed PHP file.  The most simple way that you may want to test with is by creating stand alone html files with juts the code you want to go into the #View_News div.  It will then load them just the same.  Using the PHP files there just allows you to get into more advanced things to be loaded and done.</p>
<p>There you have it, a basic tabbed navigation system that you could use for any number of things on your site!</p>
<p>Let&#8217;s take this a bit further and talk about some of the advanced features that could be added to this example.  Some of you might be thinking &#8220;Why return full chunks of HTML, isn&#8217;t that passing much more data than you would need to?&#8221;.  The quick answer is &#8220;Yes, maybe&#8221;.  The slickest way to do this would be to have your tab.php return a <a href="http://www.json.org/">JSON object</a> and then you could style that data in the jQuery and build it that way.  It should be faster.  I could see myself changing what I&#8217;m working on to going that way but as it stands my timers say that I am able to make a call for the page, and have my version of tab.php gather the data and style it and return it in under 0.0005 seconds.  If I were to see these numbers get higher, or page draws to be delayed then I might think about moving over to a JSON object setup.</p>
<p>This new tabbed navigation is going to be showing up on the new <a href="http://gamegossip.com">Game Gossip</a>.  Keep an eye out for the announcement for when we launch the alpha of that site very soon!</p>
<p>That is it for today.  Hopefully you can no go ahead and implement your very own tabbed navigation system using jQuery.  If you set one up feel free to link to it in a comment!</p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/UHSRnYN9Wok" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/jquery-tabbed-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/jquery-tabbed-navigation/</feedburner:origLink></item>
		<item>
		<title>Sketch to WordPress: Part III</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/M9QzdrLgJW8/</link>
		<comments>http://piratecove.org/sketch-to-wordpress-part-iii/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 12:00:14 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=80</guid>
		<description><![CDATA[Welcome to the final chapter in this series.  Today we are going to review the process for taking your newly created HTML/CSS files and turning them into a theme for your WordPress site.  We will review what the theme system for WordPress consists of as well as some resources that are helpful in [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the final chapter in this series.  Today we are going to review the process for taking your newly created HTML/CSS files and turning them into a theme for your WordPress site.  We will review what the theme system for WordPress consists of as well as some resources that are helpful in getting your project completed.  By the end you should have a better understanding of how the WordPress theme system works and what it takes to get your custom layout functioning.<br />
<span id="more-80"></span><br />
Hopefully if you have gotten this far in the series you already know something about the WordPress Theme system.  For the sake of brevity in an already lengthy article I&#8217;ll will just say that before you go on in this article, just review <a href="http://codex.wordpress.org/Using_Themes">this section of the Codex at the WordPress site on their theme system</a>.  After reading through that you should have a better idea of what is going on during the rest of this article.</p>
<p>To start things off for your new theme go ahead and make a folder in the wp-content/themes folder with the name of your new theme, no spaces.  Create a folder &#8217;style&#8217; inside of that folder.</p>
<p>How you do the next part depends on you really.  If you Google around you will find a few WordPress reset themes.  They strip away all formatting and standardize some tags being used.  They are very nice for designers who want to have a decent base to just stylize with some CSS.  I used one of these originally, but during my conversion, WordPress redid their theme system.  While my method worked, I really need to redo my theme already and change the ways I did a few things.  If you are going to use a reset to lay your base down, make sure it is for the version of WordPress you are running.</p>
<p>For our case we will just start with the &#8216;default&#8217; theme as our base.  Just copy the contents of the default theme into your folder for your theme.  Create another folder in your themes folder named &#8216;unfinished&#8217; as well.  You can see there are a lot of php files in this directory.  They are all described in the previous link to the Codex.  We want to just start working on the bare minimum to get your site working so we are going to move the &#8217;secondary&#8217; files to the &#8216;unfinished&#8217; directory.  WordPress&#8217; theme system will default to your index.php if it doesnt find a specific one for that section of your site.  So it would be best to get the base down, and then start working on specific sections of your site from there.</p>
<p>Here are the files that I would leave in your themes base folder, the rest of them move to your &#8216;unfinished&#8217; folder.</p>
<p>comments.php<br />
footer.php<br />
functions.php<br />
header.php<br />
index.php<br />
screenshot.png<br />
sidebar.php<br />
single.php<br />
style.css</p>
<p>You will want to edit the style.css file to have the information for your theme.  Just open the file and edit the comments to reflect the proper information about your style.  You will also notice the other CSS files that are included.  While you are converting your theme over you can start to split up your style like this or import another one with your master CSS file for the time being.  Replace screenshot.png with a screenshot of your own site as well.  This is the thumbnail you see on the theme selection page.</p>
<p>From this point on, having a slight knowledge of PHP is helpful but not needed.  You are going to be cutting up your mockup into the parts that you see in that file list above.  Start working on your header/footer/sidebar files.  Your index file will make calls to those files and have the rest of your code in there.  At that point your site should work.  You can edit single.php so that you can tweak your index.php layout for looking at just one post at a time.  The file comments.php controls how the comments for your site are styled.</p>
<p>There is some extraneous data in the files that you shouldnt feel bad about removing, particularly in the sidebar.php, especially if you know exactly the data you want and how to put it in there.  Hand-holding you through customizing those files isn&#8217;t what we are going to do here as you can find that anywhere.  The programming fun part of this article will be showing you how I customized the sidebar on this site.</p>
<p>Our side bar at the Cove contains a Twitter section, a Recent Articles section and a Delicious bookmarks section.  To get all these sections to work I could have spent a few hours custom coding all the required API plugin hooks to the services and been fine.  In fact I had a <a href="http://piratecove.org/tweat/">Twitter one done in the past</a></a>.  Instead of doing all that again I went to look for WordPress plugins.</p>
<p>I happened to find two plugins that let me be able to do what I was looking for.  <a href="http://rick.jinlabs.com/code/twitter">Twitter for Wordpress</a> and <a href="http://rick.jinlabs.com/code/delicious">Delicious for Wordpress</a> by <a href="http://rick.jinlabs.com/">Ricardo González</a>.</p>
<p>Normally you would just enable these plugins and add the widgets to the sidebar.  Well that is all find and dandy for most, but I wanted to customize their output a bit more.  Ricardo did a great job documenting his functions he created for these two addons so that we can pass what we want and style things up too.  Here are the two lines of code that I used in my sidebar to get Twitter and Delicious working.</p>
<p>Twitter<br />
<textarea name="code" class="php"><?php twitter_messages('jpwalsh1', 1, false, true, "&#038;raquo", true, true, false); ?></textarea></p>
<p>Delicious<br />
<textarea name="code" class="php"><?php delicious_bookmarks('jpwalsh1', 10, true, false, false, false, true, false, false, false); ?></textarea></p>
<p>Ricardo&#8217;s documentation goes into detail on the options but you can see what it takes to get similar data to what I have showing up in my sidebar.</p>
<p>That just leaves us with getting the recent posts into the sidebar.  After all of my looking I could not find any plugin that did what I wanted, which was expected.  The default WordPress has a &#8216;recent articles&#8217; widget that people use to get this effect, but I couldnt style it the way I wanted or control it as much as I&#8217;d like.  That left us needing a custom solution.</p>
<p>I read through some of the documentation and found this <a href="http://codex.wordpress.org/Function_Reference/wp_get_recent_posts">wp_get_recent_posts()</a> function that WordPress uses.  That eliminated me from trying to figure out what kind of database queries I needed to write so I was happy.</p>
<p>Here is my final code for my recent posts section of my sidebar.</p>
<pre name="code" class="php">
<div id="recentarticles">
<hr />
<ol>
&lt;?php
$rposts = wp_get_recent_posts();
foreach ($rposts as $rpost) {
  if ($rpost['post_status'] == 'publish'){
  print "
<li><a href=\"http://piratecove.org/" . $rpost['post_name'] . "\">" . $rpost['post_title'] . "</a></li>

\n";
  }
}
?&gt;
</ol>
</div>
</pre>
<p>To dive into that a bit.  The call to wp_get_recent_posts returns all the data that we need, actually too much.  It even returns articles that are in draft or scheduled states.  That is where the next line comes in, filtering all of those out and only grabbing my published stories.  My print statement is a bit butchered by this code formatting utility I have right now.  But that is just formatting the list item in the way you see on the right here.</p>
<p>As you continue to customize sections of your WordPress site just keep grabbing files from your &#8216;unfinished&#8217; folder and customizing them to fit your site.  You may not need to customize or even use all of them, but hopefully this article has given you a little better understanding of what it takes to take your HTML/CSS mockup and convert it to a WordPress theme.</p>
<p>Admittedly, my theme conversion is still not done and there are many things left for even me to do.  So you can also expect that tweaking is par for the course for a little while.  This is just like any other type of designing in that the more that you do it, the easier and faster it gets each time.  Feel free to leave comments or contact me on Twitter/Facebook if you have questions.</p>
<p>Read the rest of this series:<br />
<a href="http://piratecove.org/sketch-to-wordpress-part-ii/">Sketch to Wordpress: Part II</a><br />
<a href="http://piratecove.org/sketch-to-wordpress-part-i/">Sketch to Wordpress: Part I</a></p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/M9QzdrLgJW8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/sketch-to-wordpress-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/sketch-to-wordpress-part-iii/</feedburner:origLink></item>
		<item>
		<title>Website Backup Script</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/KRMTV4ZrxiE/</link>
		<comments>http://piratecove.org/website-backup-script/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 20:57:59 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=99</guid>
		<description><![CDATA[Do you regularly backup your data off of your server?  Many people setup database dumps and then leave them on their server.  This doesn&#8217;t really help you in the case of the server dying on you.  I&#8217;m going to share with you the script that I have that backs up all of [...]]]></description>
			<content:encoded><![CDATA[<p>Do you regularly backup your data off of your server?  Many people setup database dumps and then leave them on their server.  This doesn&#8217;t really help you in the case of the server dying on you.  I&#8217;m going to share with you the script that I have that backs up all of the databases on this server as well as doing a full/incremental file backup as well.  Wrapping it all up we will then FTP it off to a secondary location for storage.<br />
<span id="more-99"></span></p>
<p>I&#8217;ll post code snippets and then explain them.</p>
<p>There are quite a few things that you&#8217;ll have to do beforehand as this script, while mostly is &#8216;drop in&#8217; still should require some pre-work on your end.</p>
<p>What you&#8217;ll need.</p>
<ul>
<li>*FTP ip/user/pass of destination server</li>
<li>*MySQL user/pass/host</li>
<li>*Folders to backup</li>
</ul>
<p>As I discovered while writing this, some things may need adjusted for your system and I&#8217;ll flag them as we go through the script.</p>
<p>First we will need to setup the configuration variables of the script.</p>
<pre class="brush: php">
### Setup Environment ###
DIRS="/home/user/public_html"
BACKUP=/tmp/backup.$$
NOW=$(date +"%d-%m-%Y")
INCFILE="/root/tar-inc-backup.dat"
DAY=$(date +"%a")
FULLBACKUP="Sun"

### MySQL Config ###
MUSER="user"
MPASS="pass"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
GZIP="$(which gzip)"

### FTP Config ###
FTPD="/incremental"
FTPU="username"
FTPP="pass"
FTPS="hostname"

### Email Config ###
EMAILID="email@domain.com"
</pre>
<p>DIRS: Separate paths with spaces.<br />
BACKUP: Where to store backup files temporarily during the script.<br />
INCFILE: Is what we will use to control the incremental backups.<br />
FULLBACKUP: Day of the week to run your full file backups.</p>
<p>Let me point something out about the MySQL configuration. It is quite easy to just slap your root account in there and let it go to town. Try NOT to do that if you can help yourself. Make a database backup user with the proper privileges and access to the databases you want to back up. Those privileges are, SELECT, SHOW DATABASES, LOCK, RELOAD.</p>
<p>The rest of the configuration is self-explanatory. On to the next section.</p>
<pre class="brush: php">
### FS Backup ###
[ ! -d $BACKUP ] &#038;&#038; mkdir -p $BACKUP || :

### Determine which backup to run ###
if [ "$DAY" == "$FULLBACKUP" ]; then
  i=$(date +"%Hh%Mm%Ss")
  FTPD="/full"
  FILE="fs-full-$NOW.tar.gz"
  tar -zcvf $BACKUP/$FILE $DIRS
else
  i=$(date +"%Hh%Mm%Ss")
  FILE="fs-i-$NOW-$i.tar.gz"
  tar -g $INCFILE -zcvf $BACKUP/$FILE $DIRS
fi

### Start MySQL Backup ###
# Get all databases name
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
 FILE=$BACKUP/mysql-$db.$NOW-$i.gz
 $MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
</pre>
<p>This is the meat of the script. If you are reading this you can most likely read that and see what it is doing.</p>
<p>We are going to create the backup directory, and then backup the files based on what day it is. Then we will dump all the tables that the user account has access to a gzipped text file.</p>
<p>Time for the next section.<br />
(sorry couldn&#8217;t get this section working right with the code highlighter.)</p>
<p>
### FTP Backup to Remote Server ###<br />
#Start FTP backup using ncftp<br />
ftp $FTPS<<EOF<br />
prompt<br />
bin<br />
mkdir $FTPD<br />
mkdir $FTPD/$NOW<br />
cd $FTPD/$NOW<br />
lcd $BACKUP<br />
mput *<br />
quit<br />
EOF
</p>
<p>Here is something that you will need to test on your system. This is what you need to figure out. How can you, in one line, open and authenticate to a remote FTP server. This example looks very simple, but it requires setting up an .netrc file with the authentication information. I don&#8217;t want to get into .netrc config but it is very simple and documented all over the Internet. I had to create an entry for the remote server, and then I could connect like you see in the script. Some people may need to pass user/pass/host on one line, etc. Figure it out for your system and change the line above that is right after the comments.</p>
<p>The rest is basic FTP commands, easy enough.</p>
<pre class="brush: php">
### Backup Fail Check ###
if [ "$?" == "0" ]; then
 rm -f $BACKUP/*
else
 T=/tmp/backup.fail
 echo "Date: $(date)">$T
 echo "Hostname: $(hostname)" >>$T
 echo "Backup failed" >>$T
 mail  -s "BACKUP FAILED" "$EMAILID" <$T
 rm -f $T
fi
</pre>
<p>This is just the wrap up that will email you if the backup bombed. You can add all the info that you want into that email if you choose to.</p>
<p>Save all those code chunks as a new shell script and start testing. It's working great for me and hopefully it helps you out.</p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/KRMTV4ZrxiE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/website-backup-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/website-backup-script/</feedburner:origLink></item>
		<item>
		<title>Sketch to WordPress: Part II</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/PS5g-HDrNk4/</link>
		<comments>http://piratecove.org/sketch-to-wordpress-part-ii/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 05:00:55 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=60</guid>
		<description><![CDATA[Welcome to Part II of the Sketch to WordPress series.  In the last part we talked about design ideas as well as discussing ways to go about getting that design idea from paper to Photoshop.  Here in this article we will be discussing how you take your final Photoshop Mockup and convert it [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to Part II of the Sketch to WordPress series.  In the last part we talked about design ideas as well as discussing ways to go about getting that design idea from paper to Photoshop.  Here in this article we will be discussing how you take your final Photoshop Mockup and convert it to a basic HTML/CSS page.  In the end you should be able to take your design to the HTML/CSS stage without too much hassle.<br />
<span id="more-60"></span><br />
We will need to setup a few things before we begin.  If you havent made a default HTML/CSS page before you started this go ahead and set that up now.  Here is what I typically start with.  Create two files, index.html and default.css.  I also create a style folder and a images folder.  Place the default.css into the style folder.</p>
<p>Add this line in the head section of the index.html:</p>
<pre class="brush: html">
<link href="/style/default.css" type="text/css" rel="stylesheet" />
</pre>
<p>The CSS file will stay empty for now but let&#8217;s talk about where I usually start a CSS file with.  There is a CSS method called the &#8216;CSS Reset&#8217;.  The idea is that all browsers define what the &#8216;defaults&#8217; are of tags differently.  So what we would like to do is to get them all as close to the same to start with, before we start adding our custom code for our site.  The cascading style of the CSS system will then allow our defaults to be there and we can just then edit the attributes we need for each tag.</p>
<p>The reset that I use the most, or at least a variation of, is the reset that <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer</a> has maintained for us.  The easiest way to implement this into your site is to first save his code as its own file, say reset.css.  Place it in that style folder.</p>
<p>In your default.css file add the following line to the top.</p>
<pre class="brush: css">
@import reset.css
</pre>
<p>This only works for modern browsers, so if you&#8217;d like to support older browsers on this project, you will need to include the code in your default.css file.  Either way we have a blank slate and are ready to go.  Fire up Photoshop and lets start learning to love the Slice tool.</p>
<p>I tend to slice items by section first so that I&#8217;m slicing just what I need, rather than slicing up the entire document at once and trying to save all the images at once.  The goal is to minimize the amount of images/slices required to build your page.  If you can recreate the effect in CSS/HTML/JS then its probably faster to do it that way, but again not always and this varies.</p>
<p>We will take the new Cove layout for example.  You can see that there aren&#8217;t many images around.  The script section headings, the RSS and twitter icons and the navigation buttons and drop shadow below the header section and then lastly the background for the content section that adds the drop shadow on the outside edges.  Go around the net and see how your favorite sites are cut up too.  Check out some of the ones in our sidebar here.  If you haven&#8217;t already, now would be when you start using <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> and <a href="http://getfirebug.com/">Firebug</a>.</p>
<p>Some tips on good slicing.  Slice the least amount you can, and try and reproduce as much of the effect in CSS as possible.  It might also be helpful to hide certain layers when you are slicing things to make it easier to grab things.  Layer->New Layer Based Slice, is nice and has its place as well so use that when you need to.  I&#8217;ll use that on things like those script headings on the Cove.  After you have carved up your first few slices switch to the Slice Select tool and double click the slice, in that box name your slice what you want the image to be named.  Then when you do the Claw (Ctrl + Alt + Shift + S, aka Save for Web, yes I know a PC shortcut!), and select save, the names will be set and you can just use the save options to just save the slices you want.  I also try and not use GIFs if at all possible.  Slice in background colors and things that will make them easier to incorporate into your site.  Transparent PNGs are also widely used and there are workarounds to get them to work in old browsers if you are worried about that.</p>
<p>As with any layout start with getting the basic layout structured in your HTML/CSS file and then we will start on the header.  I dont want this lesson to be a copy/paste-fest so do a little Googling if you need to catch up to certain points.  A basic 968px wide centered two column default HTML/CSS setup can be found easily.</p>
<p>Now since we are about to start typing in some CSS into your project its best to decide on what format you are going to type it out in, either single or multi-line (how the Cove is done).  You then should organize your CSS file into code that is related, like &#8217;sidebar&#8217; and &#8216;header&#8217; or &#8216;navigation&#8217; things like that will make it easier to maintain.</p>
<p>Here is the HTML code for the header section at the Cove:</p>
<pre class="brush: html">
<div id="header">
<div id="nav">
<ul>
<li><a class="home" href="/">Home</a></li>
<li><a class="about" href="/about/">About</a></li>
<li><a class="tutorials" href="/category/tutorials/">Tutorials</a></li>
<li><a class="portfolio" href="/portfolio/">Portfolio</a></li>
</ul></div>
<div id="logo">
<h1>Pirate Cove</h1>
</div>
<div id="slogan">
<h2>A Safe Haven for Designers and Programmers</h2>
</div>
</div>
</pre>
<p>You will notice that the row of navigation buttons at the top of the page is nothing more than a standard Unordered List element, the logo is an H1 tag and the slogan is an H2 tag.  Remember HTML needs to semantically describe the content.  You need to keep style related phrasing and coding out of your HTML, it belongs in your CSS file.  Since a menu is basically a list of items, the UL tag is great for menus.  H1/2 are great for logos and headlines and things of that nature.</p>
<p>Here is then how we style the header (Press expand to see full code&#8230;it&#8217;s a bit long):</p>
<pre class="brush: css; collapse: true;">
/* Typography */
h1 {
	background: #4F6373 url(../images/logo.jpg) no-repeat;
	text-indent: -9999px;
	height: 44px;
}

h2 {
	background: #4F6373;
	font-family: Verdana, sans-serif;
	font-size: 10px;
	color: #FFF;
	padding: 0 300px 5px;
}

/* Navigation */
#nav {
	margin: 0 90px;
	position: relative;
}

#nav ul {
	list-style: none;
	float: left;
}

#nav ul li {
	float: left;
}

#nav ul li a {
	float: left;
	display: block;
}

#nav a.home {
	background: url(../images/home.jpg);
	width: 55px;
	height: 40px;
	text-indent: -9999px;
}

#nav a.home:hover, #nav a.home:focus {
	background: url(../images/home_h.jpg);
}

#nav a.about {
	background: url(../images/about.jpg);
	width: 65px;
	height: 40px;
	text-indent: -9999px;
}

#nav a.about:hover, #nav a.about:focus {
	background: url(../images/about_h.jpg);
}

#nav a.tutorials {
	background: url(../images/tutorials.jpg);
	width: 84px;
	height: 40px;
	text-indent: -9999px;
}

#nav a.tutorials:hover, #nav a.tutorials:focus {
	background: url(../images/tutorials_h.jpg);
}

#nav a.portfolio {
	background: url(../images/portfolio.jpg);
	width: 76px;
	height: 40px;
	text-indent: -9999px;
}

#nav a.portfolio:hover, #nav a.portfolio:focus {
	background: url(../images/portfolio_h.jpg);
}
</pre>
<p>The techniques used just in this header section should get you rolling on the rest of your site.  Images, unless they are the actual content, as in they are part of the styling of the site, should be in your CSS as backgrounds usually.  Remember things in HTML should be content, things in CSS should be styling.</p>
<p>The background element is the first thing you will need to get used to using.  The next hack is the text-indent line you see in the H1 element.  This will remove the text from being displayed, and then you are just left with your image.  This has quite a few applications, and I could even use that a bit more in spots here.</p>
<p>This part of the process, if you are new to HTML/CSS, can be pretty frustrating.  Leveraging Firebug to help you with spacing and seeing how the pieces of the page fit together will be a big help.  As you get better with HTML/CSS and the various tricks and hacks, this step will go much faster than you expect.</p>
<p>In the next article we will talk about how I went about converting this new HTML Mockup over to the WordPress Theme system.</p>
<p>Related Articles:<br />
<a href="http://piratecove.org/sketch-to-wordpress-part-i">Sketch to WordPress: Part I</a><br />
<a href="http://piratecove.org/sketch-to-wordpress-part-iii">Sketch to WordPress: Part III</a></p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/PS5g-HDrNk4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/sketch-to-wordpress-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/sketch-to-wordpress-part-ii/</feedburner:origLink></item>
		<item>
		<title>Sketch to WordPress: Part I</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/QnwZoVNJ_Oo/</link>
		<comments>http://piratecove.org/sketch-to-wordpress-part-i/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 01:53:15 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=55</guid>
		<description><![CDATA[Welcome to part one of our first series of tutorials here on the Cove.  In this series I will be talking about taking a website design idea from those first sketches on some paper all the way up to a theme for WordPress.  For this first part we will be covering some common [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to part one of our first series of tutorials here on the Cove.  In this series I will be talking about taking a website design idea from those first sketches on some paper all the way up to a theme for WordPress.  For this first part we will be covering some common design ideas and techniques, as well as some tools that I use to get the ball rolling on a project like this.  I&#8217;ll be writing it from a &#8216;new to web design&#8217; point of view, as that should work better for the few readers I have currently.<br />
<span id="more-55"></span><br />
Many times I have done sites in the past and just jump straight into Photoshop and start laying things out and dive right into it.  This works for many people, and many projects, but not always.  The Cove isn&#8217;t an incredibly advanced site in its current state but it was a design that started on paper.  First thing I did was make a list of things that I wanted the sidebar to contain, as well as the footer.  So for the sidebar here you can see that we have RSS Subscribe, Twitter updates, Recent Articles, Delicious Bookmarks.  My footer still leaves a lot to be desired right now but it has a tag cloud and the archives.  Both of which will fill in a bit more as the content on the site grows.</p>
<p>From here I grabbed a few colored pencils and a sketch book and drew out an idea for the site.  Click the picture below to see what I came up with.</p>
<p align="center"><a href="http://piratecove.org/wp-content/uploads/1/sketch_b.jpg"><img src="http://piratecove.org/wp-content/uploads/1/sketch.jpg" alt="Cove Sketch" /></a></p>
<p>You can see the overall look and feel of what I had on paper made it to the site.  I think it may be a good time to talk about some design basics.  I like the fixed width centered layout two column system.  Sometimes I may extend it to three columns but the design methods are the same.  There are various ideas on how wide to make the content area but its generally 968px -ish.  Then I tend to use one number to then create the columns.  The <a href="http://en.wikipedia.org/wiki/Golden_ratio">Golden Ratio</a> is a lovely number used by designers all the time, even if they aren&#8217;t doing it on purpose.</p>
<p>Even if a good designer is just eyeballing something, if they measure it, most likely it will be close.  I just used my width of my content area (970px) and divided it by 1.618 and that ends up being what I&#8217;ll try and get close to for the &#8216;blog&#8217; area of the site.  I use that number to include all the padding and margins also.  That gets the columns in an aesthetically pleasing width and you don&#8217;t have to sit back and ask if the column is too wide or narrow.  From there you can easily leverage Grid Design techniques to lay out the site.  There are lots of articles out there about Grid Designs and that is not in the scope of this tutorial, maybe a future one.</p>
<p>With just all of that info we can get started converting this sketch to Photoshop.  Fire up Photoshop and create a new document that is about 1100 x 1000.  You can setup your background on the initial layer and lock it.  Then create a new layer and paint a box that is the 968px wide and center it.  Gratuitous use of Rules and Guides are going to help you through these early stages of design.</p>
<p align="center"><img src="http://piratecove.org/wp-content/uploads/1/guides.jpg" alt="Guides" /></p>
<p>Now that you have the base setup, close Photoshop because we are taking a break.  No matter what you think, if this is one of your first sites you have done, I am willing to place a lot of money that the colors you selected for the site are wrong and are terrible.  I&#8217;d like to introduce you to the <a href="http://en.wikipedia.org/wiki/Color_wheel">Color Wheel</a> and Color Swatches.</p>
<p>The site that I have found that is the most enjoyable for me to work with is <a href="http://kuler.adobe.com">Kuler at Adobe</a>.  You can develop, share and see what other color swatches people have developed.  You can then export these to files that you can then import right into Photoshop/Illustrator to help speed along the process.  Finding good complementary colors is harder than it sounds.  Work at it for awhile, remembering things like links, headings and other things you may want to use to have things stand out on your site.  I used a combination of two swatches I found on there and then also another color.  Here is one of the swatches.</p>
<p align="center"><img src="http://piratecove.org/wp-content/uploads/1/swatch.jpg" alt="Cove Swatch" /></p>
<p>Typography is another thing you need to consider while designing.  Most of the time I can find the fonts that I want on my system or at <a href="http://dafont.com">DaFont</a>.  They have plenty of free fonts there, and there are plenty of other sites/fonts out there you can find and even pay for if you need.</p>
<p align="center"><img src="http://piratecove.org/wp-content/uploads/1/dafont.jpg" alt="DaFont" /></p>
<p>I ended up using 3 different fonts on the Cove [list font names here].  You may have more or less on your site, the key is just making it pleasing to the eye.  Once you have nailed down some color ideas, some fonts and your overall layout get back into Photoshop.</p>
<p>Now it is up to you to finish your Photoshop Mock of your design idea.  Remember to also use spacing properly, more talk of that will come in the next tutorial.  While this isn&#8217;t a Photoshop tutorial for now, but try and group all your layers by area on the page.  Make a background/header/footer/content/sidebar folders and put all their related layers in those folders.  It will make converting this all to HTML much easier.  Don&#8217;t over complicate things to start with, if you cant quite get a technique down in Photoshop to create the effect you are looking for, either ask around or move to a simpler idea until you learn how to create what you are looking to do.  The worst thing to do is to just sit and stare at the screen because you aren&#8217;t sure how to do something.</p>
<p align="center"><img src="http://piratecove.org/wp-content/uploads/1/slice.jpg" alt="Slice" /></p>
<p>Take some time and don&#8217;t rush as you will find, nailing down the Photoshop part of this process will determine how easy and nice the rest of the process goes.</p>
<p>Must of this post is pointers and tips than just a step by step how to.  The initial design stages are wildly varying depending on the project and the person.  I hope that this guide got you thinking about some design ideas and gave you some methods on how to translate your ideas from paper to Photoshop.</p>
<p><a href="http://piratecove.org/sketch-to-wordpress-part-ii/">Sketch to WordPress: Part II</a><br />
<a href="http://piratecove.org/sketch-to-wordpress-part-iii/">Sketch to WordPress: Part III</a></p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/QnwZoVNJ_Oo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/sketch-to-wordpress-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/sketch-to-wordpress-part-i/</feedburner:origLink></item>
		<item>
		<title>Today is Launch Day!</title>
		<link>http://feedproxy.google.com/~r/PirateCove/~3/qzTQPcfvkdU/</link>
		<comments>http://piratecove.org/today-is-launch-day/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 21:31:23 +0000</pubDate>
		<dc:creator>Jim Walsh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[cove]]></category>

		<guid isPermaLink="false">http://piratecove.org/?p=49</guid>
		<description><![CDATA[The new Cove is here, finally the theme is done and now we can get to sharing some my design and programming knowledge with all of you.]]></description>
			<content:encoded><![CDATA[<p>So after scraping a previous design (that a few of you and myself liked for awhile), I finalized on one and got it all worked out.  There are a few bugs in the design as you navigate the parts of the site that I have done but those will start to go away.  Some of the pages will populate as I add more content or take the time to write them.</p>
<p>For the first few tutorials I decided I&#8217;m going to take you all through the process of creating a Wordpress theme.  Seems like a fairly basic tutorial and a good starting place since I&#8217;ve been doing it all week.  It will go from drawing out the idea on paper, converting that into a PSD, taking that PSD to a basic HTML mock-up and then finally getting it to work with the WP theme system.</p>
<p>If there are any ideas you have for future tutorials feel free to leave a comment here or <a href="http://twitter.com/jpwalsh1">Twitter me</a>.</p>
<img src="http://feeds.feedburner.com/~r/PirateCove/~4/qzTQPcfvkdU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://piratecove.org/today-is-launch-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://piratecove.org/today-is-launch-day/</feedburner:origLink></item>
	</channel>
</rss>
