<?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>Tony Thomas &#187; admin</title>
	<atom:link href="http://anthonygthomas.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://anthonygthomas.com</link>
	<description>Father to two, husband to one, web developer and musician.</description>
	<lastBuildDate>Fri, 11 Nov 2011 14:00:07 +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>Substratum: Tiny, Semantic CSS Framework for Creating Columns</title>
		<link>http://anthonygthomas.com/2011/10/25/substratum-tiny-semantic-css-framework-for-creating-columns/</link>
		<comments>http://anthonygthomas.com/2011/10/25/substratum-tiny-semantic-css-framework-for-creating-columns/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 02:28:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Substratum]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=605</guid>
		<description><![CDATA[I wrote about this a while back, but I thought I&#8217;d make it official since I&#8217;ve used it on the last few projects I&#8217;ve worked on. I&#8217;ve named my mini CSS framework for creating columns and put it in a Mercurial repository. It&#8217;s very small (412 kb minified), semantic and aims to stay out of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://anthonygthomas.com/2011/04/18/css-scaffolding/">I wrote about this a while back</a>, but I thought I&#8217;d make it official since I&#8217;ve used it on the last few projects I&#8217;ve worked on. I&#8217;ve <a href="https://bitbucket.org/truetone/substratum" onclick="pageTracker._trackPageview('/outgoing/bitbucket.org/truetone/substratum?referer=');">named my mini CSS framework for creating columns and put it in a Mercurial repository</a>. It&#8217;s very small (412 kb minified), semantic and aims to stay out of the way. It also needs some thorough browser testing. Have at it folks.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2011/10/25/substratum-tiny-semantic-css-framework-for-creating-columns/" rel="bookmark" title="October 25, 2011">Substratum: Tiny, Semantic CSS Framework for Creating Columns</a></li>
<li><a href="http://anthonygthomas.com/2011/04/18/css-scaffolding/" rel="bookmark" title="April 18, 2011">CSS Scaffolding</a></li>
<li><a href="http://anthonygthomas.com/2008/12/16/when-using-a-grid-layout-css-framework-do-the-math/" rel="bookmark" title="December 16, 2008">When Using a Grid Layout CSS Framework, Do the Math</a></li>
<li><a href="http://anthonygthomas.com/2009/11/09/blueprint-taking-a-close-look-at-grid-css/" rel="bookmark" title="November 9, 2009">Blueprint: Taking a Close Look at grid.css</a></li>
<li><a href="http://anthonygthomas.com/2008/11/22/blueprint-css-tutorial-file/" rel="bookmark" title="November 22, 2008">Blueprint CSS Tutorial File</a></li>
</ul>
<p><!-- Similar Posts took 4.678 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2011/10/25/substratum-tiny-semantic-css-framework-for-creating-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Theme</title>
		<link>http://anthonygthomas.com/2011/05/17/new-theme/</link>
		<comments>http://anthonygthomas.com/2011/05/17/new-theme/#comments</comments>
		<pubDate>Wed, 18 May 2011 02:51:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=580</guid>
		<description><![CDATA[I did a soft launch of my new WordPress theme last week. There are a few things I&#8217;d like to point out. First is the decision to go to HTML5. HTML5 (combined with the HTML5 Shiv) actually made writing the styles quite a bit simpler. It&#8217;s a bit of adjustment after writing XHTML for so [...]]]></description>
			<content:encoded><![CDATA[<p>I did a soft launch of my new WordPress theme last week. There are a few things I&#8217;d like to point out. First is the decision to go to HTML5. HTML5 (<a href="http://code.google.com/p/html5shiv/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/html5shiv/?referer=');">combined with the HTML5 Shiv</a>) actually made writing the styles quite a bit simpler. It&#8217;s a bit of adjustment after writing XHTML for so long, but when it came time to write the styles the new tags <em>meant fewer ids and classes</em>. I found that very handy.</p>
<p>Also I&#8217;m using less JavaScript than I was before. Instead the hover effects are accomplished using CSS3 transitions.<span id="more-580"></span></p>
<p>For instance, here is the CSS for the hover effect on the sidebar nav:</p>
<pre class="brush: css; title: ; notranslate">-webkit-transition-property: background, margin-left;
-webkit-transition-duration: 0.5s, 0.5s;
-webkit-transition-timing-function: linear, ease-in;
-moz-transition-property: background margin-left;
-moz-transition-duration: 0.5s, 0.5s;
-moz-transition-timing-function: linear, ease-in;
-o-transition-property: background margin-left;
-o-transition-duration: 0.5s, 0.5s;
-o-transition-timing-function: linear, ease-in;
transition-property: background margin-left;
transition-duration: 0.5s, 0.5s;
transition-timing-function: linear, ease-in;</pre>
<p>Then I simply redefine the background, right and left margins for the hover state:</p>
<pre class="brush: css; title: ; notranslate">background: #0D7B15;
margin-left: -1em;</pre>
<p>The browser then just takes 0.5 seconds to transition from the default state to the hover state.</p>
<p>I also added some other transitions as well. For instance, you can delay when the transition starts. See if you can spot this one:</p>
<pre class="brush: css; title: ; notranslate">-webkit-transition-property: top, left;
-webkit-transition-duration: 5s, 5s;
-webkit-transition-timing-function: linear, linear;
-webkit-transition-delay: 32s, 32s;
-moz-transition-property: top, left;
-moz-transition-delay: 32s, 32s;
-moz-transition-duration: 5s, 5s;
-moz-transition-timing-function: linear, linear;transition-property: top, left;
transition-duration: 5s, 5s;
transition-delay: 32s, 32s;
transition-timing-function: linear, ease-in-out;</pre>
<p>This effect is attached to an &#8216;animate&#8217; class that is triggered by JQuery when the page loads. There&#8217;s a 32 second delay and then the transition between states begins. It&#8217;s pretty fun stuff.</p>
<p>Caveat: <a href="http://caniuse.com/#search=transitions" onclick="pageTracker._trackPageview('/outgoing/caniuse.com/_search=transitions?referer=');">Transitions are only supported in Firefox 4+, but they&#8217;ve been supported in WebKit browsers for a long time. Internet Explorer will not support them until version 10</a>.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2011/05/17/new-theme/" rel="bookmark" title="May 17, 2011">New Theme</a></li>
<li><a href="http://anthonygthomas.com/2010/03/20/no-flash-required/" rel="bookmark" title="March 20, 2010">No Flash Required</a></li>
<li><a href="http://anthonygthomas.com/2009/11/09/blueprint-taking-a-close-look-at-grid-css/" rel="bookmark" title="November 9, 2009">Blueprint: Taking a Close Look at grid.css</a></li>
<li><a href="http://anthonygthomas.com/2011/03/05/when-to-use-the-css-content-property/" rel="bookmark" title="March 5, 2011">When to Use CSS content Property</a></li>
<li><a href="http://anthonygthomas.com/2010/02/14/why-use-blueprint-and-the-960-grid-system-in-the-baseline-theme/" rel="bookmark" title="February 14, 2010">Why Use Blueprint and the 960 Grid System in the Baseline Theme?</a></li>
</ul>
<p><!-- Similar Posts took 4.240 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2011/05/17/new-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Scaffolding</title>
		<link>http://anthonygthomas.com/2011/04/18/css-scaffolding/</link>
		<comments>http://anthonygthomas.com/2011/04/18/css-scaffolding/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 00:12:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=533</guid>
		<description><![CDATA[Last week I gave a talk at MinneWebCon along with Ken Loomis and Ethan Poole. My section of the talk dealt with the CSS we use at work. One of the main problems I&#8217;ve come to have with using CSS frameworks is that they put presentation back into the markup. Every CSS framework I&#8217;ve seen [...]]]></description>
			<content:encoded><![CDATA[<p>Last week <a href="http://www.slideshare.net/kmloomis/minne-webcon-2011v5" onclick="pageTracker._trackPageview('/outgoing/www.slideshare.net/kmloomis/minne-webcon-2011v5?referer=');">I gave a talk</a> at <a href="http://minnewebcon.umn.edu" onclick="pageTracker._trackPageview('/outgoing/minnewebcon.umn.edu?referer=');">MinneWebCon</a> along with Ken Loomis and <a href="http://ethanpoole.com/" onclick="pageTracker._trackPageview('/outgoing/ethanpoole.com/?referer=');">Ethan Poole</a>. My section of the talk dealt with <a href="http://sua.umn.edu/_web/css-styleguide.php" onclick="pageTracker._trackPageview('/outgoing/sua.umn.edu/_web/css-styleguide.php?referer=');">the CSS we use at work</a>. One of the main problems I&#8217;ve come to have with using CSS frameworks is that they put presentation back into the markup. Every CSS framework I&#8217;ve seen has classes like these:</p>
<ul>
<li>ez-50 (ez-css)</li>
<li>container_12 (960GS)</li>
<li>grid_1 (960GS)</li>
<li>span-4 (Blueprint)</li>
</ul>
<p>After years of adopting standards that keep presentation separate from the markup, frameworks like these (<a href="http://www.testking.com/techking/roundups/27-great-css-frameworks-you-must-check-out/" onclick="pageTracker._trackPageview('/outgoing/www.testking.com/techking/roundups/27-great-css-frameworks-you-must-check-out/?referer=');">and others</a>) put it right back into the code. Not only is that a bad practice, but it removes one of the chief benefits of CSS: the ability to change your presentation without touching the markup.</p>
<p>The most common problem these frameworks solve is laying out columns. So I came up with a handful of CSS classes that solve the same problem, but do so in a way that will allow you to alter the appearance of the pages <em>without altering the markup</em>.</p>
<p>These classes are applicable in a general way (i.e., within the content), so it&#8217;s useful to keep them named as they are for that purpose. You can also copy these same styles to your ids to get the desired widths and column layout. I encourage you to write these styles into page ids whenever possible as that will make your page markup more semantic. You should think of these classes more like scaffolding than a framework. You can get started quickly, then modify them to meet your needs. <a href="http://anthonygthomas.com/wp-content/uploads/2011/04/framework.css.zip">The minified file is only 412 bytes</a>.<span id="more-533"></span></p>
<pre class="brush: css; title: ; notranslate">/* anthonygthomas.com/
   v1.0 | 20110417
   License: none (public domain)
*/

/******

 # Table of Contents #

## Define columns
### Last column
## Narrow column
### Last narrow column
## Wide column
## First column
## Column clearfix

 *******/

/* Define columns */
/* apply this to any block element */
.column {
    display: inline-block;
    float:left;
    margin-right: 2%;
    width: 48%;
}
    /* Last column */
    /* apply this to the last column */
    .column.last {
	margin-left: 2%;
	margin-right: 0;
	width: 48%;
    }

/* Narrow column */
.column.narrow {
    margin-right: 5%;
    width: 30%;
}
    /* Last narrow column */
    .column.narrow.last {
	margin-left: 0;
	margin-right: 0;
    }

/* Wide column */
.column.wide {
    margin-right: 4%;
    width: 66%;
}

/* First column */
.first {
    clear:left;
}

/* Column clearfix */
/* perishablepress.com/press/2009/12/06/new-clearfix-hack/ */
.column:after {
	visibility: hidden;
	display: block;
	font-size: 0;
	content: &quot; &quot;;
	clear: both;
	height: 0;
	}
* html .column             { zoom: 1; } /* IE6 */
*:first-child+html .column { zoom: 1; } /* IE7 */</pre>
<p><a href="http://anthonygthomas.com/examples/test.html">Here is a demo page</a>.</p>
<h3>The Classes</h3>
<h4>The column Class</h4>
<pre class="brush: css; title: ; notranslate">/* apply this to any block element */
.column {
    display: inline-block;
    float:left;
    margin-right: 2%;
    width: 48%;
}</pre>
<p>This creates a 50% column for any block element. By default columns float left, so the next consecutive element with the same class will end up on the right side of the preceding element. To get rid of the 2% margin in the right column and add a 2% gutter to the left of the second column (for a total of a 4% gutter) use the <code>.last</code> class:</p>
<pre class="brush: css; title: ; notranslate">/* apply this to the last column */
    .column.last {
	margin-left: 2%;
	margin-right: 0;
	width: 48%;
    }</pre>
<h4>The narrow Class (three columns)</h4>
<p>This creates a 30% width column with a 5% right margin. To make the third column work correctly, you need to add a <code>last</code> class.</p>
<pre class="brush: css; title: ; notranslate">/* Narrow column */
.column.narrow {
    margin-right: 5%;
    width: 30%;
}
    /* Last narrow column */
    .column.narrow.last {
	margin-left: 0;
	margin-right: 0;
    }</pre>
<h4>The wide Class</h4>
<pre class="brush: css; title: ; notranslate">/* Wide column */
.column.wide {
    margin-right: 4%;
    width: 66%;
}</pre>
<h4>The first Class</h4>
<pre class="brush: css; title: ; notranslate">/* First column */
.first {
    clear:left;
}</pre>
<p>Apply this to the first column to force the element to wrap below it&#8217;s preceding element.</p>
<h4>The clearfix</h4>
<p>This is a common &#8220;clearfix&#8221; method. You can find variations on this all over the web. <a href="http://perishablepress.com/press/2009/12/06/new-clearfix-hack/" onclick="pageTracker._trackPageview('/outgoing/perishablepress.com/press/2009/12/06/new-clearfix-hack/?referer=');">This one is from Perisable Press</a>. Rather than selectively apply the class, I wrote into a class that I knew needed clearing.</p>
<pre class="brush: css; title: ; notranslate">/* Column clearfix */
/* perishablepress.com/press/2009/12/06/new-clearfix-hack/ */
.column:after {
	visibility: hidden;
	display: block;
	font-size: 0;
	content: &quot; &quot;;
	clear: both;
	height: 0;
	}
* html .column             { zoom: 1; } /* IE6 */
*:first-child+html .column { zoom: 1; } /* IE7 */</pre>
<p>This is not a completely tested framework. I make no guarantees that it will work in all old browsers.</p>
<p>The thing I encourage you to take away is that CSS frameworks&#8211;if used as-is&#8211;are not semantic. It&#8217;s not hard to come up with your own, more semantic framework. Instead of thinking of these as grid systems, you should think of them as scaffolding. This is a good place to start. Take it from here and modify it to fit your own needs.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2011/04/18/css-scaffolding/" rel="bookmark" title="April 18, 2011">CSS Scaffolding</a></li>
<li><a href="http://anthonygthomas.com/2009/11/09/blueprint-taking-a-close-look-at-grid-css/" rel="bookmark" title="November 9, 2009">Blueprint: Taking a Close Look at grid.css</a></li>
<li><a href="http://anthonygthomas.com/2008/12/16/when-using-a-grid-layout-css-framework-do-the-math/" rel="bookmark" title="December 16, 2008">When Using a Grid Layout CSS Framework, Do the Math</a></li>
<li><a href="http://anthonygthomas.com/2008/11/22/blueprint-css-tutorial-file/" rel="bookmark" title="November 22, 2008">Blueprint CSS Tutorial File</a></li>
<li><a href="http://anthonygthomas.com/2011/05/17/new-theme/" rel="bookmark" title="May 17, 2011">New Theme</a></li>
</ul>
<p><!-- Similar Posts took 4.315 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2011/04/18/css-scaffolding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Document Structure</title>
		<link>http://anthonygthomas.com/2011/04/17/html5-document-structure/</link>
		<comments>http://anthonygthomas.com/2011/04/17/html5-document-structure/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 17:42:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=515</guid>
		<description><![CDATA[Since I&#8217;ve started working with HTML5  a bit, I&#8217;ve had to adjust my thinking about page structure. HTML 5 page structure differs from HTML 4 or XHTML significantly. (X)HTML document structure should look like this: This has changed in HTML5. HTML5 has &#8220;outlining elements&#8221; that essentially reset the page hierarchy. This is a little tough [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve started working with HTML5  a bit, I&#8217;ve had to adjust my thinking about page structure. HTML 5 page structure differs from HTML 4 or XHTML <em>significantly</em>. (X)HTML document structure should look like this:<span id="more-515"></span></p>
<div id="attachment_518" class="wp-caption aligncenter" style="width: 283px"><a href="http://cssglobe.com/post/1213/how-to-use-headings-in-html" onclick="pageTracker._trackPageview('/outgoing/cssglobe.com/post/1213/how-to-use-headings-in-html?referer=');"><img class="size-medium wp-image-518 " title="Proper Use of Headings in HTML 4 &amp; XHTML" src="http://anthonygthomas.com/wp-content/uploads/2011/04/headings-273x300.gif" alt="html headings diagram" width="273" height="300" /></a><p class="wp-caption-text">Proper document structure in HTML 4 and XHTML. (http://cssglobe.com/post/1213/how-to-use-headings-in-html)</p></div>
<p>This has changed in HTML5. <a href="http://dev.opera.com/articles/view/new-structural-elements-in-html5/" onclick="pageTracker._trackPageview('/outgoing/dev.opera.com/articles/view/new-structural-elements-in-html5/?referer=');">HTML5 has &#8220;outlining elements&#8221; that essentially reset the page hierarchy</a>. This is a little tough to get your head around if you&#8217;ve spent as many years as I have using the page structure in the figure above. A diagram of an HTML5 document might look like this:</p>
<div id="attachment_521" class="wp-caption aligncenter" style="width: 283px"><img class="size-full wp-image-521" title="HTML5 Document Structure" src="http://anthonygthomas.com/wp-content/uploads/2011/04/html5.png" alt="HTML5 Document Structure" width="273" height="300" /><p class="wp-caption-text">A demonstration of HTML5 &quot;sectioning&quot; elements.</p></div>
<p>Notice the difference? It&#8217;s fairly subtle, but most recognizable in the <code>section</code> element. In (X)HTML, the headings in the article section would be subject to the same hierarchy as the rest of the document so article headings would have to start with <code>h3</code> or maybe even <code>h4</code>. In HTML5, <code>nav</code>, <code>section</code>, <code>article</code> and <code>aside</code> are &#8220;sectioning&#8221; elements, so they can have their own hierarchy of headings. Notice that the <code>header</code> HTML5 tag is not a sectioning element, so it&#8217;s <code>h1</code> still rules the page.</p>
<p><strong>Note:</strong> No browsers support this outlining algorithm. (I know.) It&#8217;s coming, so I think it&#8217;s important to get our heads around it now.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2011/04/17/html5-document-structure/" rel="bookmark" title="April 17, 2011">HTML5 Document Structure</a></li>
<li><a href="http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/" rel="bookmark" title="September 5, 2010">Baseline Theme Version 1.1</a></li>
<li><a href="http://anthonygthomas.com/2010/02/14/why-use-blueprint-and-the-960-grid-system-in-the-baseline-theme/" rel="bookmark" title="February 14, 2010">Why Use Blueprint and the 960 Grid System in the Baseline Theme?</a></li>
<li><a href="http://anthonygthomas.com/2008/11/22/blueprint-css-tutorial-file/" rel="bookmark" title="November 22, 2008">Blueprint CSS Tutorial File</a></li>
<li><a href="http://anthonygthomas.com/2011/04/18/css-scaffolding/" rel="bookmark" title="April 18, 2011">CSS Scaffolding</a></li>
</ul>
<p><!-- Similar Posts took 4.179 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2011/04/17/html5-document-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple RSS Parsing and Caching Using PHP</title>
		<link>http://anthonygthomas.com/2011/03/12/simple-rss-parsing-and-caching-using-php/</link>
		<comments>http://anthonygthomas.com/2011/03/12/simple-rss-parsing-and-caching-using-php/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 02:23:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=481</guid>
		<description><![CDATA[I feel like I should begin by stating that my college degree is in English Literature. In other words, I am not formally trained to be a programmer. Still I&#8217;ve spent many years working in PHP. It can be liberating to find out that something you thought would be complicated, is actually not that hard [...]]]></description>
			<content:encoded><![CDATA[<p>I feel like I should begin by stating that my college degree is in English Literature. In other words, I am not formally trained to be a programmer. Still I&#8217;ve spent many years working in PHP. It can be liberating to find out that something you thought would be complicated, is actually not that hard when broken down into discrete steps.</p>
<p>This whole adventure started for me when I went looking for a way to parse an <acronym title="Really Simple Syndication">RSS</acronym> feed. Contrary to those who proclaim that <a href="http://www.google.com/search?sourceid=chrome&#038;ie=UTF-8&#038;q=rss+is+dead" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?sourceid=chrome_038_ie=UTF-8_038_q=rss+is+dead&amp;referer=');">RSS is dead</a>, at it&#8217;s heart, RSS is <acronym title="eXtenxible Markup Language">XML</acronym>. As such it&#8217;s a useful method to access content. In my case, I wanted to parse my blog RSS feed as well as my most recent <a href="http://twitter.com/truetone" onclick="pageTracker._trackPageview('/outgoing/twitter.com/truetone?referer=');">Tweets</a>. That was revelation number one.</p>
<blockquote><p>RSS is XML > XML has a structure that can be put into objects in PHP</p></blockquote>
<p>To many of my friends and colleagues, this may seem incredibly simple. To me it was a revelation that opened up a new door. I&#8217;ve never tried to create an RSS parser before. Suddenly it was less daunting. (Aside: For me, simple truths often come as revelations. To know me is to know this.)<br />
<span id="more-481"></span></p>
<h3>Parsing the RSS Feed</h3>
<p>It turns out that PHP 5 has some really handy tools for dealing with HTML and XML in the <a href="http://php.net/manual/en/class.domdocument.php" onclick="pageTracker._trackPageview('/outgoing/php.net/manual/en/class.domdocument.php?referer=');">DOMDocument</a> class.</p>
<p>First, we create an array to store the XML. Next instantiate <code>DOMDocument</code> and call the <code>load</code> function:</p>
<pre class="brush: php; title: ; notranslate">$doc = new DOMDocument();
$doc-&gt;load($url);</pre>
<p>Then it&#8217;s as simple as looping through the XML nodes and storing what you want in the <code>$xml</code> array. For this use <code>getElementsByTagName</code>:</p>
<pre class="brush: php; title: ; notranslate">foreach ($doc-&gt;getElementsByTagName('item') as $node)
{
    //do stuff
}</pre>
<p>In my case I knew the most I wanted was a simple list with title, description, link and date. Thus:</p>
<pre class="brush: php; title: ; notranslate">foreach ($doc-&gt;getElementsByTagName('item') as $node)
{
    $rss = array (
        'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue,
        'description' =&gt; $node-&gt;getElementsByTagName('description')-&gt;item(0)-&gt;nodeValue,
        'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue,
        'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue
        );
    }
}</pre>
<p>Now each loop loads the information I want into an array called <code>$rss</code>. Next just push that into the <code>$xml</code> array:</p>
<pre class="brush: php; title: ; notranslate">foreach ($doc-&gt;getElementsByTagName('item') as $node)
{
    $rss = array (
        'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue,
        'description' =&gt; $node-&gt;getElementsByTagName('description')-&gt;item(0)-&gt;nodeValue,
        'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue,
        'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue
        );
      array_push($xml, $rss);
    }
}</pre>
<p>Finally I serialized the data to store it in a cache file. So we end up with:</p>
<pre class="brush: php; title: ; notranslate">protected function getFeed($url)
{
    $xml = array();
    $doc = new DOMDocument();
    $doc-&gt;load($url);
    foreach ($doc-&gt;getElementsByTagName('item') as $node)
    {
      $rss = array (
        'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue,
        'description' =&gt; $node-&gt;getElementsByTagName('description')-&gt;item(0)-&gt;nodeValue,
        'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue,
        'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue
        );
      array_push($xml, $rss);
    } //endforeach element ids
    return serialize($xml);
  }
}</pre>
<p>So now we can deal with the RSS information. Next we just have to create a way to cache it so the feed isn&#8217;t unnecessarily pulled in over and over. This is when another liberating revelation came my way. I began to look for methods of caching and I saw the following advice on a forum:</p>
<blockquote><p>Get the feed. Write it to a text file. For each new request, check the mod time of the text file. It enough time has passed, update the file.</p></blockquote>
<p>There are probably more complex caching algorithms than this, but it seemed like a good place to start. So I wrote a caching function. It takes an array with two parameters. The name of the service as the array key and the url of the RSS feed. First we check to see if a cache file exists, and if it does, we check to see whether or not it has expired. I chose an arbitrary span of 60 seconds for my cache file:</p>
<pre class="brush: php; title: ; notranslate">public function checkCache($data=array())
{
    foreach ($data as $service =&gt; $feed)
    {
      $path = '/tmp/' . $service . '.cache';
      if ((!file_exists($path) || time() - filemtime($path) &gt; 60) &amp;&amp; $cache = fopen($path, 'w+'))
      {
           // do stuff
      }
    }
}</pre>
<p>So if there is no file, or the requisite time has expired and the file can be opened we call the aforementioned <code>getFeed</code> function to get the feed data, write it to the file and send it to the webpage:</p>
<pre class="brush: php; title: ; notranslate">$rss_contents = $this-&gt;getFeed($feed);
fwrite($cache, $rss_contents);
fclose($cache);
return unserialize($rss_contents);</pre>
<p>If the cache doesn&#8217;t need to be updated, we simply read it and send the data that way:</p>
<pre class="brush: php; title: ; notranslate">$cache = fopen($path, 'r');
return unserialize(file_get_contents($path)); // remember to unserialize since we serialized it initially
fclose($cache);</pre>
<p>The whole function looks like this:</p>
<pre class="brush: php; title: ; notranslate">public function checkCache($data=array())
{
  foreach ($data as $service =&gt; $feed)
  {
    $path = '/tmp/' . $service . '.cache';
    if ((!file_exists($path) || time() - filemtime($path) &gt; 60) &amp;&amp; $cache = fopen($path, 'w+'))
    {
      $rss_contents = $this-&gt;getFeed($feed);
      fwrite($cache, $rss_contents);
      fclose($cache);
      return unserialize($rss_contents);
    }
    else
    {
      $cache = fopen($path, 'r');
      return unserialize(file_get_contents($path));
      fclose($cache);
    }
  }
}</pre>
<p>The entire class together looks like this:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
class RssParser
{
  public function checkCache($data=array())
  {
    foreach ($data as $service =&gt; $feed)
    {
      $path = '/tmp/' . $service . '.cache';
      if ((!file_exists($path) || time() - filemtime($path) &gt; 60) &amp;&amp; $cache = fopen($path, 'w+'))
      {
        $rss_contents = $this-&gt;getFeed($feed);
        fwrite($cache, $rss_contents);
        fclose($cache);
        return unserialize($rss_contents);
      }
      else
      {
        $cache = fopen($path, 'r');
        return unserialize(file_get_contents($path));
        fclose($cache);
      }
    }
  }

  protected function getFeed($url)
  {
    $xml = array();
    $doc = new DOMDocument();
    $doc-&gt;load($url);
    foreach ($doc-&gt;getElementsByTagName('item') as $node)
    {
      $rss = array (
        'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue,
        'description' =&gt; $node-&gt;getElementsByTagName('description')-&gt;item(0)-&gt;nodeValue,
        'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue,
        'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue
        );
      array_push($xml, $rss);
    } //endforeach element ids
    return serialize($xml);
  }
}</pre>
<p>Finally, we instantiate it in the page where we&#8217;re going to use it and loop through it:</p>
<pre class="brush: php; title: ; notranslate">&lt;?

include_once('/path/to/rss_parser.class.php'); // include the php file with the class

$parser = new RssParser(); // instantiate the class
$blog_feed = $parser-&gt;checkCache(array('blog' =&gt; 'http://yourdomain.com/feed/')); // load the RSS
?&gt;
&lt;ul&gt;
&lt;?
foreach ($blog_feed as $key =&gt; $items)
{
    if ($key &lt; 5): ?&gt;
	&lt;li&gt;&lt;a href=&quot;&lt;?= $items['link'] ?&gt;&quot;&gt;&lt;?= $items['title'] ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;?php
    endif;
} //endforeach
?&gt;
&lt;/ul&gt;</pre>
<p>Done!</p>
<h3>Caveats</h3>
<p>Depending on your server configuration, you may need to put the class in your public directory. If you need to do that, make sure you put it in a directory with &#8217;750&#8242; permissions.</p>
<p>Also, your PHP configuration may not allow you to open urls with <code>fopen</code>. In that case, I suggest you use the <a href="http://us2.php.net/manual/en/book.curl.php" onclick="pageTracker._trackPageview('/outgoing/us2.php.net/manual/en/book.curl.php?referer=');">cURL library</a>.</p>
<p>This is a very simple RSS parsing and caching engine, but it works and it&#8217;s a good start to working with PHP and XML.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2011/03/12/simple-rss-parsing-and-caching-using-php/" rel="bookmark" title="March 12, 2011">Simple RSS Parsing and Caching Using PHP</a></li>
<li><a href="http://anthonygthomas.com/2009/03/22/cakephp-console-acl-help-file/" rel="bookmark" title="March 22, 2009">CakePHP Console ACL Help File</a></li>
<li><a href="http://anthonygthomas.com/2008/11/26/getting-blueprint-css-javascript-libraries-into-your-cakephp-layout/" rel="bookmark" title="November 26, 2008">Getting Blueprint CSS &#038; JavaScript Libraries Into Your CakePHP Layout</a></li>
<li><a href="http://anthonygthomas.com/2010/05/24/an-unexpected-problem-with-cakephp-and-email-elements/" rel="bookmark" title="May 24, 2010">An Unexpected Problem with CakePHP and Email Elements</a></li>
<li><a href="http://anthonygthomas.com/2010/03/20/no-flash-required/" rel="bookmark" title="March 20, 2010">No Flash Required</a></li>
</ul>
<p><!-- Similar Posts took 4.550 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2011/03/12/simple-rss-parsing-and-caching-using-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>When to Use CSS content Property</title>
		<link>http://anthonygthomas.com/2011/03/05/when-to-use-the-css-content-property/</link>
		<comments>http://anthonygthomas.com/2011/03/05/when-to-use-the-css-content-property/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 21:06:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=464</guid>
		<description><![CDATA[CSS offers a tempting attribute in the content property. The syntax is as follows: The code above will append &#8220;Add this.&#8221; to the element, id or class of our CSS declaration. The problem with this is that we&#8217;re putting content into our presentation code. Also, this content is not accessible by screen readers or search [...]]]></description>
			<content:encoded><![CDATA[<p>CSS offers a tempting attribute in the <code>content</code> property. The syntax is as follows:</p>
<pre class="brush: css; title: ; notranslate">content: 'Add this.';</pre>
<p>The code above will append &#8220;Add this.&#8221; to the element, id or class of our CSS declaration. The problem with this is that we&#8217;re putting content into our presentation code. Also, this content is not accessible by screen readers or search engine crawlers. A good rule of thumb is to use this property as a means of <a href="http://www.alistapart.com/articles/understandingprogressiveenhancement/" onclick="pageTracker._trackPageview('/outgoing/www.alistapart.com/articles/understandingprogressiveenhancement/?referer=');">progressive enhancement</a>. Generally speaking, I like to use it for presentation that enhances the site, but contributes nothing semantically.</p>
<p>Here&#8217;s an example:</p>
<p>Let&#8217;s say we want to use this icon to denote links that are external to our site:<br />
<img class="alignleft size-full wp-image-469" title="External Link Icon" src="http://anthonygthomas.com/wp-content/uploads/2011/03/external.png" alt="external link icon" width="10" height="10" /></p>
<p>Use the <code>content</code> property:</p>
<pre class="brush: css; title: ; notranslate">a.external:after {
    content: url(path/to/external.png);
}</pre>
<p>The image itself provides no semantic value to the document. It&#8217;s merely an enhancement and would be ignored by screen readers anyway. We can safely use <code>content</code> in this case. Another good use is <a href="http://www.yuiblog.com/blog/2010/11/22/css-quick-tip-css-arrows-and-shapes-without-markup/" onclick="pageTracker._trackPageview('/outgoing/www.yuiblog.com/blog/2010/11/22/css-quick-tip-css-arrows-and-shapes-without-markup/?referer=');">this tutorial for creating CSS-only arrows</a>.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2011/03/05/when-to-use-the-css-content-property/" rel="bookmark" title="March 5, 2011">When to Use CSS content Property</a></li>
<li><a href="http://anthonygthomas.com/2009/10/14/huffpost-applies-ab-testing-to-headlines-via-bigboxcar-via-mjkeliher/" rel="bookmark" title="October 14, 2009">HuffPost Applies AB Testing to Headlines via (@bigboxcar via 	@mjkeliher)</a></li>
<li><a href="http://anthonygthomas.com/2008/11/22/blueprint-css-readme-file/" rel="bookmark" title="November 22, 2008">Blueprint CSS Readme File</a></li>
<li><a href="http://anthonygthomas.com/2008/04/01/anger-content-management/" rel="bookmark" title="April 1, 2008">Anger Content Management</a></li>
<li><a href="http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/" rel="bookmark" title="September 5, 2010">Baseline Theme Version 1.1</a></li>
</ul>
<p><!-- Similar Posts took 4.388 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2011/03/05/when-to-use-the-css-content-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Baseline Theme Version 1.1</title>
		<link>http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/</link>
		<comments>http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 02:01:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Baseline Theme]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[baseline theme]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=449</guid>
		<description><![CDATA[It had been a while since I&#8217;d done any WordPress development, but I recently dusted off my Baseline theme to start a new project only to find that the jQuery libraries weren&#8217;t loading properly. A quick bit of research revealed that new versions of WordPress require a slightly different syntax when using jQuery, so I [...]]]></description>
			<content:encoded><![CDATA[<p>It had been a while since I&#8217;d done any WordPress development, but I recently dusted off my Baseline theme to start a new project only to find that the jQuery libraries weren&#8217;t loading properly. A quick bit of research revealed that new versions of WordPress require a slightly different syntax when using jQuery, so I made a few changes.</p>
<ol>
<li>jQuery UI is now loaded using <code>wp_enqueue_script("jquery-ui");</code> instead of linking to Google&#8217;s hosted copy.</li>
<li>The code for loading Superfish uses this syntax:
<pre class="brush: jscript; title: ; notranslate">jQuery(document).ready(function() {
        jQuery('ul.sf-menu').superfish();
    });</pre>
</li>
<li>Lists will now obey margins of neighboring floating elements by default because I declared this in style.css:
<pre class="brush: css; title: ; notranslate">div#content ul, div#content ol {
	list-style-position: inside;
}</pre>
</li>
</ol>
<p>Later versions of WordPress don&#8217;t support the &#8216;$&#8217; syntax normally used with jQuery. Wherever you would normally use &#8216;$&#8217; (such as <code>$(document).ready ();</code>), you have to use &#8216;jQuery&#8217; instead (<code>jQuery.document.ready();</code>). There were a couple of other housekeeping items like reformatting style.css and creating a table of contents for it. Baseline should be all set to work with the latest versions of WordPress again. <a href="http://baseline.truetoneenterprises.com" onclick="pageTracker._trackPageview('/outgoing/baseline.truetoneenterprises.com?referer=');">Download it here</a>.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/" rel="bookmark" title="September 5, 2010">Baseline Theme Version 1.1</a></li>
<li><a href="http://anthonygthomas.com/2010/02/08/introducing-the-baseline-development-wordpress-theme/" rel="bookmark" title="February 8, 2010">Introducing the Baseline Development WordPress Theme</a></li>
<li><a href="http://anthonygthomas.com/2010/03/22/baseline-wordpress-theme-version-1-0-2/" rel="bookmark" title="March 22, 2010">Baseline WordPress Theme Version 1.0.2</a></li>
<li><a href="http://anthonygthomas.com/2010/02/14/why-use-blueprint-and-the-960-grid-system-in-the-baseline-theme/" rel="bookmark" title="February 14, 2010">Why Use Blueprint and the 960 Grid System in the Baseline Theme?</a></li>
<li><a href="http://anthonygthomas.com/2008/11/23/incorporating-blueprint-css-into-your-new-wordpress-theme/" rel="bookmark" title="November 23, 2008">Incorporating Blueprint CSS Into Your New WordPress Theme</a></li>
</ul>
<p><!-- Similar Posts took 4.560 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Unexpected Problem with CakePHP and Email Elements</title>
		<link>http://anthonygthomas.com/2010/05/24/an-unexpected-problem-with-cakephp-and-email-elements/</link>
		<comments>http://anthonygthomas.com/2010/05/24/an-unexpected-problem-with-cakephp-and-email-elements/#comments</comments>
		<pubDate>Mon, 24 May 2010 21:27:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[email elements]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=434</guid>
		<description><![CDATA[For several months now I&#8217;ve been triggering functions in my CakePHP controllers using crontabs. It&#8217;s especially handy for summarizing data and sending out reports via email. I&#8217;m about to change jobs and I&#8217;m trying to set up as many systems as I can to help staff manage our data after I leave. Part of that [...]]]></description>
			<content:encoded><![CDATA[<p>For several months now I&#8217;ve been triggering functions in my <a title="CakePHP" href="http://cakephp.org" target="_blank" onclick="pageTracker._trackPageview('/outgoing/cakephp.org?referer=');">CakePHP</a> controllers <a href="http://www.lost-in-code.com/programming/php-code/cakephp-crontab/" onclick="pageTracker._trackPageview('/outgoing/www.lost-in-code.com/programming/php-code/cakephp-crontab/?referer=');">using crontabs</a>. It&#8217;s especially handy for summarizing data and sending out reports via email. I&#8217;m about to change jobs and I&#8217;m trying to set up as many systems as I can to help staff manage our data after I leave. Part of that means writing a few more crons to send out more emails. Today while trying to do just that, I ran into something unexpected that held me up for an hour or so until I had an epiphany on my way home. For the purposes of this post, I&#8217;m assuming you&#8217;ve already set up a cron dispatcher and know how to trigger cron jobs.</p>
<p>For one more week I&#8217;m working in a research clinic. One of the things we need to keep track of is who is late in getting us a sample. We need to check for blood and throat samples (which come from swishing some saline around in the mouth). This can be done by hand, but soon the study will grow and the number of participants will make that hard to manage. So I just want to check to see who is late and send out an email to staff to let them know.</p>
<p>This function exists in my Patient controller:<span id="more-434"></span></p>
<pre class="brush: php; highlight: [50,51,52,53]; title: ; notranslate">
function cron_delinquency() {

	if (!defined('CRON_DISPATCHER')) // make sure the request comes through the cron dispatcher
	{
		$this-&gt;redirect('/'); exit('Invalid Request');
	}
	/* this looks up active patients who do not have an patient_id ending in &quot;D&quot;. &quot;D&quot; indicates they are a donor and we only need one specimen from them. */
	$active = $this-&gt;Patient-&gt;find('list', array(
		'conditions' =&gt; array(
			'Patient.id LIKE \'T%\' AND Patient.id NOT LIKE \'%D\'',
			'Patient.withdrawn != \'y\'',
			'Patient.active=&quot;1&quot;'),
		));
	$in = '\''; /* the patient_id's start with a &quot;T&quot; meaning all the patient_id's need to be enclosed in quotes */

	$in .= implode('\', \'', $active); // implode the list of patient_id's

	$in = $in . '\''; // end it all with a quote

	$blds = $this-&gt;Patient-&gt;Specimen-&gt;find('list', array( // find the blood specimens for this group of patients
		'conditions' =&gt; array(
			'Specimen.patient_id IN (' . $in .')',
			'Specimen.type' =&gt; array('BLD')
			),
		'fields' =&gt; array('patient_id', 'draw_date'),
		'order' =&gt; array('patient_id' =&gt; 'ASC', 'draw_date' =&gt; 'ASC')

		));

	$thrs = $this-&gt;Patient-&gt;Specimen-&gt;find('list', array( // find the throat samples for this group of patients
		'conditions' =&gt; array(
			'Specimen.patient_id IN (' . $in .')',
			'Specimen.type' =&gt; array('THR')
			),
		'fields' =&gt; array('patient_id', 'draw_date'),
		'order' =&gt; array('patient_id' =&gt; 'ASC', 'draw_date' =&gt; 'ASC')

		));

/* My Patient model has a function to filter arrays and return only those that are older than the proved Unix timestamp. */
	$delinquentBlood = $this-&gt;Patient-&gt;find_delinquent($blds, 2419200); // 2419200 = 4 weeks; 3628800 = 6 weeks
	$delinquentThroat = $this-&gt;Patient-&gt;find_delinquent($thrs, 3628800);

	if(count($delinquentBlood) &gt; 0 || count($delinquentThroat) &gt; 0) // if we find any who are delinquent
	{

		asort($delinquentBlood); // sort them
		asort($delinquentThroat);

		$data['delinquentBlood'] = $delinquentBlood;
		$data['delinquentThroat'] = $delinquentThroat;
		$data['bloodCounter'] = count($delinquentBlood);
		$data['throatCounter'] = count($delinquentThroat);

		$this-&gt;set('data', $data);

		$this-&gt;Email-&gt;to 	  = $to;
		$this-&gt;Email-&gt;from		= 'LCIS &lt;xxxxxxx@umn.edu&gt;';
		$this-&gt;Email-&gt;subject	= 'PPG Delinquency Report: ' . $bloodCounter .&quot; Subjects With Blood Specimens Due; &quot; . $throatCounter . &quot; With Throat Specimens Due.&quot;;
		$this-&gt;Email-&gt;sendAs	= 'html';
		$this-&gt;Email-&gt;template	= 'viptm_delinquency';
		$this-&gt;Email-&gt;send();
	}
}
</pre>
<p>It&#8217;s that highlighted bit that was really giving me trouble. Previously I had been setting those variables like so:</p>
<pre class="brush: php; title: ; notranslate">$this-&gt;set(compact('delinquentBlood', 'delinquentThroat', 'bloodCounter', 'throatCounter'));</pre>
<p>Ordinarily this would work with any other view, but the email element I have set up for this function was acting as if they variables weren&#8217;t set at all. <em>It wasn&#8217;t until I put them in an array called <code>$data</code>, that I could use them in my email element</em>. It was puzzling and it took me about an hour to figure that out, but once I did my email reports came with beautiful data.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2010/05/24/an-unexpected-problem-with-cakephp-and-email-elements/" rel="bookmark" title="May 24, 2010">An Unexpected Problem with CakePHP and Email Elements</a></li>
<li><a href="http://anthonygthomas.com/2010/02/18/cakephp-containable-behavior-is-your-friend/" rel="bookmark" title="February 18, 2010">CakePHP: Containable Behavior is Your Friend</a></li>
<li><a href="http://anthonygthomas.com/2011/03/12/simple-rss-parsing-and-caching-using-php/" rel="bookmark" title="March 12, 2011">Simple RSS Parsing and Caching Using PHP</a></li>
<li><a href="http://anthonygthomas.com/2009/05/22/roll-your-own-cakephp-components/" rel="bookmark" title="May 22, 2009">Roll Your Own CakePHP Components</a></li>
<li><a href="http://anthonygthomas.com/2008/12/10/use-functions-from-other-controllers-while-maintaining-mvc-architecture-in-cakephp/" rel="bookmark" title="December 10, 2008">Use Functions from Other Controllers While Maintaining MVC Architecture in CakePHP</a></li>
</ul>
<p><!-- Similar Posts took 4.342 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2010/05/24/an-unexpected-problem-with-cakephp-and-email-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Baseline WordPress Theme Version 1.0.2</title>
		<link>http://anthonygthomas.com/2010/03/22/baseline-wordpress-theme-version-1-0-2/</link>
		<comments>http://anthonygthomas.com/2010/03/22/baseline-wordpress-theme-version-1-0-2/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 17:34:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Baseline Theme]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[baseline theme]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=430</guid>
		<description><![CDATA[I&#8217;ve uploaded a new version of the Baseline theme for WordPress development. The only change this time around is that I&#8217;m using wp_enqueue_script() to include WordPress&#8217; existing copy of JQuery. (Hat tip to Chris Coyier.) This seems like a significant enough change to merit a small version bump. I used the Baseline theme as a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded a new version of the <a href="http://baseline.truetoneenterprises.com/" onclick="pageTracker._trackPageview('/outgoing/baseline.truetoneenterprises.com/?referer=');">Baseline theme for WordPress development</a>. The only change this time around is that I&#8217;m using <code><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Function_Reference/wp_enqueue_script?referer=');">wp_enqueue_script()</a></code> to include WordPress&#8217; existing copy of JQuery. (<a href="http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/" onclick="pageTracker._trackPageview('/outgoing/digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/?referer=');">Hat tip to Chris Coyier</a>.) This seems like a significant enough change to merit a small version bump.</p>
<p>I used the Baseline theme as a launching pad for this website. At least for me, it serves as a good starting point when you begin developing a brand new theme.</p>
<p>If you find this useful, you might be interested in checking out <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" onclick="pageTracker._trackPageview('/outgoing/digwp.com/2010/03/wordpress-functions-php-template-custom-functions/?referer=');">Jeff Star’s functions.php template</a>.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2010/03/22/baseline-wordpress-theme-version-1-0-2/" rel="bookmark" title="March 22, 2010">Baseline WordPress Theme Version 1.0.2</a></li>
<li><a href="http://anthonygthomas.com/2010/02/16/baseline-theme-version-1-0-1/" rel="bookmark" title="February 16, 2010">Baseline Theme Version 1.0.1</a></li>
<li><a href="http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/" rel="bookmark" title="September 5, 2010">Baseline Theme Version 1.1</a></li>
<li><a href="http://anthonygthomas.com/2010/02/08/introducing-the-baseline-development-wordpress-theme/" rel="bookmark" title="February 8, 2010">Introducing the Baseline Development WordPress Theme</a></li>
<li><a href="http://anthonygthomas.com/2008/04/14/access-to-free-music-and-emotional-connections/" rel="bookmark" title="April 14, 2008">Access to Free Music and Emotional Connections</a></li>
</ul>
<p><!-- Similar Posts took 4.004 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2010/03/22/baseline-wordpress-theme-version-1-0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No Flash Required</title>
		<link>http://anthonygthomas.com/2010/03/20/no-flash-required/</link>
		<comments>http://anthonygthomas.com/2010/03/20/no-flash-required/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 17:30:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web develop]]></category>

		<guid isPermaLink="false">http://anthonygthomas.com/?p=421</guid>
		<description><![CDATA[UPDATE II I just updated the theme of this site so: It uses even less JavaScript (all animations and transformations are done w/ CSS3 tranforms) It&#8217;s HTML5 More on both those points in a post soon. The upshot is that this post refers to a past theme and may be confusing. I just added a [...]]]></description>
			<content:encoded><![CDATA[<h3>UPDATE II</h3>
<p>I just updated the theme of this site so:</p>
<ol>
<li>It uses even less JavaScript (all animations and transformations are done w/ CSS3 tranforms)</li>
<li>It&#8217;s HTML5</li>
</ol>
<p>More on both those points in a post soon. The upshot is that this post refers to a past theme and may be confusing.</p>
<p><img class="alignleft size-full wp-image-422" title="Navigation" src="http://anthonygthomas.com/wp-content/uploads/2010/03/nav.jpg" alt="JPEF of the nav menu from anthonygthomas.com" width="284" height="95" />I just added a pretty sweet bit of eye candy to my nav menu using strictly CSS &amp; JQuery. <a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-lava-lamp-style-navigation-menu/" onclick="pageTracker._trackPageview('/outgoing/net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-lava-lamp-style-navigation-menu/?referer=');">The method is here</a>. <a href="http://github.com/JeffreyWay/SpasticNav" onclick="pageTracker._trackPageview('/outgoing/github.com/JeffreyWay/SpasticNav?referer=');">The code is here</a>.</p>
<p>You do need to have a either a webKit or Mozilla browser for it to work properly. The point is that there are fewer and fewer things that Flash can do that can&#8217;t be done with HTML, JavaScript and CSS. In fact, just about every single bit of animation I&#8217;ve had done in Flash over the last couple of years could be recreated with JQuery &amp; CSS3.</p>
<h3>UPDATE</h3>
<p>Since I couldn&#8217;t get the z-index to function properly in Internet Explorer, I used <a href="http://api.jquery.com/jQuery.browser/" onclick="pageTracker._trackPageview('/outgoing/api.jquery.com/jQuery.browser/?referer=');">JQuery&#8217;s .browser property</a> so the function only runs in supported browsers&#8211;namely, Mozilla or WebKit. The function actually degraded fairly well, except for Internet Explorer&#8217;s buggy handling of z-index. For reference, I&#8217;ve included my version of the plug-in because it has this and other subtle variations.<span id="more-421"></span></p>
<pre class="brush: jscript; title: ; notranslate">(function($) {
	if ($.browser.webkit || $.browser.mozilla) {

		$.fn.spasticNav = function(options) {

			options = $.extend({
				overlap : 2,
				speed : 500,
				reset : 1500,
				color : '#BDD2FF',
				easing : 'easeOutExpo'
			}, options);

			return this.each(function() {

			 	var nav = $(this),
			 		currentPageItem = $('.current_page_item', nav),
			 		blob,
			 		reset;

			 	$('&lt;li id=&quot;blob&quot;&gt;&lt;/li&gt;').css({
			 		width : currentPageItem.outerWidth(),
			 		height : currentPageItem.outerHeight() + options.overlap,
			 		left : currentPageItem.position().left,
			 		top : currentPageItem.position().top - options.overlap / 2,
			 		backgroundColor : options.color
			 	}).appendTo(this);

				$('.current_page_item a').css('z-index', 1000);

			 	blob = $('#blob', nav);

				$('li:not(#blob)', nav).hover(function() {
					// mouse over
					clearTimeout(reset);
					blob.animate(
						{
							left : $(this).position().left,
							width : $(this).width()
						},
						{
							duration : options.speed,
							easing : options.easing,
							queue : false
						}
					);
				}, function() {
					// mouse out
					reset = setTimeout(function() {
						blob.animate({
							width : currentPageItem.outerWidth(),
							left : currentPageItem.position().left
						}, options.speed)
					}, options.reset);

				});

			}); // end each

		};

	}

})(jQuery);</pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://anthonygthomas.com/2010/03/20/no-flash-required/" rel="bookmark" title="March 20, 2010">No Flash Required</a></li>
<li><a href="http://anthonygthomas.com/2011/05/17/new-theme/" rel="bookmark" title="May 17, 2011">New Theme</a></li>
<li><a href="http://anthonygthomas.com/2010/09/05/baseline-theme-version-1-1/" rel="bookmark" title="September 5, 2010">Baseline Theme Version 1.1</a></li>
<li><a href="http://anthonygthomas.com/2009/11/09/blueprint-taking-a-close-look-at-grid-css/" rel="bookmark" title="November 9, 2009">Blueprint: Taking a Close Look at grid.css</a></li>
<li><a href="http://anthonygthomas.com/2010/03/14/display-form-fields-based-on-selection-using-jquery/" rel="bookmark" title="March 14, 2010">Display Form Fields Based on Selection Using JQuery</a></li>
</ul>
<p><!-- Similar Posts took 4.284 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonygthomas.com/2010/03/20/no-flash-required/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

