<?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>Jes.Gs v2.0 &#187; web dev</title>
	<atom:link href="http://www.jes.gs/tag/web-dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jes.gs</link>
	<description>The Portfolio and Blog of Minneapolis Web Designer Jessica C. Green</description>
	<lastBuildDate>Sat, 21 Jan 2012 19:56:25 +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>PHP and XML: A Quick Introduction</title>
		<link>http://www.jes.gs/htmlcss/php-and-xml-a-quick-introduction/</link>
		<comments>http://www.jes.gs/htmlcss/php-and-xml-a-quick-introduction/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 18:00:45 +0000</pubDate>
		<dc:creator>Jess G.</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://dumpster-fairy.com/?p=236</guid>
		<description><![CDATA[A quick and dirty intro to using PHP to manipulate XML.]]></description>
			<content:encoded><![CDATA[<p>A quick and dirty intro to using PHP to manipulate XML. Very useful to know since there are probably situations where MySQL might be unavailable or just impractical and XML can make a great replacement, especially in small/light-weight applications.<br />
<span id="more-236"></span><br />
The first place we start is by looking at PHP&#8217;s <a href="http://us3.php.net/manual/en/book.dom.php">DOM extension</a>; read through the Introduction and Installation/Configuration sections before continuing.<br />
Now we&#8217;ll access the <a href="http://us3.php.net/manual/en/class.domdocument.php">DOMDocument</a> class. Starting out, this will probably be the class that gets used the most but as things progress, you&#8217;ll find yourself making use of the other classes available.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$xmldoc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// create a new DOMDocument object.</span></pre></div></div>

<p>Yep, it&#8217;s that simple. Now here comes the fun part. This scenario is going to assume that we&#8217;re just creating a new XML object.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">formatOutput</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Nicely formats output with indentation and extra space.</span>
&nbsp;
<span style="color: #000088;">$root</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'xml'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//create a root element for your XML output</span>
<span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$root</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Now, we're going to create a few child elements to go with it</span>
<span style="color: #000088;">$child1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'child_one'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Child One'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$root</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$child1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$child2</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'child_two'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Child Two'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$root</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$child2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">saveXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//output to screen...</span></pre></div></div>

<p>Pretty simple and straightforward. Now, if we want to save to a file, we do this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my-xml-file.xml'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If we want to open and write to a file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$xmldoc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// create a new DOMDocument object.</span>
<span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my-xml-file.xml'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">formatOutput</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$root</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">documentElement</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Conviently allows direct access to the root element.</span>
&nbsp;
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'another_one'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'another child'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$root</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$xmldoc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my-xml-file.xml'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Very quick and straightforward. I hope this helps anyone who was wondering how to use XML and PHP together.</p>
<p>For more information see:</p>
<ul>
<li><a href="http://us3.php.net/manual/en/refs.xml.php">PHP Manual: XML Manipulation</a></li>
<li><a href="http://www.kirupa.com/web/index.htm (scroll down for PHP section)">Kirupa.com: PHP and XML</a></li>
<li><a href="http://www.ibm.com/developerworks/library/x-xmlphp1.html">IBM.com: XML for PHP Developers, Part 1 (three-part series)</a></li>
<li><a href="http://www.dynamicdrive.com/forums/showthread.php?t=14165">DynamicDrive Forums: Read and Write XML with PHP</a> (forum-post, this is what got me started)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jes.gs/htmlcss/php-and-xml-a-quick-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Calendars II</title>
		<link>http://www.jes.gs/htmlcss/css-calendars-part-two-wordpress-integration/</link>
		<comments>http://www.jes.gs/htmlcss/css-calendars-part-two-wordpress-integration/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 08:28:53 +0000</pubDate>
		<dc:creator>Jess G.</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://dumpster-fairy.com/?p=110</guid>
		<description><![CDATA[More tips and tricks for CSS calendar icons, but this time, for Wordpress!]]></description>
			<content:encoded><![CDATA[<p>The last tutorial on CSS Calendar Icons was pretty straightforward but lacked directions for integration with other blogging platforms. Here, I&#8217;m going to use WordPress as an example and I&#8217;ll work with my calendar book-style css icon.<br />
<span id="more-110"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// begin calendar icon code</span>
	<span style="color: #000088;">$year</span> <span style="color: #339933;">=</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$y1</span><span style="color: #339933;">,</span><span style="color: #000088;">$y2</span><span style="color: #339933;">,</span><span style="color: #000088;">$y3</span><span style="color: #339933;">,</span><span style="color: #000088;">$y4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_split</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;span class=&quot;cssCalendar book&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F jS, Y'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
		&lt;span class=&quot;spine&quot;&gt;&lt;/span&gt;
		&lt;span class=&quot;year&quot;&gt;&lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$y1</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$y2</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$y3</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$y4</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;/span&gt;
		&lt;span class=&quot;cssCalInner&quot;&gt;
			&lt;span class=&quot;month&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
			&lt;span class=&quot;date&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'j'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
		&lt;/span&gt;
	&lt;/span&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// end calendar icon code ?&gt;</span></pre></div></div>

<p>Here, we&#8217;re using the WordPress function <a href="http://codex.wordpress.org/Template_Tags/get_the_time" rel="external wordpress" title="Wordpress Function: get_the_time()"><strong>get_the_time()</strong></a>, which works like <a href="http://codex.wordpress.org/Template_Tags/the_time" rel="external wordpress" title="Wordpress Function: the_time()"><strong>the_time()</strong></a>&#8212;which means that it uses the same <a href="http://us3.php.net/manual/en/function.date.php">PHP Date and Time formatting characters</a> as <strong>the_time()</strong>. Unlike <strong>the_time()</strong>, <strong>get_the_time()</strong> passes the result to a variable instead of echoing it, which is what we need here. We use <strong>get_the_date(&#8216;Y&#8217;)</strong> to grab just the year-part of the date, then we use <a href="http://us3.php.net/manual/en/function.str-split.php" rel="external php" title="Native PHP Function"><strong>str_split()</strong></a> and <a href="http://us3.php.net/manual/en/function.list.php" rel="external php" title="Native PHP Function"><strong>list()</strong></a> to parse the individual numbers of the year into separate variables.<br />
CSS Code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Default Calendar Styles */</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Trebuchet MS&quot;</span><span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalInner</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.day</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.month</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.date</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.year</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* Book-Style */</span>
<span style="color: #6666ff;">.book</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">57px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.book</span> <span style="color: #6666ff;">.cssCalInner</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">36px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.book</span> <span style="color: #6666ff;">.spine</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/calendar_book.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">38px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.book</span> <span style="color: #6666ff;">.year</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">75%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">purple</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">38px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.book</span> <span style="color: #6666ff;">.year</span> span <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.book</span> <span style="color: #6666ff;">.month</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.book</span> <span style="color: #6666ff;">.date</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">120%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Seems pretty straightforward, right?</p>
<p>Using WordPress? Go to the next page for a WordPress add-on to use in your own WordPress themes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jes.gs/htmlcss/css-calendars-part-two-wordpress-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Calendars</title>
		<link>http://www.jes.gs/htmlcss/css-calendars/</link>
		<comments>http://www.jes.gs/htmlcss/css-calendars/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 07:28:25 +0000</pubDate>
		<dc:creator>Jess G.</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://dumpster-fairy.com/?p=98</guid>
		<description><![CDATA[How to create those little CSS calendar icons you've been seeing everywhere.]]></description>
			<content:encoded><![CDATA[<p>About sometime last fall, I came across a <a href="http://brainstormsandraves.com/archives/2007/02/22/csscalendar/">tutorial</a> on how to create those little CSS calendar icons that are practically everywhere now. The method I found uses a background image and while that&#8217;s fine, I guess I prefer something that doesn&#8217;t require an image to bring off the design. This last layout that I&#8217;ve been working on for Dumpster-fairy.com makes use of those CSS icons, and to give credit where credit is due, I was very much influenced by the icons used at <a href="http://www.last.fm/">Last.fm</a> for the events calender list. I came up with my own workable solution and I&#8217;ll walk you through my methods in this post.<span id="more-98"></span></p>
<p>Since I was going to be using a calendar icon in different places on my website, I obviously would want the icon to appear slightly different in each place; for instance, I use a larger calendar icon as part of the header for my blog posts, and a smaller event-like calendar for the side-bar. So, I start off specifying a series of <em>default </em>styles:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Default Calendar Styles */</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Trebuchet MS&quot;</span><span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalInner</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.day</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.month</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.date</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
span<span style="color: #6666ff;">.cssCalendar</span> <span style="color: #6666ff;">.year</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>HTML Code:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cssCalendar&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Friday November 28th, 2008&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;day&quot;</span>&gt;</span>Fri<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cssCalInner&quot;</span>&gt;</span>
    	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;date&quot;</span>&gt;</span>28<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;month&quot;</span>&gt;</span>Nov<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;year&quot;</span>&gt;</span>2008<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span></pre></div></div>

<p>This is what you should have:<br />
<img class="size-full wp-image-100 alignnone" title="Yes, this is an image" src="http://www.jes.gs/wp-content/uploads/2008/11/example_text_01.png" alt="" width="52" height="84" /><br />
I&#8217;ve tested the base styles in Firefox 3, IE 7, Safari and Opera 9.5 and it appears pretty much the same across the board. But it&#8217;s a little boring, don&#8217;t you think? So we move on to adding some additional styles:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Medium Size */</span>
.<span style="color: #993333;">medium</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">52px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">medium</span> <span style="color: #6666ff;">.cssCalInner</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">medium</span> <span style="color: #6666ff;">.day</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">medium</span> <span style="color: #6666ff;">.date</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">120%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">medium</span> <span style="color: #6666ff;">.month</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">75%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">medium</span> <span style="color: #6666ff;">.year</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So this is what we do now. Our HTML fragment above? Change the first line to this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cssCalendar medium&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Friday November 28th, 2008&quot;</span>&gt;</span></pre></div></div>

<p>Didn&#8217;t know you could have more than one class for an html tag? Well, now you do. Your calendar—browser depending, of course—should look like this:<br />
 <img class="alignnone size-full wp-image-101" title="example_text_02" src="http://www.jes.gs/wp-content/uploads/2008/11/example_text_02.png" alt="" width="52" height="84" /></p>
<p>We could leave this tutorial here or, we can go on. You can check out the Last.fm-style calendar icons on the next page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jes.gs/htmlcss/css-calendars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Site coming soon</title>
		<link>http://www.jes.gs/general/new-site-coming-soon/</link>
		<comments>http://www.jes.gs/general/new-site-coming-soon/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 18:49:34 +0000</pubDate>
		<dc:creator>Jess G.</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[new site]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://dumpster-fairy.com/?p=63</guid>
		<description><![CDATA[New site in the making! &#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a re-design for Dumpster-fairy.com, namely to make it more professional than it is now. I&#8217;m working on the layout and new pages, though some of the coding is giving me a headache. The new site will still have tutorials and resources, but will feature newly added tutorials and resources on the front page. The new site will also have a portfolio—even though I already have a portfolio—this portfolio will also contain code samples of my web development work. Also, each tutorial will have a downloadable PDF version that will be hosted on my DeviantArt page, mainly to avoid gobbling up my bandwidth. Hopefully, in the next week or so, you should see the new site unveiled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jes.gs/general/new-site-coming-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

