<?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>The Code Dojo &#187; PHP</title>
	<atom:link href="http://dojo.codegreene.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://dojo.codegreene.com</link>
	<description>The Code Dojo is the veritable repository of random musings from the development team at Code Greene.</description>
	<lastBuildDate>Fri, 20 Jan 2012 18:09:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Recent Work: Leavitt Partners</title>
		<link>http://dojo.codegreene.com/2012/01/recent-work-leavitt-partners/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recent-work-leavitt-partners</link>
		<comments>http://dojo.codegreene.com/2012/01/recent-work-leavitt-partners/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 17:57:23 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Custom Post Type]]></category>
		<category><![CDATA[Custom WordPress Theme]]></category>
		<category><![CDATA[Leavitt Partners]]></category>
		<category><![CDATA[Leavitt Partners Blog]]></category>
		<category><![CDATA[Leavitt Partners Newsroom]]></category>
		<category><![CDATA[NewsCactus]]></category>
		<category><![CDATA[WordPress Custom Post Type]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=940</guid>
		<description><![CDATA[Leavitt Partners, in collaboration with Codella Marketing, came to us wanting a fresh start on their out dated corporate site, blog and newsroom. After planning the sites with Mark, Luke worked with Leavitt Partners to solidify the design. After the design, Tim coded each site. The main corporate site, leavittpartners.com, is built using WordPress and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-950" style="margin:0 0 0 10px;" title="lp-logo" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/lp-logo.jpg" alt="Leavitt Partners" width="195" height="80" />Leavitt Partners, in collaboration with Codella Marketing, came to us wanting a fresh start on their out dated corporate site, blog and newsroom. After planning the sites with Mark, Luke worked with Leavitt Partners to solidify the design.</p>
<p>After the design, Tim coded each site. The main corporate site, <a href="http://leavittpartners.com" target="_blank">leavittpartners.com</a>, is built using WordPress and features three Custom Post Types: the slideshow on the homepage, the homepage content and the Team page.</p>
<p>The <a href="http://leavittpartners.com/team/" target="_blank">main Team page</a> is broken up into staff levels but each worker is entered into the system the same way. A checkbox is used to differentiate their level. Also, another checkbox is used to flag if the worker is part of one of the several different sub-teams in the Leavitt Partners corporation. The individual team page highlights the workers accomplishments and also calls in their author RSS feed from the blog as well as any news highlights.<span id="more-940"></span></p>
<p>The <a href="http://leavittpartnersblog.com/" target="_blank">blog</a> is a straight forward WordPress install that functions like a typical blog. The <a href="http://news.leavittpartners.com/" target="_blank">newsroom</a>, powered by <a href="http://www.newscactus.com/" target="_blank">NewsCactus</a>, is a custom theme built around the NewsCactus framework.</p>
<p>We are very pleased with the result and hope these three sites will help Leavitt Partners continue to grow.</p>
<div id="attachment_942" class="wp-caption alignleft" style="width: 530px"><img class="size-full wp-image-942" title="leavitt-partners-homepage" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/leavitt-partners-homepage.jpg" alt="Leavitt Partners Homepage" width="520" height="300" /><p class="wp-caption-text">Leavitt Partners Homepage</p></div>
<div id="attachment_944" class="wp-caption alignleft" style="width: 530px"><img class="size-full wp-image-944" title="leavitt-partners-team-page" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/leavitt-partners-team-page.jpg" alt="Leavitt Partners Team Page" width="520" height="300" /><p class="wp-caption-text">Leavitt Partners Team Page</p></div>
<div id="attachment_945" class="wp-caption alignleft" style="width: 530px"><img class="size-full wp-image-945" title="leavitt-partners-team-single" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/leavitt-partners-team-single.jpg" alt="Leavitt Partners Team Single Page" width="520" height="300" /><p class="wp-caption-text">Leavitt Partners Team Single Page</p></div>
<div id="attachment_943" class="wp-caption alignleft" style="width: 530px"><img class="size-full wp-image-943" title="leavitt-partners-newsroom" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/leavitt-partners-newsroom.jpg" alt="Leavitt Partners Newsroom" width="520" height="300" /><p class="wp-caption-text">Leavitt Partners Newsroom</p></div>
<div id="attachment_941" class="wp-caption alignleft" style="width: 530px"><img class="size-full wp-image-941" title="leavitt-partners-blog" src="http://dojo.codegreene.com/wp-content/uploads/2012/01/leavitt-partners-blog.jpg" alt="Leavitt Partners Blog" width="520" height="300" /><p class="wp-caption-text">Leavitt Partners Blog</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2012/01/recent-work-leavitt-partners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharpening the Blades: Magento Guide, Textured Backgrounds &amp; PHP 5.4</title>
		<link>http://dojo.codegreene.com/2011/12/sharpening-the-blades-magento-guide-textured-backgrounds-php-5-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-magento-guide-textured-backgrounds-php-5-4</link>
		<comments>http://dojo.codegreene.com/2011/12/sharpening-the-blades-magento-guide-textured-backgrounds-php-5-4/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 18:09:01 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Design Textures]]></category>
		<category><![CDATA[Magento Guidlines]]></category>
		<category><![CDATA[PHP 5.4]]></category>
		<category><![CDATA[Textures]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=892</guid>
		<description><![CDATA[Luke, Tuesday Total Textures When designing websites sometimes a slight texture in the background can create just the right feel. Getting those textures can also be fun. They are all around us. I&#8217;ve snapped plenty of close up pictures of dirt, rocks, asphalt, cement, etc. Most of which don&#8217;t end up getting used or if [...]]]></description>
			<content:encoded><![CDATA[<p><strong><img class="alignright size-full wp-image-894" style="border: 1px solid #444444; margin: 8px 0pt 20px 20px; padding: 2px;" title="texture-tuesday" src="http://dojo.codegreene.com/wp-content/uploads/2011/12/texture-tuesday.jpg" alt="" width="100" height="100" />Luke, <a href="http://abduzeedo.com/tuesday-total-textures-101" target="_blank">Tuesday Total Textures</a></strong><br />
When designing websites sometimes a slight texture in the background can create just the right feel. Getting those textures can also be fun. They are all around us. I&#8217;ve snapped plenty of close up pictures of dirt, rocks, asphalt, cement, etc. Most of which don&#8217;t end up getting used or if they get used it&#8217;s quite a ways down the road when it fits with a specific project. The web is another resource for finding textures. One site that has weekly textures is <a href="http://abduzeedo.com/" target="_blank">abduzeedo.com</a>. Each Tuesday they post a &#8216;Total Tuesday Textures&#8217; post. Every so often I grab a texture from their site for safe keeping. Check it out for yourself and post some links of how you have used texture in your design projects.</p>
<p><strong><img class="alignright size-full wp-image-893" style="border: 1px solid #444444; margin: 8px 0pt 20px 20px; padding: 2px;" title="magento-guidelines" src="http://dojo.codegreene.com/wp-content/uploads/2011/12/magento-guidelines.jpg" alt="" width="100" height="100" />Tim, <a href="http://webdesign.tutsplus.com/tutorials/workflow-tutorials/magento-project-guidelines-for-designers/" target="_blank">Magento Project Guidelines for Designers</a><br />
</strong>Magento is a beast and we all know it, however, TutsPlus comes through again with a great walk through of the basic Magento views. I have been guilty of overlooking the seldom used views, but this guide will walk you through all of them to be sure your design elements are consistent throughout the site. The part I like most about the article though is the FREE PDF download that I highly recommend sending to a client as soon as you can to help educate them about the ins and outs of Magento.</p>
<p><strong><img class="alignright size-full wp-image-896" style="border: 1px solid #444444; margin: 8px 0pt 20px 20px; padding: 2px;" title="php-5-4" src="http://dojo.codegreene.com/wp-content/uploads/2011/12/php-5-4.jpg" alt="" width="100" height="100" />Benjam, <a href="http://simas.posterous.com/new-to-php-54-traits" target="_blank">New to PHP 5.4: Traits</a></strong><br />
PHP 5.4 is right around the corner, and one of the new features added to this version are class traits.  I won&#8217;t go into too much detail, you can read the blog post for that, but it makes reusable OO code even more reusable by allowing multiple unrelated classes to pull in the same traits from a master trait object.  Like built-in mixins.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/12/sharpening-the-blades-magento-guide-textured-backgrounds-php-5-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Securing WordPress with Plugins</title>
		<link>http://dojo.codegreene.com/2011/12/securing-wordpress-with-plugins/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=securing-wordpress-with-plugins</link>
		<comments>http://dojo.codegreene.com/2011/12/securing-wordpress-with-plugins/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 18:49:01 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=883</guid>
		<description><![CDATA[The purpose of this post is to help you secure your WordPress self-hosted site by installing and setting up plugins. As of the time of writing this post these plugins have been used with WordPress 3.2.1. Keeping your site secure or safe from hackers is not always easy but is something you need to be [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-885" title="Picture 5" src="http://dojo.codegreene.com/wp-content/uploads/2011/12/Picture-5-300x84.png" alt="" width="300" height="84" />The purpose of this post is to help you secure your WordPress self-hosted site by installing and setting up plugins. As of the time of writing this post these plugins have been used with WordPress 3.2.1.</p>
<p>Keeping your site secure or safe from hackers is not always easy but is something you need to be aware of. One thing I encourage you to do just in case your site is compromised is to always have a back up of your files and database. As a start, one plugin that can help with this is named BackWPup ( <a title="BackWPup" href="http://backwpup.com" target="_blank">www.backwpup.com</a> ). You can set this plugin to backup your files and database daily, weekly, monthly, or if you feel even hourly. But you can have it email it to you, save it to another server via FTP, or even save it to your DropBox account.</p>
<p>There are a few steps that you can take from the beginning when you first setup your WordPress site. The first thing to do is do not use the default table alias. WordPress by default will suggest that it use &#8220;wp_&#8221;. If you are only going to use the database for your site and not add any other tables I would suggest you take it off all together, but to make it even more secure use a different alias.<span id="more-883"></span></p>
<p>If you already have a site up and running and just want to take what you have now and make it secure here are the list of plugins and what they do:</p>
<ul>
<li><strong>Change the login URL</strong><br />
By default WordPress uses your URL / wp-login. To make it more secure  you can change the URL to be used to login. Sometimes people want /manger, /login, or /admin. Whatever it is that you choose you can use one of these plugins to change it from the default<br />
- <strong>Ozh&#8217; Simpler Login URL</strong> &#8211; <a href="http://wordpress.org/extend/plugins/ozh-simpler-login-url" target="_blank">Link</a><strong><br />
</strong>- <strong>Peter&#8217;s Login Redirect</strong> &#8211; <a href="http://wordpress.org/extend/plugins/peters-login-redirect" target="_blank">Link</a><br />
- <strong>Custom Login and Admin URL&#8217;s</strong> &#8211; <a href="http://wordpress.org/extend/plugins/custom-login-and-admin-urls" target="_blank">Link</a></li>
<li><strong>Limit Login Attempts</strong><br />
By default WordPress does not limit that amount of tries to log into the Admin. It will instead inform the user instantly that it is not correct and allow them to try again. So using one or even both of these plugins will help you limit this and track what is going on<br />
- <strong>Limit Login Attempts</strong> &#8211; <a href="http://wordpress.org/extend/plugins/limit-login-attempts" target="_blank">Link</a><br />
- <strong>Login LockDown</strong> &#8211; <a href="http://wordpress.org/extend/plugins/login-lockdown" target="_blank">Link</a></li>
<li><strong><strong>Find Out What Security Holes Your Site Is Susceptible To</strong></strong><br />
Run tests on your site to see what security holes may appear in your site. It is a full time job to stay on top of what the latest security risks are out there. So to help know what your problems are run one, or both plugins to evaluate your sites holes and close them up as you can<br />
- <strong>Ultimate Security Checker</strong> &#8211; <a href="http://wordpress.org/extend/plugins/ultimate-security-checker" target="_blank">Link</a><br />
- <strong>Secure WordPress</strong> &#8211; <a href="http://wordpress.org/extend/plugins/secure-wordpress" target="_blank">Link</a></li>
</ul>
<p>These are just a few ways you can secure your WordPress site just using plugins. There are other ways that I may expound on at a later time but it requires editing code, editing configuration settings on the server, and even updating the .htaccess on the server.</p>
<p><strong>Bonus Thought:</strong><br />
Another thing that I would encourage all to do that does not make your site a little more secure is in your robots.txt file that you have available to the search engines is to have them ignore your wp-content directory. There is no reason they need to go through these files. To do that you can add the following to your robots.txt file:<br />
Disallow: /wp-admin<br />
Disallow: /wp-includes<br />
Disallow: /wp-content/plugins<br />
Disallow: /wp-content/cache<br />
Disallow: /wp-content/themes<br />
Disallow: /wp-login.php<br />
Disallow: /*wp-login.php*<br />
Allow: /wp-content/uploads</p>
<p>What plugins are you using to secure your WordPress site?</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/12/securing-wordpress-with-plugins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Recent Work: Trademark Access</title>
		<link>http://dojo.codegreene.com/2011/11/recent-work-trademark-access/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recent-work-trademark-access</link>
		<comments>http://dojo.codegreene.com/2011/11/recent-work-trademark-access/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 17:01:15 +0000</pubDate>
		<dc:creator>Master Sensei</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Recent Work]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=873</guid>
		<description><![CDATA[Trademark Access is a service provided through Bateman IP which is a law firm that specializes in intellectual property and is located in Salt Lake City, Utah. They need a site specifically for Trademarks and this site provides a client an easy way to get started in the Trademark process. The site is built using [...]]]></description>
			<content:encoded><![CDATA[<p>Trademark Access is a service provided through Bateman IP which is a law firm that specializes in intellectual property and is located in Salt Lake City, Utah. They need a site specifically for Trademarks and this site provides a client an easy way to get started in the Trademark process.</p>
<p>The site is built using a custom WordPress theme with 3 Custom Post Types. The client can easily update the About, Plans &amp; Pricing and Home page. The Custom Post Types allow the client to update their FAQs easily, manage their Testimonials and Expertise sections.<span id="more-873"></span></p>
<p>A visitor can easily get their Trademark in the works on the Start Application page that collects the information needed to get quick access to a Trademark.</p>
<p><img class="alignleft size-full wp-image-874" title="trademark-access" src="http://dojo.codegreene.com/wp-content/uploads/2011/11/trademark-access.jpg" alt="Trademark Access" width="520" height="390" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/11/recent-work-trademark-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugins Every WordPress Site Should Have Installed</title>
		<link>http://dojo.codegreene.com/2011/11/plugins-every-wordpress-site-should-have-installed/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plugins-every-wordpress-site-should-have-installed</link>
		<comments>http://dojo.codegreene.com/2011/11/plugins-every-wordpress-site-should-have-installed/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 15:25:45 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Disqus]]></category>
		<category><![CDATA[Google XML Sitemaps]]></category>
		<category><![CDATA[W3 Total Cache]]></category>
		<category><![CDATA[WordPress Database Backup]]></category>
		<category><![CDATA[WordPress SEO]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=846</guid>
		<description><![CDATA[We build several WordPress sites each month and our clients are always asking what plugins they should be using for their new WordPress site. Depending on the functionality of the site, the need for plugins vary. For example, if the client has a blog or plans to have a place for comments, I will always [...]]]></description>
			<content:encoded><![CDATA[<p>We build several WordPress sites each month and our clients are always asking what plugins they should be using for their new WordPress site. Depending on the functionality of the site, the need for plugins vary. For example, if the client has a blog or plans to have a place for comments, I will always recommend <strong>Disqus</strong> over Intense Debate and the default WordPress comment system because I think it functions better overall. I like the interface for Disqus much more then any other comment system and they have an Android app that makes it easy for me to moderate comments on the go.</p>
<p><img class="alignright size-full wp-image-850" style="margin: 0pt 0pt 0pt 10px;" title="W3-Total-Cache" src="http://dojo.codegreene.com/wp-content/uploads/2011/11/W3-Total-Cache.png" alt="" width="144" height="317" />When it comes to site performance, there is only one caching plugin that needs to even be talked about and that is <strong>W3 Total Cache</strong>. This plugin is so complete that it is shocking. It is packed with features and accounts for every type of WordPress user. It is very easy to configure and it actually works! I run a Lacrosse news website where I recently installed W3 Total Cache. According to the Google Analytics Site Speed metric, from September 17 to October 16, the average load time was 3.47 seconds. From October 17, the day I installed W3 Total Cache, to November 16, the average load time was 2.36 seconds. That is a difference of 1.21 seconds! The plugin also shows your Page Speed Report on your Admin Dashboard so you can see how well your site is performing. Every time I visit the site I am pleased with the results. <span id="more-846"></span></p>
<p>Every once in awhile, a WordPress install will be compromised and hacked. This can cause huge headaches and hassle if you are unprepared and don&#8217;t have a backup of your site. The remedy for the problem is to backup your database and files regularly. For database backups, I use <strong>WordPress Database Backup</strong>. It is very easy to use and you can customize what database tables will get backed up. Usually you want to backup all of them. I also love it because I have automated the process so I don&#8217;t have to worry about it. The plugin can be configured to send backups on a schedule that you choose. You can have it send Once Hourly, Twice Daily, Once Daily or Once Weekly. I have my lacrosse send it Once Daily. To continue the automation, I have setup a filter in Gmail to automatically archive the message so I don&#8217;t see it come in but I know it&#8217;s there! To backup files, I have to do it manually through FTP but most hosting services will offer a solution in some form or another.</p>
<p><img class="alignright size-full wp-image-852" style="margin: 0 0 0 10px;" title="WordPress-SEO" src="http://dojo.codegreene.com/wp-content/uploads/2011/11/WordPress-SEO.png" alt="" width="144" height="228" />Everyone who owns a site wants to have visitors and be found on Google. I&#8217;ve found that the <strong>WordPress SEO</strong> plugin is top notch when it comes to SEO. I love how it adds an admin box below your post or page that is stacked with options. It even provides a snippet of what your page will look like when people see it in on Google Search Results. You can also set a Focus Keyword, SEO Title, Meta Description and Meta Keywords. The Focus Keyword is cool because the plugin will tell you if you are using that keyword in your Article Heading, Page Title, Page URL, Content or Meta Description. Using this plugin will make you actually think about your SEO rather then just inserting words.</p>
<p>Along the same lines as SEO, I highly recommend having a sitemap for your site. For this, I use <strong>Google XML Sitemaps</strong>. I like how the plugin tells me the last time a sitemap was generated. It also tells me if Google, Bing and Ask.com were successfully notified. It&#8217;s a great little plugin that will help your site get noticed.</p>
<p>You&#8217;re probably saying to yourself, &#8220;What about a social plugin?&#8221; To that question, I would simply reply that I prefer to use the tools provided by the developer. I think that Twitters Tweet button and the Facebook Like button are perfect. If those two don&#8217;t tickle your fancy, then I would probably use AddThis or ShareThis.</p>
<p>What plugins do you use?</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/11/plugins-every-wordpress-site-should-have-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sendmail in Development Environment</title>
		<link>http://dojo.codegreene.com/2011/11/sendmail-in-development-environment/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sendmail-in-development-environment</link>
		<comments>http://dojo.codegreene.com/2011/11/sendmail-in-development-environment/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 16:40:35 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mail()]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=830</guid>
		<description><![CDATA[A few times in my career, I&#8217;ve had the need to test emailing in one form or another. I&#8217;ve also had the unfortunate experience of accidentally sending a test email to a real person. As you can imagine, this may cause confusion, embarrassment, lectures, and possibly the death of a small pixie or two. Fortunately, [...]]]></description>
			<content:encoded><![CDATA[<p>A few times in my career, I&#8217;ve had the need to test emailing in one form or another. I&#8217;ve also had the unfortunate experience of accidentally sending a test email to a real person. As you can imagine, this may cause confusion, embarrassment, lectures, and possibly the death of a small pixie or two. Fortunately, there IS a preventative measure you can take.</p>
<p>When it comes to mail() (as well as many other things), PHP prefers to delegate the heavy lifting to another piece of software: sendmail (or a sendmail compatible command-line mail transport agent). By default, PHP will call your sendmail binary, and pass it the entire message, after composing it from the headers and body supplied by the developer.</p>
<p>One of the side-benefits to this system is the ability to override PHP&#8217;s default, and seamlessly hook in your own sendmail-esque binary or script. My favorite parts of this hack, is that it doesn&#8217;t require a recompile of PHP or anything all too complicated, just a small change to your <strong>php.ini</strong> file.<span id="more-830"></span></p>
<p>So, without further delay, the magic:</p>
<p>In your php.ini file, change your sendmail path:</p>
<pre>sendmail_path=/usr/local/bin/trapmail</pre>
<p>And here&#8217;s what the script should have in it:</p>
<pre>you@devserver:~$ cat /usr/local/bin/trapmail
formail -R cc X-original-cc \
-R to X-original-to \
-R bcc X-original-bcc \
-f -A"To: devteam@example.com" \
| /usr/sbin/sendmail -t -i</pre>
<p>And what does this do? It traps all mail that would normally go OUT (say, to a customer), and instead, delivers it to devteam@example.com (with the original fields renamed for debugging purposes). Disaster avoided and pixies are forever in your debt!</p>
<p>Edit: Dont forget to make your trapmail script executable!</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/11/sendmail-in-development-environment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS3 PIE and WordPress</title>
		<link>http://dojo.codegreene.com/2011/10/css3-pie-and-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-pie-and-wordpress</link>
		<comments>http://dojo.codegreene.com/2011/10/css3-pie-and-wordpress/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 21:56:25 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSS Pie]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE7 CSS3]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=735</guid>
		<description><![CDATA[We all love CSS3 and the things we can do with it. It is saddening when a client opens up the site you just coded and doesn&#8217;t see all the CSS3 goodness because they are using some version of IE. Frequently, CSS3 PIE has saved me from the client saying: &#8220;Why don&#8217;t the buttons have [...]]]></description>
			<content:encoded><![CDATA[<p>We all love CSS3 and the things we can do with it. It is saddening when a client opens up the site you just coded and doesn&#8217;t see all the CSS3 goodness because they are using some version of IE. Frequently, <a href="http://css3pie.com/" target="_blank">CSS3 PIE</a> has saved me from the client saying: &#8220;Why don&#8217;t the buttons have the rounded corners like your design?&#8221;</p>
<p>CSS3 PIE makes some CSS3 features work in IE6 &#8211; 9. It supports border-radius, box-shadow, and linear-gradient. It works great and is super easy to set up. Unless you use it in WordPress. After some Google searching, a fair amount of testing, and a lot of grumbling I got it working in a WordPress site. It is really simple. I hope that this will save others from some headache.</p>
<p>1. Put the PIE.htc file in the WP Root directory and then reference it in your css as &#8211; behavior: url(&#8220;PIE.htc&#8221;);<br />
2. All the elements that use CSS3 features will need either position: relative or position: block on them</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/10/css3-pie-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Restructuring a flat MPTT array into a tree array</title>
		<link>http://dojo.codegreene.com/2011/06/restructuring-a-flat-mptt-array-into-a-tree-array/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=restructuring-a-flat-mptt-array-into-a-tree-array</link>
		<comments>http://dojo.codegreene.com/2011/06/restructuring-a-flat-mptt-array-into-a-tree-array/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 03:50:25 +0000</pubDate>
		<dc:creator>Benjam</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=661</guid>
		<description><![CDATA[I have a flat MPTT array (really any tree ordered array will work, not necessarily an MPTT array) which has it&#8217;s elements output in order as follows: Top Parent 1 Child 1-1 Child 1-2 Sub-Child 1-2-1 Sub-Child 1-2-2 Child 1-3 Top Parent 2 Child 2-1 &#8230; Each element is it&#8217;s own entry in the one [...]]]></description>
			<content:encoded><![CDATA[<p>I have a flat <acronym title="Modified Pre-ordered Tree Traversal">MPTT</acronym> array (really any tree ordered array will work, not necessarily an MPTT array) which has it&#8217;s elements output in order as follows:</p>
<ul>
<li>Top Parent 1</li>
<li>Child 1-1</li>
<li>Child 1-2</li>
<li>Sub-Child 1-2-1</li>
<li>Sub-Child 1-2-2</li>
<li>Child 1-3</li>
<li>Top Parent 2</li>
<li>Child 2-1</li>
<li>&#8230;</li>
</ul>
<p>Each element is it&#8217;s own entry in the one dimensional array.  This makes outputting that data in any kind of readable form very difficult, where keeping track of parents and branches are required in order to make sense of it.  This gets pretty messy, pretty quickly.  And the deeper the tree, the more complicated the process.</p>
<p>To make this easier to deal with, the array should be built in a tree format as follows:</p>
<ul>
<li>Top Parent 1
<ul>
<li>Child 1-1</li>
<li>Child 1-2
<ul>
<li>Sub-Child 1-2-1</li>
<li>Sub-Child 1-2-2</li>
</ul>
</li>
<li>Child 1-3</li>
</ul>
</li>
<li>Top Parent 2
<ul>
<li>Child 2-1</li>
<li>&#8230;</li>
</ul>
</li>
</ul>
<p>Where the children of the elements in the tree are actually children of the elements in the array.</p>
<p>In order to do this quickly and painlessly, we are going to parse through this array twice&#8230; no iterations, just a couple of foreach loops and we&#8217;ll get our tree exactly how we want it.</p>
<p>In order to do this, we must first make sure our array indexes are the same as the IDs of the items we are sorting (because we are pulling this from a database, right?).</p>
<p>To do this in CakePHP we run it through the Set::combine function like so:<br />
<code>Set::combine($tree_data, '/Model/id', '/.');</code></p>
<p>If you are not using CakePHP, you can create a new array, and as you foreach through your original array, set elements in the new array accordingly:<br />
<code>
<pre>
$old_tree_data = $tree_data;
$tree_data = array( );
foreach ($old_tree_data as $node) {
	$tree_data[$node['Model']['id']] = $node;
}
</pre>
<p></code></p>
<p>Now that we have our array indexes set to our model ID, we can proceed.</p>
<p>The trick to this method is not to move the nodes around, because if we did that, we&#8217;d still have to keep track of what went where, and that&#8217;s exactly what we&#8217;re trying to avoid.  Instead, we&#8217;re going to use references to keep track of our data as it gets moved around.  That way we still have our original base array element that we can play with without having to know where it actually is in the tree.</p>
<p>Here is the code, and then we&#8217;ll go through it and explain.<br />
<code>
<pre>
foreach ($tree_data as $key =&gt; $node) {
	if ( ! $node['Model']['parent_id']) {
		continue;
	}

	if ( ! isset($tree_data[$node['Model']['parent_id']]['Child'])) {
		$tree_data[$node['Model']['parent_id']]['Child'] = array( );
	}

	$tree_data[$node['Model']['parent_id']]['Child'][] =&amp; $tree_data[$key];
}
</pre>
<p></code></p>
<p>Now to explain&#8230; We parse through the array and for each element, we first test the element to see if it has a parent, if it does not, we just skip it, there&#8217;s no need to go further.</p>
<p>We then check and see if the parent element has an index called &#8216;Child&#8217; and if it does not, we create one and set it as an array.</p>
<p>Then we do the magic.  We set the next item in the parent node&#8217;s Child element to the <em><strong>reference</strong></em> of the current node.  We don&#8217;t actually move the node.  So now if you look at the array, you&#8217;ll see two entries for the current node, one inside the parent element, and one that was the original in the flat array.</p>
<p><strong>WARNING</strong>: One thing to note here, is that we are not setting it to the reference of <code>$node</code>, but to the reference of <code>$tree_data[$key]</code>.  The reason for this is because if the element is referenced to <code>$node</code>, the next time through the loop, <strong>all</strong> of the referenced elements will also be set to the new value of <code>$node</code>, and we certainly don&#8217;t want that.</p>
<p>The magical part of this, is that no matter where the references end up, the original is still there to be modified.  So for instance if I have a branch path with IDs as follows: 12, 5, 13, 14&#8230; it doesn&#8217;t matter what that path is, I can still access the element with ID 14 by modifying <code>$tree_data[14]</code>.  So if element 14 has child nodes, I can place them in the tree by modifying <code>$tree_data[14]['Child']</code>, and wherever that node is actually supposed to be, it will get modified there as well.  That&#8217;s the beauty of references.</p>
<p>Now to clean up the array, we just parse through it once more, and clear out the original reference nodes (the ones that have parents):<br />
<code>
<pre>
foreach ($tree_data as $key =&gt; $node) {
	if ( ! empty($tree_data['Model']['parent_id']) {
		unset($tree_data[$key]);
	}
}
</pre>
<p></code></p>
<p>And that&#8217;s it! No messing around with paths&#8230; no iterative functions&#8230; just twice through an array (maybe three times), and it&#8217;s all sorted, compartmentalized, and pretty.</p>
<p>If you have other methods of getting your trees into a usable form, please let us know in the comments.  We love seeing how other people do things.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/06/restructuring-a-flat-mptt-array-into-a-tree-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recent Work: SLC Dental Center</title>
		<link>http://dojo.codegreene.com/2011/01/recent-work-slc-dental-center/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recent-work-slc-dental-center</link>
		<comments>http://dojo.codegreene.com/2011/01/recent-work-slc-dental-center/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 20:52:56 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Business Card Site]]></category>
		<category><![CDATA[SLC Dental Center]]></category>
		<category><![CDATA[WordPress Design]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=784</guid>
		<description><![CDATA[Dr. Stoker recently graduated from Dental School and found a home in an office building in Salt Lake City. He needed to build his patient list so he figured a business card website would help get him more patients. Enter Code Greene. Luke started Dr. Stoker down the right path by giving him a clean, [...]]]></description>
			<content:encoded><![CDATA[<p>Dr. Stoker recently graduated from Dental School and found a home in an office building in Salt Lake City. He needed to build his patient list so he figured a business card website would help get him more patients. Enter Code Greene.</p>
<p>Luke started Dr. Stoker down the right path by giving him a clean, business design. I finished off the job with a custom WordPress theme that allows Dr. Stoker and staff to easily enter in new content and keep the site fresh, just like their patients breath!</p>
<p>Dr. Stokers practice is off and running with great success.</p>
<p><a href="http://www.slcdentalcenter.com" target="_blank">Check out the site</a> and let us know what you think!</p>
<p><img class="alignnone size-full wp-image-794" title="dental-center" src="http://dojo.codegreene.com/wp-content/uploads/2011/11/dental-center.jpg" alt="SLC Dental Center" width="520" height="390" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2011/01/recent-work-slc-dental-center/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharpening the Blades: Useful Tweets</title>
		<link>http://dojo.codegreene.com/2010/09/sharpening-the-blades-useful-tweets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharpening-the-blades-useful-tweets</link>
		<comments>http://dojo.codegreene.com/2010/09/sharpening-the-blades-useful-tweets/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 19:30:58 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://dojo.codegreene.com/?p=632</guid>
		<description><![CDATA[Below are some tweets that I have seen recently that I have found to be helpful. Smashing Magazine &#8211; HTML5/CSS3 Cheatsheet &#8211; http://bit.ly/aj0yfA Ben Ludman &#8211; URL shorteners and CakePHP &#8211; Snook.ca http://bit.ly/btTmSP And this site &#8211; HTML5 Doctor &#8211; I couldn&#8217;t track down the tweet that I found it from, but it is a [...]]]></description>
			<content:encoded><![CDATA[<p>Below are some tweets that I have seen recently that I have found to be helpful.</p>
<p><a href="http://twitter.com/smashingmag" target="_blank">Smashing Magazine</a> &#8211; HTML5/CSS3 Cheatsheet &#8211; <a rel="nofollow" href="http://bit.ly/aj0yfA" target="_blank">http://bit.ly/aj0yfA</a></p>
<p><a href="http://twitter.com/benludman" target="_blank">Ben Ludman</a> &#8211; URL shorteners and CakePHP &#8211; Snook.ca <a rel="nofollow" href="http://bit.ly/btTmSP" target="_blank">http://bit.ly/btTmSP</a></p>
<p>And this site &#8211; <a href="http://html5doctor.com/" target="_blank">HTML5 Doctor</a> &#8211; I couldn&#8217;t track down the tweet that I found it from, but it is a great resource for HTML5.</p>
<p>I looked for some tweets about Magento, but just couldn&#8217;t find any that were appealing.</p>
]]></content:encoded>
			<wfw:commentRss>http://dojo.codegreene.com/2010/09/sharpening-the-blades-useful-tweets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

