<?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>Sean Gates' Blog &#187; Web Development</title>
	<atom:link href="http://www.seangates.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seangates.com</link>
	<description>By the looks of it {he thinks} he knows what he's doing.</description>
	<lastBuildDate>Sat, 10 Jul 2010 21:22:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CodeIgniter and SSL</title>
		<link>http://www.seangates.com/2010/07/09/codeigniter-and-ssl/</link>
		<comments>http://www.seangates.com/2010/07/09/codeigniter-and-ssl/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 05:13:07 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.seangates.com/?p=91</guid>
		<description><![CDATA[I&#8217;m sure there are lots of resources for this, but here is a fairly robust one (WARNING: Don&#8217;t do what Mohammed did! I&#8217;ll tell you why in a second): http://sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter/ So, what&#8217;s wrong with the approach? He&#8217;s editing core files which is a big no no. He should be extending the functionality of the core [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure there are lots of resources for this, but here is a fairly robust one (WARNING: Don&#8217;t do what Mohammed did!  I&#8217;ll tell you why in a second):</p>
<p><a href="http://sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter/">http://sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter/</a></p>
<p>So, what&#8217;s wrong with the approach?  He&#8217;s <strong>editing core files</strong> which is a big no no.  He should be extending the functionality of the core files.  For example, here are the two files I now have in my site:</p>
<p><code>/application/helpers/MY_url_helper.php<br />
/application/libraries/MY_Config.php</code></p>
<p>Then, I placed the following code in each of those files, respectively:<br />
<span id="more-91"></span></p>
<h3>MY_url_helper.php</h3>
<pre class="brush: php;">&lt;?php
if( ! function_exists('secure_site_url') )
{
    function secure_site_url($uri = '')
    {
        $CI =&amp; get_instance();
        return $CI-&gt;config-&gt;secure_site_url($uri);
    }
}

if( ! function_exists('secure_base_url') )
{
    function secure_base_url()
    {
        $CI =&amp; get_instance();
        return $CI-&gt;config-&gt;slash_item('secure_base_url');
    }
}

if ( ! function_exists('secure_anchor'))
{
    function secure_anchor($uri = '', $title = '', $attributes = '')
    {
        $title = (string) $title;

        if ( ! is_array($uri))
        {
            $secure_site_url = ( ! preg_match('!^\w+://! i', $uri)) ? secure_site_url($uri) : $uri;
        }
        else
        {
            $secure_site_url = secure_site_url($uri);
        }

        if ($title == '')
        {
            $title = $secure_site_url;
        }

        if ($attributes != '')
        {
            $attributes = _parse_attributes($attributes);
        }

        return '&lt;a href=&quot;'.$secure_site_url.'&quot;&gt;'.$title.'&lt;/a&gt;';
    }
}

if ( ! function_exists('secure_redirect'))
{
    function secure_redirect($uri = '', $method = 'location', $http_response_code = 302)
    {
        switch($method)
        {
            case 'refresh'    : header(&quot;Refresh:0;url=&quot;.secure_site_url($uri));
                break;
            default            : header(&quot;Location: &quot;.secure_site_url($uri), TRUE, $http_response_code);
                break;
        }
        exit;
    }
}

if (! function_exists('force_ssl'))
{
    function force_ssl()
    {
        if ($_SERVER[&quot;SERVER_PORT&quot;] != 443)
        {
            redirect(str_replace(&quot;http://&quot;, &quot;https://&quot; , current_url()), &quot;refresh&quot;);
        }
    }
}</pre>
<h3>MY_Config.php</h3>
<pre class="brush: php;">&lt;?php
class MY_Config extends CI_Config {

	function MY_Config()
	{
		parent::CI_Config();
	}

	function secure_site_url($uri = '')
	{
	    if (is_array($uri))
	    {
	        $uri = implode('/', $uri);
	    }

	    if ($uri == '')
	    {
	        return $this-&gt;slash_item('secure_base_url').$this-&gt;item('index_page');
	    }
	    else
	    {
	        $suffix = ($this-&gt;item('url_suffix') == FALSE) ? '' : $this-&gt;item('url_suffix');
	       return $this-&gt;slash_item('secure_base_url').$this-&gt;slash_item('index_page').preg_replace(&quot;|^/*(.+?)/*$|&quot;, &quot;\\1&quot;, $uri).$suffix;
	    }
	}
}</pre>
<p>Now, that was easy, wasn&#8217;t it?  Go forth and do awesome stuff with this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2010/07/09/codeigniter-and-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jason Fried is Right</title>
		<link>http://www.seangates.com/2009/11/02/jason-fried-is-right/</link>
		<comments>http://www.seangates.com/2009/11/02/jason-fried-is-right/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 18:17:29 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.seangates.com/?p=80</guid>
		<description><![CDATA[Today I came across an article at Inc.com about Jason Fried. Jason was answering questions about the way he works. This part stuck out to me: Our blog has more than 100,000 readers, but I don&#8217;t post every day. I write when I have something specific to say. I recently wrote a scathing piece on [...]]]></description>
			<content:encoded><![CDATA[<p>Today I came across an <a href="http://www.inc.com/magazine/20091101/the-way-i-work-jason-fried-of-37signals.html">article at Inc.com about Jason Fried</a>.  Jason was answering questions about the way he works.  This part stuck out to me:</p>
<blockquote><p>Our blog has more than 100,000 readers, but I don&#8217;t post every day. I write when I have something specific to say. I recently wrote a scathing piece on the tech media. It really bothers me that the definition of success has changed from profits to followers, friends, and feed count. This crap doesn&#8217;t mean anything. Kids are coming out of school thinking, I want to start the next YouTube or Facebook. If a restaurant served more food than everybody else but lost money on every diner, would it be successful? No. But on the Internet, for some reason, if you have more users than everyone else, you&#8217;re successful. No, you&#8217;re not.</p></blockquote>
<p>I wholeheartedly agree with him. The sites which have the most users have some information capital, for sure, but they may not have a sustainable revenue stream. I believe Jason Fried and 37 signals have one of the best business models and some of the best products online.</p>
<p>I believe I came to this realization a long time ago: any services that I build need to be profitable from the beginning, and can self-sustain even on a limited user base.  This is where true value will be for the users of your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2009/11/02/jason-fried-is-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TurnItUp Media &#8230; DOA</title>
		<link>http://www.seangates.com/2009/10/04/turnitup-media-doa/</link>
		<comments>http://www.seangates.com/2009/10/04/turnitup-media-doa/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 02:21:18 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[dead]]></category>
		<category><![CDATA[failed]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[TurnItUp Media]]></category>

		<guid isPermaLink="false">http://www.seangates.com/2009/10/04/turnitup-media-doa/</guid>
		<description><![CDATA[Well, I&#8217;m sad to say that TurnItUp Media is now officially dead. It was a great idea, and one that had my full support and faith, but it wasn&#8217;t enough. Of course, I learned an incredible amount and feel the experience was invaluable to my current work. There were things I truly could have done [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;m sad to say that TurnItUp Media is now officially dead.  It was a great idea, and one that had my full support and faith, but it wasn&#8217;t enough.</p>
<p>Of course, I learned an incredible amount and feel the experience was invaluable to my current work.  There were things I truly could have done without (like mild panic attacks, being away from my wife, etc.) but on the whole I learned a ton.</p>
<p>In the end I feel that I gave it my all, and no matter what happens in the future, I don&#8217;t have any regrets.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2009/10/04/turnitup-media-doa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Companies</title>
		<link>http://www.seangates.com/2009/05/09/65/</link>
		<comments>http://www.seangates.com/2009/05/09/65/#comments</comments>
		<pubDate>Sat, 09 May 2009 22:55:21 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.seangates.com/2009/05/09/65/</guid>
		<description><![CDATA[I&#8217;ve been in contact with a few great companies lately, all who have really good contacts for contract work, and have great people running them. Firstoff, my friend Mitch has started http://barkingants.com. He seems to be picking up steam with his work, which is mostly small- and medium-sized websites. His work and development knowledge are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in contact with a few great companies lately, all who have really good contacts for contract work, and have great people running them.</p>
<p>Firstoff, my friend Mitch has started <a href="http://barkingants.com">http://barkingants.com</a>.  He seems to be picking up steam with his work, which is mostly small- and medium-sized websites.  His work and development knowledge are top notch.</p>
<p>Then, there is <a href="http://bluetractor.com">http://bluetractor.com</a> which is the online home of my friend John Thomas.  John specializes in flash presentations, and even flash games, but he also does a lot of traditional web design.  Look for Blue Tractor to break out this year with a lot of great work.</p>
<p>Lastly, there is <a href="http://gelfusion.org">http://gelfusion.org</a>, whom I just met this week.  Greg is the principle owner and he has a vast amount of experience in the online world.  I&#8217;m finding he is the silent type doing delivery of work for some pretty well-known clients, and doing awesome at it in the meantime.</p>
<p>Anyhow, things are still going okay for me.  I can&#8217;t believe it&#8217;s been over a year since I moved to the Nashville area.  Time really flies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2009/05/09/65/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Related Bridge in EE</title>
		<link>http://www.seangates.com/2008/05/01/related-bridge-in-ee/</link>
		<comments>http://www.seangates.com/2008/05/01/related-bridge-in-ee/#comments</comments>
		<pubDate>Thu, 01 May 2008 21:49:27 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Expression Engine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.seangates.com/2008/05/01/related-bridge-in-ee/</guid>
		<description><![CDATA[I&#8217;ve been using Expression Engine for a couple of weeks now, mostly for work projects. It&#8217;s been good to see how a group of people have thought of abstracting data for almost any application. It will be interesting to see if it can solve many of the problems I&#8217;ve run into when developing extremely custom [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Expression Engine for a couple of weeks now, mostly for work projects.  It&#8217;s been good to see how a group of people have thought of abstracting data for almost any application.  It will be interesting to see if it can solve many of the problems I&#8217;ve run into when developing extremely custom applications.</p>
<p>So, one problem that we&#8217;ve come across is a way to relate several tables (or weblogs as EE calls them) together.  An example would be like so:  doctors, their specialties, and the locations of their practice.  A likely scenario is a user wants to find out what locations provide a certain specialty.  Thus, you have to use the doctors as the bridge of the data.</p>
<p>In Expression Engine you can use a related field to tie two tables of data together.  For instance, I can tie a Doctor to a certain specialty using a related field.  But, creating a bridge between the doctors&#8217; specialties and all the locations is not possible without a little custom programming.</p>
<p>Also, throw in the mix that doctors can have offices at several locations, and you&#8217;ve got a hairy set of data. (We&#8217;re using the multi-relationship plug-in from <a href="http://expressionengine.com/forums/viewthread/39595/">here</a>).<br />
<span id="more-57"></span><br />
So, let&#8217;s get to the code.</p>
<pre class="brush: php;">&lt;?php
global $DB;
$addresses = $DB-&gt;query(&quot;SELECT * FROM `exp_weblog_data` WHERE weblog_id = 6&quot;);
foreach($addresses-&gt;result as $address){
	$doctors = $DB-&gt;query(&quot;SELECT * FROM `exp_weblog_data` WHERE weblog_id = 3&quot;);
	foreach($doctors-&gt;result as $doc){
		$rel_field_ids = array(2);
		$rel_field_ids_new = '';
		$rel_field_ids[0] = $doc['field_id_34'];
		$rel_field_ids[1] = ereg_replace(&quot;\r&quot;,&quot;,&quot;,$doc['field_id_35']);
		$rel_field_ids_new = &quot;'&quot; . implode(&quot;','&quot;,$rel_field_ids) . &quot;'&quot;;
		$specialties = $DB-&gt;query(&quot;SELECT * FROM exp_relationships WHERE rel_id IN (&quot; . $rel_field_ids_new . &quot;)&quot;);
		foreach($specialties-&gt;result as $specialty){
			if($specialty['rel_child_id'] == $address['entry_id']){
				$specs[] = $specialty['rel_parent_id'];
			}
		}
	}

	if(sizeof($specs) &gt; 0) {
		$specialties_ids = $DB-&gt;query(&quot;SELECT field_id_13 FROM exp_weblog_data WHERE entry_id IN(&quot; . implode($specs,',') . &quot;)&quot;);
		foreach($specialties_ids-&gt;result as $s_id){
			$related_spec = $DB-&gt;query(&quot;SELECT * FROM exp_relationships WHERE rel_id = &quot; . $s_id['field_id_13']);
			$related_spec_title = $DB-&gt;query(&quot;SELECT title FROM exp_weblog_titles WHERE entry_id = &quot; . $related_spec-&gt;row['rel_child_id']);
			if(!in_array($related_spec_title-&gt;row['title'],$titles_array)){ $titles_array[] = $related_spec_title-&gt;row['title']; }
		}
	}
	implode($titles_array,&quot;','&quot;)
}
?&gt;</pre>
<p>So, in a nutshell the code above will compare the locations with the specialties using the exp_relationships table and the doctor as the bridge.</p>
<p>I had to think about it a bit, but you kinda get the idea.  I hope this helps someone out there struggling with the same issue.</p>
<p>Happy coding.</p>
<p><strong>Note:</strong> When copying this code make sure you replace the curly quotes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2008/05/01/related-bridge-in-ee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Gem</title>
		<link>http://www.seangates.com/2008/04/22/jquery-gem/</link>
		<comments>http://www.seangates.com/2008/04/22/jquery-gem/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 04:50:44 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Javscript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.seangates.com/2008/04/22/jquery-gem/</guid>
		<description><![CDATA[Here is a little jQuery gem I was able to figure out. $(".outerDiv").hover( function(){ $(this).find(".innerDiv").show(); }, function(){ $(this).find(".innerDiv").hide(); } ); What the above code does is show &#60;div class="innerDiv">&#60;/div> when &#60;div class="outerDiv">&#60;/div> is hovered, and return the innerDiv to a hidden state when the the hover is lost. I found this useful to show edit [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little jQuery gem I was able to figure out.<br />
<code><br />
$(".outerDiv").hover(<br />
	function(){ $(this).find(".innerDiv").show(); },<br />
	function(){ $(this).find(".innerDiv").hide(); }<br />
);<br />
</code><br />
What the above code does is show <code>&lt;div class="innerDiv">&lt;/div></code> when <code>&lt;div class="outerDiv">&lt;/div></code> is hovered, and return the innerDiv to a hidden state when the the hover is lost.</p>
<p>I found this useful to show edit and delete links when a user hovered over a particular database item.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2008/04/22/jquery-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldfusion and bad-for-you-coffee</title>
		<link>http://www.seangates.com/2008/04/15/coldfusion-and-bad-for-you-coffee/</link>
		<comments>http://www.seangates.com/2008/04/15/coldfusion-and-bad-for-you-coffee/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 14:54:25 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.seangates.com/2008/04/15/coldfusion-and-bad-for-you-coffee/</guid>
		<description><![CDATA[I was a bit surprised when I came across this post today, and so frustrated by it that I had to write about it. Read it here: JeremiahX on Coldfusion In a nutshell, J. J. speaks of his affinity for ColdFusion, and how it is like the best-tasting coffee that everyone loves to hate. I [...]]]></description>
			<content:encoded><![CDATA[<p>I was a bit surprised when I came across this post today, and so frustrated by it that I had to write about it.</p>
<p>Read it here: <a href="http://jeremiahx.com/2008/04/11/coldfusion-is-to-programming-as-starbucks-is-to-coffee/">JeremiahX on Coldfusion</a></p>
<p>In a nutshell, J. J. speaks of his affinity for ColdFusion, and how it is like the best-tasting coffee that everyone loves to hate.  I would liken that to the best operating system everyone loves to hate, Windows &#8230; if you catch my drift.  Those of you that know me know that I am platform agnostic, language agnostic, and altogether technology agnostic.  I&#8217;ve worked in almost every web development environment and have solid web development chops to be able to speak about what works and what doesn&#8217;t.</p>
<p>ColdFusion doesn&#8217;t work.</p>
<p>Granted, I haven&#8217;t been so incredibly deep in the trenches that I understand all of it&#8217;s nuances, standards, techniques.  But, who does?  What I&#8217;m getting at here is that programming is an imaginative thing most of the time.  And with ColdFusion I don&#8217;t feel I can imagine very far.  There&#8217;s really only so much you can do with it.</p>
<p>Also, Adobe has continued to shuffle their feet in developing anything new for ColdFusion, and they are really behind the curve.  From a business perspective, companies who utilize ColdFusion in their software development will continue to use it, but they will always be fixing problems other languages have fixed years ago.</p>
<p>PHP, on the other hand, is used much more widely that ColdFusion, and for good reason.  It&#8217;s adoption points to the fact that it has a very small learning curve, has mounds and mounds of support on the Internet, is FREE, is platform independent, and has blazingly fast compilation.  And, PHP is as up-to-date as it comes to supporting the newest web technologies and making it easy to develop with.  Oh, and did I mention it&#8217;s FREE?</p>
<p>And coffee is bad for you, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2008/04/15/coldfusion-and-bad-for-you-coffee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New job &#8230;</title>
		<link>http://www.seangates.com/2008/03/12/new-job/</link>
		<comments>http://www.seangates.com/2008/03/12/new-job/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 00:43:43 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.seangates.com/2008/03/12/new-job/</guid>
		<description><![CDATA[Just a quick note to say that I&#8217;ve got a new job. It&#8217;s taken me 3 weeks to get it on here. Anyhow, the new place is Paramore &#124; Redd Online Marketing. A great place to work. They&#8217;re an all Apple shop, too. So, they must be cool.]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to say that I&#8217;ve got a new job.  It&#8217;s taken me 3 weeks to get it on here.  Anyhow, the new place is <a href="http://www.paramoreredd.com">Paramore | Redd Online Marketing</a>.  A great place to work.  They&#8217;re an all Apple shop, too.  So, they must be cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2008/03/12/new-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The First Month</title>
		<link>http://www.seangates.com/2007/10/10/the-first-month/</link>
		<comments>http://www.seangates.com/2007/10/10/the-first-month/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 18:09:54 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Mormon Potluck]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.seangates.com/?p=46</guid>
		<description><![CDATA[Well, I&#8217;ve been working at Yahoo! for a month now and am thoroughly enjoying it. The people are great, and the atmosphere fosters innovation and creativity. Just what I&#8217;m looking for. Plus, all the soda you can drink. Now that&#8217;s something for a midnight-oil-burning developer to cherish. Of course, in order to land this gig [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;ve been working at Yahoo! for a month now and am thoroughly enjoying it.  The people are great, and the atmosphere fosters innovation and creativity.  Just what I&#8217;m looking for.  Plus, all the soda you can drink.  Now that&#8217;s something for a midnight-oil-burning developer to cherish.</p>
<p>Of course, in order to land this gig I had to move to Atlanta, GA.  It hasn&#8217;t been all that bad though.  I&#8217;ve met some great people who have helped me bunches.  I can&#8217;t thank them enough.</p>
<p>On another note, the <a href="http://www.mormonpotluck.com">Mormon Potluck Podcast</a> is now up to <a href="http://www.mormonpotluck.com/2007/10/06/mormon-potluck-podcast-episode-11/">Episode 11</a>, and we&#8217;re recording Episode 12 this week.  We are still on a roll and having a lot of fun with it.  If you&#8217;re interested <a href="http://www.mormonpotluck.com">check it out</a>.  You can also subscribe to the podcast feed using iTunes (the best way in my book).</p>
<p>Hope you&#8217;re having a great day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2007/10/10/the-first-month/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Columns in Select Boxes</title>
		<link>http://www.seangates.com/2007/03/23/columns-in-select-boxes/</link>
		<comments>http://www.seangates.com/2007/03/23/columns-in-select-boxes/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 20:17:44 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.seangates.com/?p=36</guid>
		<description><![CDATA[I came across a problem yesterday where I needed to create columns in select boxes. My issue revolved around showing an ID in the left column, and a description of the ID in the right column. This is due to the fact that people in our organization know most things by their ID, but my [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a problem yesterday where I needed to create columns in select boxes.  My issue revolved around showing an ID in the left column, and a description of the ID in the right column.  This is due to the fact that people in our organization know most things by their ID, but my not know how to distinguish between similar IDs.  The ids are alphanumeric.  For example: SYS2007.  This could mean &#8220;System 2007&#8243;.  Then there could be one called SYS2007B.  Similar, but different.</p>
<p>So, I searched the web and found nothing about doing it in HTML or CSS (I figured as much but gave it a shot anyway).  Then I came up with this idea: use a fixed width font and fill in missing spaces.  So, I made the select box use courier.</p>
<pre>&lt;select ... style="font-family: courier;"&gt;</pre>
<p>Then I set about populating the box (using PHP of course) and came up with a small tidbit to fill in the extra spaces:</p>
<pre>formatID($id){</pre>
<pre>$str_length = strlen($id);</pre>
<pre>for($i=0; $i&lt;(15-$str_length); $i++){</pre>
<pre>$add_spaces = $add_spaces . ' ';</pre>
<pre>}</pre>
<pre>return $id . $add_spaces;</pre>
<pre>}</pre>
<p>Now, I use the function when looping through and building the select box:</p>
<pre>foreach($ps as $p){</pre>
<pre>echo '&lt;option id="' . $p-&gt;ID . '"</pre>
<pre>value="' . $p-&gt;ID . '"&gt;' .</pre>
<pre>formatSCN($p-&gt;ID) . $p-&gt;Title .</pre>
<pre>'&lt;/option&gt;';</pre>
<pre>}</pre>
<p>So, now what comes out is a column at the front that is formatted with a fixed width of characters.  Now you could do this if you wanted to format any number of columns, and not just the first. It may be cool if this showed 5 or 10+ columns of data.  But, that may be a usability issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seangates.com/2007/03/23/columns-in-select-boxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
