<?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>Hotchkiss Consulting</title>
	<atom:link href="http://hotchkissconsulting.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://hotchkissconsulting.net</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 12 Apr 2012 21:30:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Building traffic to your WordPress site</title>
		<link>http://hotchkissconsulting.net/building-traffic-wordpress/</link>
		<comments>http://hotchkissconsulting.net/building-traffic-wordpress/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 17:31:17 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=312</guid>
		<description><![CDATA[Download the Presentation &#160; So you have a website&#8230; Now what? Building traffic by doing the ings that matter. Networking Social Media (Facebook, Twitter, etc) Set up a Facebook page for your company Set up a Twitter account for your company Use Them! Forums Determine your expertise Help people Have fun and get your name [...]]]></description>
			<content:encoded><![CDATA[<h3><a href="/BuildingTrafficWordpress.mov" target="_blank">Download the Presentation</a></h3>
<p>&nbsp;</p>
<h2><strong>So you have a website&#8230; Now what?</strong></h2>
<h3><strong>Building traffic by doing the ings that matter.</strong></h3>
<p><strong>Networking</strong></p>
<ul>
<li>Social Media (Facebook, Twitter, etc)</li>
<ul>
<li>Set up a Facebook page for your company</li>
<li>Set up a Twitter account for your company</li>
<li><strong>Use Them!</strong></li>
</ul>
<li>Forums</li>
<ul>
<li>Determine your expertise</li>
<li>Help people</li>
<li>Have fun and get your name out there!</li>
</ul>
<li>YouTube</li>
<ul>
<li>Show your personality</li>
<li>Show your business</li>
<li>Have fun and get your name out there!</li>
<li>Make sure to carefully choose your keywords!</li>
</ul>
<li>Google Places</li>
<ul>
<li>If you have a physical location, you <strong>must</strong> get yourself listed on Google Places</li>
</ul>
<li>In Person</li>
<ul>
<li>Always carry business cards</li>
<li>Talk to people about what you do</li>
<ul>
<li><strong>Everybody</strong> knows <strong>somebody</strong> who needs your website</li>
</ul>
</ul>
</ul>
<p>&nbsp;</p>
<p><strong>Writing</strong></p>
<ul>
<li>Write SEO-friendly copy</li>
<ul>
<li>If your business has a local focus, use local keywords.</li>
<li>Use keywords in your title and permalink</li>
<li>Use an SEO plugin like Yoast or All-In-One</li>
<li>Don’t get hits under false pretenses.  Google learns how good your content is by how watching how many people stay on your site</li>
<li>Post timely content. When there are new developments in your industry, be the first to write about them</li>
</ul>
<li>Write regularly</li>
<ul>
<li>Use the post scheduling functionality in WordPress</li>
<li>Google <strong>loves</strong> fresh new content</li>
</ul>
<li>Focus on “Long Tail” SEO</li>
<ul>
<li>Find “niche” search terms in your industry, and write content to rank for them.  Combined with posting timely content, this can have a huge impact on your ranking</li>
</ul>
<li>Get and use Google Analytics</li>
<ul>
<li>Find out which posts are getting you traffic, find out what search terms people are using to find your site, and use that information to write effective content.</li>
</ul>
</ul>
<p><strong>Spending</strong></p>
<ul>
<li>Everyone can benefit from copywriting, whether you do it yourself or hire someone.</li>
<li>In addition to copywriting, you may opt for web advertising, traditional advertising, or both.</li>
<li>Who is your target market?</li>
<ul>
<li>If your target market is wide, you may have more benefits with traditional advertising</li>
<li>If your target market is narrow, you may have more benefits with web advertising</li>
</ul>
<li>Most successful ad campaigns use methods in addition to copywriting for organic SEO</li>
</ul>
<p>&nbsp;</p>
<p><strong>Planning your Spend</strong></p>
<ul>
<li><strong>Hiring a Copywriter</strong> ($300-$900/month)</li>
<ul>
<li>Pros</li>
<ul>
<li>You don’t have to write</li>
<li>Get regular original content from an SEO professional</li>
<li>Most cost-effective way to build traffic, long-term</li>
<li>Authoritative</li>
</ul>
<li>Cons</li>
<ul>
<li>Nobody knows your business like you do</li>
<li>Takes time to build traffic</li>
<li>More expensive than DIY</li>
</ul>
</ul>
<li><strong>Online Ads</strong> ($500-$10,000/month)</li>
<ul>
<li>Pros</li>
<ul>
<li>Pay-per-click, only pay for traffic you get</li>
<li>Get traffic quickly</li>
<li>Compete for short-tail SEO terms</li>
</ul>
<li>Cons</li>
<ul>
<li>Can be very expensive to execute effectively</li>
<li>Low level of authority</li>
</ul>
</ul>
<li><strong>Traditional Ads</strong> ($500-$30,000/month)</li>
<ul>
<li>Pros</li>
<ul>
<li>Wide audience</li>
<li>Low cost-per-impression</li>
<li>Gives your brand the appearance of size</li>
</ul>
<li>Cons</li>
<ul>
<li>Added cost of design</li>
<li>Very little ability to target advertising</li>
<li>High monthly cost</li>
</ul>
</ul>
</ul>
<p>&nbsp;</p>
<h3>Resources</h3>
<h4>Networking</h4>
<ul>
<li>Facebook (<a href="http://facebook.com/" target="_blank">facebook.com</a>)</li>
<li>Twitter (<a href="http://twitter.com/" target="_blank">twitter.com</a>)</li>
<li>City-Data (<a href="http://www.city-data.com/forum/" target="_blank">city-data.com/forum</a>)</li>
<li>Quora (<a href="http://www.quora.com/" target="_blank">quora.com/forum</a>)</li>
<li>YouTube (<a href="http://www.youtube.com/" target="_blank">youtube.com</a>)</li>
<li>Google Places (<a href="http://www.google.com/places/" target="_blank">google.com/places</a>)</li>
<li>Meetup (<a href="http://www.meetup.com/" target="_blank">meetup.com</a>)</li>
</ul>
<h4>Writing</h4>
<ul>
<li>Copyblogger (<a href="http://copyblogger.com/" target="_blank">copyblogger.com</a>)</li>
<li>SEOmoz (<a href="http://seomoz.org/" target="_blank">seomoz.org</a>)</li>
<li>Plugin: WordPress SEO by Yoast (<a href="http://wordpress.org/extend/plugins/wordpress-seo/" target="_blank">wordpress.org/extend/plugins/wordpress-seo</a>)</li>
<li>Plugin: All in One SEO Pack (<a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">wordpress.org/extend/plugins/all-in-one-seo-pack</a>)</li>
<li>Google Analytics (<a href="http://analytics.google.com/" target="_blank">analytics.google.com</a>)</li>
</ul>
<h4>Spending</h4>
<p>If you&#8217;d like to know more about hiring a copywriter, <a title="Contact" href="http://hotchkissconsulting.net/contact/">contact us</a>.  We have an excellent copywriter on staff.</p>
<ul>
<li>How to know if you need to hire a copywriter (<a href="http://copyblogger.com/professional-copywriter/" target="_blank">copyblogger.com/professional-copywriter</a>)</li>
<li>Google AdWords (<a href="https://adwords.google.com/" target="_blank">adwords.google.com</a>)</li>
<li>Facebook Advertising (<a href="http://www.facebook.com/advertising/" target="_blank">facebook.com/advertising</a>)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/building-traffic-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pomodoro-Friendly Junior-Size Planning Pages for 2012</title>
		<link>http://hotchkissconsulting.net/pomodoro-friendly-junior-size-planning-pages-for-2012/</link>
		<comments>http://hotchkissconsulting.net/pomodoro-friendly-junior-size-planning-pages-for-2012/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 04:19:11 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=292</guid>
		<description><![CDATA[I&#8217;m a huge fan of the Pomodoro Technique, and worked up these planning pages for 2012&#8211; I do 45 minute Pomodoros, up to 8 a day, so I have spaces to check off up to 8 pomodoros&#8211; if you do shorter pomodoros, you can cross-check for twice as many (cross off one diagonal for one [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a huge fan of the <a href="http://www.pomodorotechnique.com/">Pomodoro Technique</a>, and worked up these planning pages for 2012&#8211; I do 45 minute Pomodoros, up to 8 a day, so I have spaces to check off up to 8 pomodoros&#8211; if you do shorter pomodoros, you can cross-check for twice as many (cross off one diagonal for one pomodoro, a second, to make an X, for your second)</p>
<p>These are junior size, prepared on letter size&#8211; this is the correct size to print onto Junior sized paper in your printer, just leave the printer set up for Letter.</p>
<p>Without any further ado&#8230;</p>
<p><a href='http://hotchkissconsulting.net/wp-content/uploads/2011/12/2012PomodoroPlanningPages.pdf'>2012 Pomodoro Planning Pages (PDF)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/pomodoro-friendly-junior-size-planning-pages-for-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating WordPress sites between dev and live servers</title>
		<link>http://hotchkissconsulting.net/migrating-wordpress-sites-dev-live-servers/</link>
		<comments>http://hotchkissconsulting.net/migrating-wordpress-sites-dev-live-servers/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 13:38:48 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=289</guid>
		<description><![CDATA[In my work, at least once a week I&#8217;m either copying a live site onto my development server or moving a site back to the live server. I&#8217;ve figured out a few tricks along the way. Notice: This post assumes that you have a basic comfort level with the command line, it assumes you have [...]]]></description>
			<content:encoded><![CDATA[<p>In my work, at least once a week I&#8217;m either copying a live site onto my development server or moving a site back to the live server.  I&#8217;ve figured out a few tricks along the way.</p>
<p><strong>Notice:</strong> This post assumes that you have a basic comfort level with the command line, it assumes you have a linux web host, and it assumes you&#8217;re not going to sue me or hold me responsible if you break something.  If that&#8217;s not the case, please stop reading now!<br />
<span id="more-289"></span></p>
<h3>Choosing your dev server URL:</h3>
<p>I <strong>strongly</strong> recommend that the URLs for your dev and production environments are the same number of characters.  So, for my site hotchkissconsulting.net, I&#8217;ll choose a dev server URL like hconsultdev01.hdev1.com (same number of characters in the server name).  This is very important because WordPress stores a <strong>lot</strong> of information as serialized values.  Serialized values are, essentially, arrays of data being flattened into a string.  They use the length of the string as a checkvalue, so if you have a longer (or shorter) dev site URL, when you go to find/replace, you&#8217;ll end up breaking that serialized value.</p>
<p><em>A good option for some sites&#8211; if your primary URL is www.yoursite.com, just use dev.yoursite.com for the dev server.</em></p>
<h3>Prerequisites:</h3>
<ol>
<li>Back up a LOT.  Back up before you start, and back up continually as you go.  It may seem like overkill, but when you break something, and, every now and then, EVERYONE breaks things, you&#8217;ll be glad you have it.</li>
<li>Make sure both servers are up and running you have apache (or your server of choice) configured, etc</li>
<li>These instructions assume that your dev and live URLs are the same length (see above).  If they are not, following these instructions will probably break your site.  Be careful!</li>
<li>You need to have SSH access to follow these steps</li>
</ol>
<h3>Alright, let&#8217;s move your site:</h3>
<p>Note, throughout this list I will refer to your &#8220;source&#8221; and &#8220;target&#8221; servers.  The source is the server you&#8217;re moving from, the target is the server you&#8217;re moving to</p>
<h4>Moving Your Database</h4>
<ol>
<li>Connect to your source database through phpMyAdmin</li>
<li>Download a full export of your database in SQL format</li>
<li>Open your exported file in your favorite text editor, do a find/replace to replace the source domain name with the target domain name (find: www.yoursite.com, replace: dev.yoursite.com) and save it</li>
<li>Connect to your target database through phpMyAdmin</li>
<li>Drop any existing tables from the database (if applicable&#8211; if this is a new database, you won&#8217;t have any to drop</li>
<li>Import your modified export file from step 3</li>
</ol>
<h4>Moving Your Files</h4>
<ol>
<li>Connect to your source server using SSH, then cd to your web root (often times this will just be cd public_html, but not always&#8230;)</li>
<li>Zip all of your files together for easy moving.  The command for this is: <code>zip -9r websitebackup *</code> Be VERY careful with this, as you&#8217;re allowing someone to download all of your files directly from your web server.  You should always add a few random characters after &#8220;websitebackup&#8221; so that someone can&#8217;t easily guess how to download this backup.  So, for example:  <code>zip -9r websitebackup67sadga *</code> creates an archive at your web root with the name websitebackup67sadga.zip</li>
<li>Congratulations, you&#8217;re now finished with your source server!</li>
<li>Connect to your target server using SSH, then cd to your web root</li>
<li>Download the archive you created&#8211; on most servers, you can use the command <code>wget sourceserver.com/websitebackup67sadga.zip</code> (Replacing sourceserver.com with your source server&#8217;s domain name, and websitebackup67sadga.zip with the proper archive file name)</li>
<li>Unzip your archive file: <code>unzip websitebackup67sadga.zip</code></li>
<li>Edit wp-config.php with your text editor of choice to point it at the proper MySQL db/user/host/password</li>
<li>Find/replace the source URL out of all of the files you just moved.  You can do this in one fell swoop with <code>find ./ -type f -exec sed -i 's/www.yoursite.com/dev.yoursite.com/' {} \;</code> (replacing the URLs with your own, first source, then target)</li>
<li>Finally, delete the archive files off of both your source and target servers, and you&#8217;re in business!</li>
</ol>
<p>This may all seem overwhelming at first, but with practice and time, you&#8217;ll be able to clone a site in 10 minutes flat!  Need a hand?  Leave a comment or send an email!</p>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/migrating-wordpress-sites-dev-live-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking for (and blocking) free email accounts with jQuery Validation plugin</title>
		<link>http://hotchkissconsulting.net/checking-for-free-email-accounts-with-jquery-validation-plugin/</link>
		<comments>http://hotchkissconsulting.net/checking-for-free-email-accounts-with-jquery-validation-plugin/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 19:01:16 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=285</guid>
		<description><![CDATA[The jQuery Validation plugin is one of the most commonly used and useful jQuery plugins. One of the nicest things about it is how easily you can extend it. I recently had a client ask me to build a form which wouldn&#8217;t allow users to sign up with free email addresses&#8211; in particular, no Gmail, [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery Validation plugin</a> is one of the most commonly used and useful jQuery plugins.  One of the nicest things about it is how easily you can extend it.</p>
<p>I recently had a client ask me to build a form which wouldn&#8217;t allow users to sign up with free email addresses&#8211; in particular, no Gmail, Yahoo!, or Hotmail accounts.  After playing with it for a little bit, I came up with the following jQuery Validation method to check for, and block, Gmail, Yahoo!, and Hotmail (you can easily add other free email providers):</p>
<pre>
$.validator.addMethod(&#x27;nofreeemail&#x27;, function (value) {
    return /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/.test(value);
}, &#x27;Free email addresses are not allowed.&#x27;);
</pre>
<p>Once you&#8217;ve added the method, you can easily call it:</p>
<pre>
$(&quot;#signup_form&quot;).validate({
		rules: {
			&#x27;user[first_name]&#x27;: &quot;required&quot;,
			&#x27;user[last_name]&#x27;: &quot;required&quot;,
			&#x27;user[title]&#x27;: &quot;required&quot;,
			&#x27;user[phone]&#x27;: &quot;required&quot;,
			&#x27;user[email]&#x27;: {
				required: true,
				email: true,
				nofreeemail: true
			}
		}
});
</pre>
<p>So&#8211; to wrap up, the final code is:</p>
<pre>
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
$(document).ready(function() {
	$.validator.addMethod(&#x27;nofreeemail&#x27;, function (value) {
	    return /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/.test(value);
	}, &#x27;Free email addresses are not allowed.&#x27;);

	$(&quot;#signup_form&quot;).validate({
		rules: {
			&#x27;user[first_name]&#x27;: &quot;required&quot;,
			&#x27;user[last_name]&#x27;: &quot;required&quot;,
			&#x27;user[title]&#x27;: &quot;required&quot;,
			&#x27;user[phone]&#x27;: &quot;required&quot;,
			&#x27;user[email]&#x27;: {
				required: true,
				email: true,
				nofreeemail: true
			}
		}
	});
});
&lt;/script&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/checking-for-free-email-accounts-with-jquery-validation-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m a dink.</title>
		<link>http://hotchkissconsulting.net/im-a-dink/</link>
		<comments>http://hotchkissconsulting.net/im-a-dink/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 23:49:28 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[Consulting]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=283</guid>
		<description><![CDATA[So, Becky and I have been watching 80&#8242;s sitcoms on Netflix lately, and this word keeps coming up.  &#8220;Dink&#8221;. I guess I was too young when the 80&#8242;s ended to fully embrace and appreciate this word, but it fully describes how I feel about myself right now.  I have always hated it when web developers [...]]]></description>
			<content:encoded><![CDATA[<p>So, Becky and I have been watching 80&#8242;s sitcoms on Netflix lately, and this word keeps coming up.  &#8220;Dink&#8221;.</p>
<p>I guess I was too young when the 80&#8242;s ended to fully embrace and appreciate this word, but it fully describes how I feel about myself right now.  I have always hated it when web developers have crappy sites, or incomplete sites, and especially when they put up stupid cliches like &#8220;the cobbler&#8217;s children have no shoes&#8221;.</p>
<p>This site has been completely barren of content for the better part of the last 8 months, because toward the end of last year, I was migrating hosts and didn&#8217;t properly backup before hitting the fateful &#8220;terminate instance&#8221; button.  Lost 50+ blog posts which were generating hundreds of hits a day, lost all of my portfolio, about pages, everything.</p>
<p>I found an old backup which had 20 or so of my posts, and put those back.  I&#8217;ve restored the screen shots of my portfolio, but still need to write the descriptions for each of the projects featured.  I&#8217;ve redesigned the site and got that up.  I&#8217;m going to be working on re-writing some of my more popular blog posts which were lost, and posting some new stuff.</p>
<h3>Sorry for being a dink.</h3>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/im-a-dink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing content for non-active languages with qTranslate</title>
		<link>http://hotchkissconsulting.net/accessing-content-for-non-active-languages-with-qtranslate/</link>
		<comments>http://hotchkissconsulting.net/accessing-content-for-non-active-languages-with-qtranslate/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:17:15 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Technologies]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=271</guid>
		<description><![CDATA[I&#8217;ve recently been working on a new site for a large Jewish philanthropic organization, developing a (very) custom WordPress theme for their site&#8211; when it came to coming up with a way to handle bilingual English/Hebrew content, we tried a few WordPress plugins before settling on Qian Qin&#8217;s qTranslate, which has been wonderful&#8211; great user [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been working on a new site for a large Jewish philanthropic organization, developing a (very) custom WordPress theme for their site&#8211; when it came to coming up with a way to handle bilingual English/Hebrew content, we tried a few WordPress plugins before settling on Qian Qin&#8217;s <a href="http://www.qianqin.de/qtranslate/">qTranslate</a>, which has been wonderful&#8211; great user interface, easy for the client to grasp, easy to work with.  The one problem I encountered way that there is no easy way to reach across languages for content, which was necessary for one section of the site where English content needed to appear alongside Hebrew content.  Without any further ado, here&#8217;s the snippet of code I came up with to get at both languages&#8211; you are left with $p_title and $p_body which are both arrays, and you need to make sure to substitute your language in for Hebrew, and your language 2 letter code in for iw on line 3:</p>
<pre>$enddelim = '&lt;!--:--&gt;';
 $englishdelim = '&lt;!--:en--&gt;';
 $hebrewdelim = '&lt;!--:iw--&gt;';

 $getpost = get_posts('post_type=page&amp;include='.$post-&gt;ID);
 foreach($getpost as $p2) :
 setup_postdata($p2);
 $both_titles = 'blah'.$p2-&gt;post_title;
 $both_bodies = 'blah'.$p2-&gt;post_content;
 endforeach;

 if(strpos($both_titles, $englishdelim)) :
 $pt1 = explode($englishdelim, $both_titles);
 $pt2 = explode($enddelim, $pt1[1]);
 $p_title['english'] = $pt2[0];
 endif;

 if(strpos($both_titles, $hebrewdelim)) :
 $pt1 = explode($hebrewdelim, $both_titles);
 $pt2 = explode($enddelim, $pt1[1]);
 $p_title['hebrew'] = $pt2[0];
 endif;

 if(strpos($both_bodies, $englishdelim)) :
 $pt1 = explode($englishdelim, $both_bodies);
 $pt2 = explode($enddelim, $pt1[1]);
 $p_body['english'] = $pt2[0];
 endif;

 if(strpos($both_bodies, $hebrewdelim)) :
 $pt1 = explode($hebrewdelim, $both_bodies);
 $pt2 = explode($enddelim, $pt1[1]);
 $p_body['hebrew'] = $pt2[0];
 endif;</pre>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/accessing-content-for-non-active-languages-with-qtranslate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Calculating age with PHP using a birth date</title>
		<link>http://hotchkissconsulting.net/calculating-age-with-php-using-a-birth-date/</link>
		<comments>http://hotchkissconsulting.net/calculating-age-with-php-using-a-birth-date/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 08:21:52 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=258</guid>
		<description><![CDATA[UPDATED 12/2: Code updated for efficiency and code download link added. Ran into a problem today&#8211; there&#8217;s no easy way to add and subtract dates in PHP and be left with standard units (year, month, day, etc), so I whipped up a quick script to do it&#8211; the biggest problem is months, here, since PHP [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATED 12/2: Code updated for efficiency and <a href="http://tr.im/Gqgq">code download link</a> added.</p>
<p>Ran into a problem today&#8211; there&#8217;s no easy way to add and subtract dates in PHP and be left with standard units (year, month, day, etc), so I whipped up a quick script to do it&#8211; the biggest problem is months, here, since PHP deals with second-based timestamps, and months don&#8217;t possess a standard number of seconds.  Without further ado, here&#8217;s the code&#8211; I hope it&#8217;s helpful to your projects:<br />
<span id="more-258"></span><br />
<code></p>
<p>//Set the $year, $month, and $day variables to the date you're calculating time since.</p>
<p>/////////////////////////////////////////////////////////////////////<br />
// Calculate age<br />
/////////////////////////////////////////////////////////////////////<br />
	//Set your time zone so PHP5 doesn't balk<br />
	date_default_timezone_set('America/Denver');<br />
	$birthday = strtotime($year.'-'.$month.'-'.$day);<br />
	$current_time = time();<br />
	$curr['month'] = date('n', $current_time);<br />
	$curr['lastmonth'] = $curr['month'] - 1;<br />
	$curr['year'] = date('Y', $current_time);<br />
	$curr['lastyear'] = $curr['year'] - 1;<br />
	$curr['day'] = date('j', $current_time);</p>
<p>	//get the time difference in seconds<br />
	$diff = $current_time - $birthday;<br />
	$age['years'] = intval($diff/31556926);<br />
	//get the remaining seconds<br />
	$diff = $diff - (31556926 * $age['years']);<br />
	//Now for the tricky part-- number of months<br />
	if($curr['month'] > $month) {<br />
		$age['months'] = $curr['month'] - $month;<br />
		if($curr['day'] < $day) {<br />
			$age['months']--;<br />
			$month_temp = strtotime($curr['year'].'-'.$curr['lastmonth'].'-'.$day);<br />
		} else {<br />
			$month_temp = strtotime($curr['year'].'-'.$curr['month'].'-'.$day);<br />
		}<br />
		//Get the remaining seconds<br />
		$diff = $current_time - $month_temp;<br />
	} elseif($curr['month'] == $month) {<br />
		if($curr['day'] >= $day) {<br />
			$age['months'] = 0;<br />
			//since months are 0, we don't need to alter diff<br />
		} else {<br />
			$age['months'] = 11;<br />
			//Get the remaining seconds<br />
			$month_temp = strtotime($curr['year'].'-'.$curr['lastmonth'].'-'.$day);<br />
			$diff = $current_time - $month_temp;<br />
		}<br />
	} else {<br />
		$age['months'] = $curr['month'] - $month + 12;<br />
		if($curr['day'] < $day) {<br />
			$age['months']--;<br />
			$month_temp = strtotime($curr['year'].'-'.$curr['lastmonth'].'-'.$day);<br />
		} else {<br />
			$month_temp = strtotime($curr['year'].'-'.$curr['month'].'-'.$day);<br />
		}<br />
		$diff = $current_time - $month_temp;<br />
	}</p>
<p>	//calculate days<br />
	$age['days'] = intval($diff/86400);<br />
	//get the remaining seconds<br />
	$diff = $diff - (86400 * $age['days']);</p>
<p>	//calculate hours<br />
	$age['hours'] = intval($diff/3600);<br />
	//get the remaining seconds<br />
	$diff = $diff - (3600 * $age['hours']);</p>
<p>	//calculate minutes<br />
	$age['minutes'] = intval($diff/60);<br />
	//get the remaining seconds<br />
	$diff = $diff - (60 * $age['minutes']);</p>
<p>	//and we're left with seconds<br />
	$age['seconds'] = $diff;</p>
<p>	print_r($age);<br />
</code><br />
Or you can <a href="http://tr.im/Gqgq">download the source file here</a>, if you're having copy/paste troubles.</p>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/calculating-age-with-php-using-a-birth-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An easy way to handle previous and next product links</title>
		<link>http://hotchkissconsulting.net/an-easy-way-to-handle-previous-and-next-product-links/</link>
		<comments>http://hotchkissconsulting.net/an-easy-way-to-handle-previous-and-next-product-links/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 08:50:05 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=254</guid>
		<description><![CDATA[I&#8217;m working on a custom eCommerce site for a customer right now, and ran into an issue&#8211; they wanted to have, on every product page, a forward and back button to get to the previous and next items. The problem with this is that they may have arrived on the product page in a couple [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a custom eCommerce site for a customer right now, and ran into an issue&#8211; they wanted to have, on every product page, a forward and back button to get to the previous and next items.  The problem with this is that they may have arrived on the product page in a couple of different ways, through search or browsing, with different criteria set.</p>
<p>I came up with this easy routine which goes through the result set, whether it&#8217;s search result or category view, then creates an array where the key is the current product ID, and the values are the IDs of the product before and the product afterward.  So if I&#8217;m on product 157, $ordering[157]['next'] will give me the ID of the next product.  Just pop it in a session, and you&#8217;re good to go.</p>
<p>Simple and straightforward&#8211; feel free to reuse all you like!<br />
<span id="more-254"></span><br />
<code><br />
			foreach($results as $row) {<br />
					/////////////////////////////////////////////////////////////////////<br />
					// so that we can capture previous, current, and next, we're going<br />
					// to process one row behind, so for the first row, don't put anything into<br />
					// our array<br />
					/////////////////////////////////////////////////////////////////////<br />
					if(!$curr) {<br />
						$curr = 'first';<br />
						$next = $row['id'];<br />
					} else {<br />
					// Everything moves back one space<br />
						$prev = $curr;<br />
						$curr = $next;<br />
						$next = $row['id'];<br />
					// It gets saved into the array<br />
						$ordering[$curr]['prev'] = $prev;<br />
						$ordering[$curr]['next'] = $next;<br />
					}<br />
				}<br />
				// Here we're handling the last row<br />
				$ordering[$next]['prev'] = $curr;<br />
				$ordering[$next]['next'] = 'last';<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/an-easy-way-to-handle-previous-and-next-product-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing Basecamp Tasks into iCal</title>
		<link>http://hotchkissconsulting.net/importing-basecamp-tasks-into-ical/</link>
		<comments>http://hotchkissconsulting.net/importing-basecamp-tasks-into-ical/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 10:24:49 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=246</guid>
		<description><![CDATA[I&#8217;ve been back and forth a thousand times on Basecamp&#8211; I love it and I hate it, and have tried every alternative, but I just keep coming back.  So instead of switching again, I&#8217;ve decided I should just start fixing the things that bug me, and I&#8217;ve started with the fact that I can&#8217;t get [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hotchkissconsulting.net/wp-content/uploads/2009/11/basecamp-logo-for-fluid1.png"><img class="alignright size-full wp-image-251" title="basecamp-logo-for-fluid" src="http://hotchkissconsulting.net/wp-content/uploads/2009/11/basecamp-logo-for-fluid1.png" alt="basecamp-logo-for-fluid" width="320" height="266" /></a>I&#8217;ve been back and forth a thousand times on Basecamp&#8211; I love it and I hate it, and have tried every alternative, but I just keep coming back.  So instead of switching again, I&#8217;ve decided I should just start fixing the things that bug me, and I&#8217;ve started with the fact that I can&#8217;t get a feed of my tasks into iCal.  Since ICS feeds are read-only, there&#8217;s no way to be able to check off basecamp tasks in iCal, but I&#8217;ve started using <a href="http://www.celmaro.com/minco/">Minco</a> to track my time (great app, by the way), and it pulls in a list of items to track from your iCal to do list.  I&#8217;m sure you see where this is going&#8211; if I can push my Basecamp tasks into iCal, then Minco can see them.  Maybe you have another reason for wanting your tasks in iCal, but this was mine.  Anyway, thanks to <a href="http://www.phpinsider.com/">Monte Ohrt&#8217;s </a><a href="http://code.google.com/p/basecamp-php-api/">Basecamp PHP API library</a>, I was able to throw together an API tool to pull my tasks and push them out into an ICS feed in just an hour!  I&#8217;ve made this tool available so you can easily drop it into iCal and away you go.  Or, if you&#8217;d rather dig into it yourself, you can download my code from: <a href="http://tr.im/EjnN">http://tr.im/EjnN</a><br />
<span id="more-246"></span><br />
To use this tool, all you need to do is make a couple quick edits to this URL:</p>
<p>http://bctasks.hdev1.com/mytasks.php?site=<strong>SiteURLSegment</strong>&#038;user=<strong>YourUsername</strong>&#038;password=<strong>YourPassword</strong></p>
<p>Username and Password should be self explanatory.  SiteURLSegment is the portion of your Basecamp URL between the http:// and the .basecamphq.com/ &#8212; if your Basecamp account is at http://hotchkissconsulting.basecamphq.com/, your SiteURLSegment would be hotchkissconsulting.</p>
<p>Nothing shows better than an example, though, so here&#8217;s what my URL would be if my password was &#8216;iLovePHP&#8217;</p>
<p>http://bctasks.hdev1.com/mytasks.php?site=hotchkissconsulting&#038;user=sam&#038;password=iLovePHP</p>
<p>Then, to feed your tasks into iCal, all you need to do is:</p>
<ol>
<li>Open iCal</li>
<li>Select &#8216;Subscribe&#8217; from the Calendar menu</li>
<li>Enter your custom URL</li>
<li>Make sure &#8220;Remove To Do Items&#8221; is <strong>NOT</strong> checked</li>
<li>Set your auto-refresh to however often you want to check for new tasks and get rid of completed ones</li>
<li>Press Okay</li>
</ol>
<p>and Voila, all your Basecamp tasks are there in iCal.</p>
<p><strong>Since BC tasks are context based </strong>(they sit within a project and a task list so you know what they&#8217;re about), I brought in this information, so your task in iCal will show up as &#8220;ProjectName ListName &#8211; Task Name&#8221;</p>
<p><strong>Also, I&#8217;ve put in &#8216;short name&#8217; functionality.</strong> A lot of my tasks are fairly verbose, and I want to be able to see what the task is quickly and easily.  So I put in support for short names&#8211; you can use this in the project name, task list name, and the title of the actual task.  All you have to do is put the name you want to show up in iCal inside [square brackets].  So, if I had a task list named &#8220;Preparations for Launch [Launch]&#8220;, the feed will only show the list name as &#8220;Launch&#8221;.  This helps to keep things short and reasonable.</p>
<p>Questions?  Comments?  Let me know!</p>
<p><strong>Note: I do <span style="text-decoration: underline;">not</span> store your Basecamp username and password&#8211; </strong>this information is passed directly through to 37signals and never gets stored on my server.  If you&#8217;re uncomfortable with this, feel free to <a href="http://tr.im/EjnN">download the source code</a> and run it on your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/importing-basecamp-tasks-into-ical/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ditch the Bacn, get the email you want.</title>
		<link>http://hotchkissconsulting.net/filter-out-bacn-gmail/</link>
		<comments>http://hotchkissconsulting.net/filter-out-bacn-gmail/#comments</comments>
		<pubDate>Wed, 27 May 2009 20:59:24 +0000</pubDate>
		<dc:creator>Sam Hotchkiss</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://hotchkissconsulting.net/?p=205</guid>
		<description><![CDATA[The term &#8216;Bacn&#8216; has been around for a couple of years to refer to, according to wikipedia: electronic messages which have been subscribed to and are therefore not unsolicited but are often unread by the recipient for a long period of time, if at all. Bacn has been described as &#8220;email you want but not [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hotchkissconsulting.net/wp-content/uploads/2009/05/bacon1.jpg"><img class="alignleft size-medium wp-image-206" title="Mmmm, Bacn" src="http://hotchkissconsulting.net/wp-content/uploads/2009/05/bacon-242x300.jpg" alt="Mmmm, Bacn" width="242" height="300" /></a>The term &#8216;<a href="http://en.wikipedia.org/wiki/Bacon_(electronic)">Bacn</a>&#8216; has been around for a couple of years to refer to, according to wikipedia:</p>
<blockquote><p>electronic messages which have been subscribed to and are therefore not unsolicited but are often unread by the recipient for a long period of time, if at all. Bacn has been described as &#8220;<a class="mw-redirect" title="Email" href="http://en.wikipedia.org/wiki/Email">email</a> you want but not right now.&#8221;<sup id="cite_ref-0" class="reference"><a href="http://en.wikipedia.org/wiki/Bacon_%28electronic%29#cite_note-0"><span>[</span>1<span>]</span></a></sup><sup id="cite_ref-1" class="reference"><a href="http://en.wikipedia.org/wiki/Bacon_%28electronic%29#cite_note-1"><span>[</span>2<span>]</span></a></sup></p>
<p>Bacn differs from <a title="E-mail spam" href="http://en.wikipedia.org/wiki/E-mail_spam">spam</a> in that the emails are not unsolicited: the recipient has somehow signed up to receive it. Bacn is also not necessarily sent in bulk. Bacn derives its name from the idea that it is &#8220;better than spam, but not as good as a personal email&#8221;</p></blockquote>
<p>Bacn is, generally, non-urgent, not terribly exciting, but may still be information that you want and need.</p>
<p><em><strong>So we&#8217;ve got Spam, Bacn, and then email that actually matters&#8211; personal email from one person to another (you!).  I&#8217;ll call that chops.  So, how do you keep current on your chops without getting distracted by the spam and bacn?</strong></em></p>
<p>At Hotchkiss Consulting we use Google Apps to manage our email,  and it does a great job of removing the Spam.  But I can&#8217;t stand when I&#8217;m in the middle of a project and I get distracted by the constant inflow of Bacn, so I decided to get rid of it!  Since Google Apps is built on the Gmail core, these instructions should work for any gmail user.  Feel free to modify to fit your needs!<span id="more-205"></span></p>
<p><strong>a) Add a couple categories to keep stuff straight</strong></p>
<p style="padding-left: 30px;">I created two new categories, &#8220;Bacn&#8221; and &#8220;Chops&#8221;.  You can call these whatever you want.</p>
<p><strong>b) Create filters to get that unruly Bacn in its place</strong></p>
<p style="padding-left: 30px;">I was able to handle everything in 4 filters (add filters by clicking on &#8216;Settings&#8217; then the &#8216;Filters&#8217; tab):</p>
<h2 style="padding-left: 30px;">1) Identify and label the chops:</h2>
<p style="padding-left: 60px;"><strong>From</strong>: -{wordpress, support, no-reply, noreply, do-not-reply, help, null, owner, updates, sales, messages, jobs, notification, info, team, research, invitations, hello, webmaster, service, member, root, digest, email@, daemon, talktous, news, newsletter, anonredir, jagent, admin, cpanel, helpdesk, specials, postmaster, bounce, autocreate, linkedin.com, billing, auto}</p>
<p style="padding-left: 60px;"><em>This tells it that if the email contains any of the above strings, all of which are common in Bacn, that it is not chops</em> <em>(the -{ at the beginning indicates that it needs to EXCLUDE email with any of these strings in the from field)</em></p>
<p style="padding-left: 60px;"><strong>To</strong>: My email address</p>
<p style="padding-left: 60px;"><em>So&#8211; put in your email address here.  This will keep many mailing lists excluded.  Depending on your email setup, this may or may not work for you.</em></p>
<p style="padding-left: 60px;"><strong>Doesn&#8217;t have</strong>: &#8220;If you didn’t want to receive this email&#8221;, &#8220;If you prefer not to receive email&#8221;, &#8220;Validation Email&#8221;, &#8220;Dear Customer&#8221;, &#8220;You have received this email because&#8221;, &#8220;This email was sent to &#8220;, &#8220;fill out this short survey&#8221;, &#8220;You are receiving this email because&#8221;, &#8220;Unsubscribe at&#8221;, &#8220;To stop receiving these emails&#8221;, &#8220;to be removed from further&#8221;, &#8220;To unsubscribe or change&#8221;, &#8220;If you choose not to receive&#8221;, &#8220;simply unsubscribe&#8221;, &#8220;subscription via the link&#8221;, &#8220;If you would like to be removed from future&#8221;</p>
<p style="padding-left: 60px;"><em>These strings are common in Bacn, and uncommon in Chops.  By looking for them, we&#8217;re further reducing the Bacn in your Chops.</em></p>
<p style="padding-left: 30px;">Do a test search and check out all your chops.  Looking good, huh?  If you think so, click on &#8220;Next Step&#8221;, and tell it to apply the label &#8220;Chops&#8221; and check the box next to &#8220;Also apply filter to &#8230; conversations below.&#8221;</p>
<h2 style="padding-left: 30px;">2) Send the bacn packing:</h2>
<p style="padding-left: 30px;">These 3 filters will identify bacn, and you can do what you want with it.  I have my gmail mark it as Bacn and archive it.  This way it bypasses my email notification tool, but is still available for later review.</p>
<h3 style="padding-left: 60px;">Filter 1</h3>
<p style="padding-left: 60px;"><strong>From</strong>: {wordpress OR support OR no-reply OR noreply OR do-not-reply OR help OR null OR owner OR updates OR sales OR messages OR jobs OR notification OR info OR team OR research OR invitations OR hello OR webmaster OR service OR member OR root OR digest OR email@ OR daemon OR talktous OR news OR newsletter OR anonredir OR jagent OR admin OR cpanel OR helpdesk OR specials OR postmaster OR bounce OR autocreate OR linkedin.com OR billing OR auto}</p>
<h3 style="padding-left: 60px;">Filter 2</h3>
<p style="padding-left: 60px;"><strong>Has the Words</strong>: &#8220;If you didn’t want to receive this email&#8221; OR &#8220;If you prefer not to receive email&#8221; OR &#8220;Validation Email&#8221; OR &#8220;Dear Customer&#8221; OR &#8220;You have received this email because&#8221; OR &#8220;This email was sent to &#8221; OR &#8220;fill out this short survey&#8221; OR &#8220;You are receiving this email because&#8221; OR &#8220;Unsubscribe at&#8221; OR &#8220;To stop receiving these emails&#8221; OR &#8220;to be removed from further&#8221; OR &#8220;To unsubscribe or change&#8221; OR &#8220;If you choose not to receive&#8221; OR &#8220;simply unsubscribe&#8221; OR &#8220;subscription via the link&#8221; OR &#8220;If you would like to be removed from future&#8221;</p>
<h3 style="padding-left: 60px;">Filter 3</h3>
<p style="padding-left: 60px;">The last filter I use is to put my email in both the from and to field.  This picks up any messages that aren&#8217;t either from or to me.</p>
<h2>Did this work for you?  Do you have any other suggestions?  Let me know!  Together, we&#8217;ll beat the spam, we&#8217;ll beat the bacn, and we&#8217;ll be rolling in chops!</h2>
]]></content:encoded>
			<wfw:commentRss>http://hotchkissconsulting.net/filter-out-bacn-gmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

