<?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>Zo&#039;C &#187; Tutorial</title>
	<atom:link href="http://www.z-oc.com/blog/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.z-oc.com/blog</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 03 Feb 2010 15:06:36 +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>Colour reduction algorithms in Photoshop</title>
		<link>http://www.z-oc.com/blog/2009/01/colour-reduction-algorithms-phothoshop/</link>
		<comments>http://www.z-oc.com/blog/2009/01/colour-reduction-algorithms-phothoshop/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 01:40:35 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/03/untitled/</guid>
		<description><![CDATA[When you export graphics to be used in web pages, file size is important and for as obsolete as Gifs may seem to the eyes of some, don&#8217;t be mistaken, the indexed color system isn&#8217;t going anywhere. Even if Gifs are a bit in decline, Png files can use the indexed color system and this [...]]]></description>
			<content:encoded><![CDATA[<p><img class="left" src="http://www.z-oc.com/blog/wp-content/uploads/2009/01/colour-reduction-algorithms-in-phtoshop.png" alt="Colour Reduction Algorithms in Phtoshop"></p>
<p>When you export graphics to be used in web pages, file size is important and for as obsolete as Gifs may seem to the eyes of some, don&#8217;t be mistaken,<br />
the indexed color system isn&#8217;t going anywhere. Even if Gifs are a bit in decline, Png files can use the indexed color system and this is actually very useful.</p>
<p>Despite the predominance of Jpegs and support to millions of colours, many images are simple enough that they could benefit of using more modest color systems<br />
like indexed color which allows for up to 256 colours but allows you to control with precision which colours these would be and exactly how many, allowing for<br />
extremely compact image sizes.</p>
<p><span id="more-367"></span><br />
The RGB system allows you to represent up to 16,777,216 colours. Each colour is represented by 24bits; 8 bits for each of the red, green and blue channels.</p>
<p>This is the cost of having a wide colour spectrum for an image, which is much welcome for that picture you took at the paradisiac island you went on your last holidays.<br />
You need blues and greens for skies and sea, yellows, oranges and reds for the flowers and exotic birds and so on. You can&#8217;t settle for less.</p>
<p>Now, how about the icons on your navigation bar? Say they are 16px tall and 16pixels wide. They have only 256 pixels overall, so you can&#8217;t possibly have more<br />
than 256 colours, even if no two pixels share the same.</p>
<p>Of course is very rare that an image has every single pixel of a different colour, so in practice you have significantly bigger images with no more than 256 colours.<br />
Further, there are types of images that, for as big as they can be, they have a limited number of colours, for instance, illustrations and drawings with no gradients<br />
or with small ones.</p>
<p>This is where the indexed color system comes in handy.</p>
<p>In this mode, you can have only up 8 bits per pixel. Compared with 24 in RGB, that is a third of the uncompressed size. Very tempting and even more so when<br />
you discover that you can specify the image depth (the amount of bits per pixel) to any amount up to 8. So, if you can afford to have only 16 colours, you only<br />
need 4 bits per pixel.</p>
<p>Photoshop, just as any other half-decent image editor, will allow you to work in RGB for flexibility and to export files in indexed colour on Gif or PNG format for<br />
the web (and on several other formats, that I won&#8217;t cover here).</p>
<p>Now, it is a fact that if we remove some of the colours of a colourful image we won&#8217;t notice. In fact, this is how the Jpeg compression algorithm works; it will discard<br />
colour information to reduce the file size.</p>
<p>The GIF and PNG compression algorithms are quite different and, in fact you can use that to your advantage, because while the Jpeg will always discard colour information,<br />
the GIF and PNG compression algorithms are conservative and they will preserve your image intact. This is particularly important for drawings and illustrations that have<br />
much less details than photographs and even little losses can be quite damaging.</p>
<p>But having said that, you can use photoshop to discard some of the colours in the image before you export them as GIF or PNG.</p>
<p>To save images for the web in Photoshop, you have to go to File &rarr; &#8220;Save for web &amp; Devices&#8221;. A dialog will open showing you the original image and how the final image will look like.</p>
<p>Now, in the right pane, you&#8217;ll see several options and if you select either PNG-8 or GIF, you will have a box for the colour reduction algorithm that allows you to chose<br />
from </p>
<ul>
<li>Perceptual</li>
<li>Selective</li>
<li>Adaptive</li>
<li>Restrictive (Web)</li>
<li>Custom</li>
<li>Black &amp; White</li>
<li>Grayscale</li>
<li>MacOS</li>
<li>Windows</li>
</ul>
<p>Let&#8217;s start for the easy ones. Black &amp; white will make pixels either black or white. No shades of gray, no colours, only one bit for each pixel. Grayscale will use<br />
8 bits per pixel and will approximate each pixel to a shade of gray, the resulting image will have no colour, but will have shades of gray. MacOS and Windows will<br />
approximate the colours on the image to the closest colour of the basic palette of these systems and custom will allow you to pick the colours you want on your palette.</p>
<p>Custom is very powerful, but can also be very annoying. Also, very often you already selected some colours that you&#8217;ve put on your image and you want to preserve.</p>
<p>This is where Perceptual, Selective and Adaptive come in.</p>
<p>If the original image contains more colours than the output file (you can select the number of colours on the right pane, up to 256) some will have to be adapted.</p>
<p>The <em>Perceptual</em> algorithm will create a palette that prioritizes the colours that the human eye has greater sensitivity. This means that colours that appear more<br />
frequently may not be present in the resulting image at all.</p>
<p>The <em>Selective</em> algorithm will prioritize broad regions of colours. If you want to keep your colours as faithful as possible<br />
to the original, this one is more likely to do that.</p>
<p>The <em>Adaptive</em> algorithm on the other hand will prioritize the colours present in more pixels across the image. Predominant hues will have more tones<br />
in the palette.</p>
<p>Finally, <em>Restritive (web)</em> is a bit out of fashion these days but in the old days when was uncommon for computer monitors to show more than 256 colours<br />
a special palette was created for the web with colours that any monitor would be able to show. This palette is made of 6 equidistant shades of each of the three<br />
RGB channels. The tones are 0&#215;00, 0&#215;33, 0&#215;66, 0&#215;99, 0xcc and 0xff. Meaning that you can combine these to form the 216 colours of the web palette, for instance<br />
the colour 0x33ffcc is a web safe colour. You may never need this last one, but it won&#8217;t hurt to know either, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2009/01/colour-reduction-algorithms-phothoshop/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Domain redirect wizardry with .htaccess rules</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/</link>
		<comments>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 17:10:47 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[Server Side]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[wizardry]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/</guid>
		<description><![CDATA[So you decided your domain doesn&#8217;t fit you as well as you&#8217;d like. And you are also afraid you&#8217;ll be losing all the old links and search engine ranking if you move to a new one. Maybe you also want to use the current domain for a different project that suits it best. Or maybe [...]]]></description>
			<content:encoded><![CDATA[<p>So you decided your domain doesn&#8217;t fit you as well as you&#8217;d like. And you are also afraid you&#8217;ll be losing all the old links and search<br />
engine ranking if you move to a new one. Maybe you also want to use the current domain for a different project that suits it best.</p>
<p>Or maybe you just want to change the structure of your URLs or you want a different URI structure in the new domain.</p>
<p>Let&#8217;s see how to write some htaccess rules so Apache can do the magic for you.</p>
<p><span id="more-342"></span></p>
<h3>Redirect the whole domain</h3>
<p>Redirecting a whole domain with .htaccess rules is easy. All you have to do is to put the rules below in an file named .htaccess<br />
in the root directory for your old domain.</p>
<pre><code>
RewriteEngine on
RewriteRule ^(.&lowast;)$ http://www.newdomain.com/$1 [R=301,L]
</code>
</pre>
<p>Let&#8217;s see how the magic happens.</p>
<p>The first line is merely to turn on the Rewrite engine on apache and enable the rewrite rules to be interpreted.</p>
<p>The second line is composed of 4 parts.</p>
<ol>
<li>The RewriteRule keyword</li>
<li>A regular expression (regex) to match the original URI</li>
<li>The URI to be redirected to and </li>
<li>Parameters</li>
</ol>
<p>The regular expression in this case is <code>^(.*)$</code>. The dot, in a regular expression matches a character, any character except the newline.<br />
That means that any letter, number or symbol container in a URL will be matched. The asterisk <code>(&lowast;)</code> means that you want to repeat the regex it affects<br />
zero or more times.</p>
<p>Simply put, <code>(.&lowast;)</code> matches any amount of non-newline characters, including zero.</p>
<p>Additionally, the carat <code>(^)</code> represents the start of a line and the dollar sign <code>($)</code> represents the end, so the whole expression<br />
matches a line of zero or more non-newline characters, i.e., the whole path of your URI inside your domain.</p>
<p>The third part is the URI to redirect to. As you see, is pretty straightforward, the only tricky bit is the <code>$1</code>.</p>
<p>The reason for it is that you don&#8217;t want to redirect any URI in the old domain to the root of your new domain. What you want is to redirect<br />
each page for the equivalent in the new one. For instance this URI</p>
<pre><code>http://www.oldomain.com/path/to/page</code></pre>
<p>Should redirect to</p>
<pre><code>http://www.newomain.com/path/to/page</code></pre>
<p>Now, for every regular expression inside parenthesis the text it matches is stored for use in the third part as a variable. The variables are called<br />
<code>$1</code>, <code>$2</code>, <code>$3</code> and so on. We have only one Regex matching the whole path (remember the domain name is not included)<br />
so we have the whole path stored in <code>$1</code>.</p>
<h3>Altering the URI structure</h3>
<p>It may be the case that you don&#8217;t like the current structure of your URI&#8217;s. If your blog has URIs like this</p>
<pre><code>www.olddomain.com/blog/category/2009-12-20-post-title</code></pre>
<p>Say we decide dates are not that important, we only want to keep the year, and we want it separated by a slash, rather than a dash. Additionally,<br />
we want to get rid of the &#8216;blog&#8217; keyword, since the whole domain is for the blog. The following rule will do the trick.</p>
<pre><code>
RewriteEngine on
RewriteRule ^blog/(.&lowast;)/([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])-(.&lowast;)$ http://www.newdomain.com/$1/$2/$5 [R=301,L]
</code></pre>
<p>Here we have 5 matches being put into variables, one for each pair of parenthesis.</p>
<dl>
<dt>The category ($1)</dt>
<dd>Matches the first set of non-newline characteres after &#8216;blog/&#8217; and the before the following slash.</dd>
<dt>The Year ($2)</dt>
<dd>Matches 4 consecutive digits after the second slash and before the first dash after that</dd>
<dt>The Month ($3)</dt>
<dd>Matches 2 consecutive digits between the first and second dashes after the second slash</dd>
<dt>The day ($4)</dt>
<dd>Matches 2 consecutive digits between the second and third dashes after the second slash</dd>
<dt>The Post Slug ($5)</dt>
<dd>Matches all the rest of the line</dd>
</dl>
<p class="warning">Before we proceed, notice a peculiarity here. Because the rule starts with the carat (^) and ends with the dollar sign ($) you are<br />
matching the whole line in this format. If the URI doesn&#8217;t start exactly with &#8220;blog/&#8221; and has the exact amount of slashes and dashes<br />
we specified it won&#8217;t be a match and will be ignored. Also, the category may be empty, as long as the two slashes are there, but the digits<br />
must be present in exact amounts. That, of course, is to be expected of any previously valid URL on the domain.
</p>
<p>Now that we have the five variables with the orginal information parsed, we can use them as we want. We decided to get rid of the blog part (which we<br />
are matching literally, instead of via regex, because it&#8217;s too simple), month and day and reorganize category, year and post slug. We will use the<br />
first, second and fifth variables and simply ignore the rest.</p>
<pre><code>http://www.newdomain.com/$1/$2/$5/</code></pre>
<p>If you don&#8217;t want to redirect to a new domain but just rearrange the URIs within it, you may simply omit the domain on the redirection and use these rules</p>
<pre><code>RewriteEngine on
RewriteRule ^blog/(.&lowast;)/([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])-(.&lowast;)$ /$1/$2/$5 [R=301,L]
</code></pre>
<h3>Reusing the domain for a different project</h3>
<p>More often than not, after a domain redirect, the old domain will remain merely as an entry point for redirection. People do that for several reasons,<br />
one of them is that readers can be confused to find the old URLs being redirected to a new site and the domain being used for a new site.</p>
<p>But deciding whether or not to reuse your domain is outside the scope of this post. You may be splitting your site in two and you&#8217;ll leave part of it in<br />
the old domain or after a few years, links to your old domain may be minimal or, simply, you may have a better strategy that I can thing while writing this.</p>
<p>In any case, if you want to reuse your domain at some point, you must be aware of a few things.</p>
<p>All the URI&#8217;s redirected are taken and can&#8217;t be reused without disabling the redirection. You guessed that, of course, but you have to keep in mind that<br />
when you are using regexes for your redirects you are matching a whole class of URIs, even some that have not being used but match the pattern.</p>
<p>If you hurried up and used the first rule (repeated below) you are matching every single URI within the old domain and it means that any content there<br />
will be unreachable because the redirection rules will take precedence.</p>
<pre><code>
RewriteEngine on
RewriteRule ^(.&lowast;)$ http://www.newdomain.com/$1 [R=301,L]
</code></pre>
<p>If you used the second rule (repeated below) you are targetting a much more specific set of URIs. Anything that doesn&#8217;t have the exact format described<br />
(/blog/[characters]/[4digits]-[2digits]-[2digits]-[characters]) will be reachable.</p>
<pre><code>
RewriteEngine on
RewriteRule ^blog/(.&lowast;)/([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])-(.&lowast;)$ http://www.newdomain.com/$1/$2/$5 [R=301,L]
</code></pre>
<p>You&#8217;ll be able to even run a blog under <code>http://www.olddomain.com/blog/</code> as long as you don&#8217;t use the exact same URI structure. Again<br />
whether or not this is a good idea is up to you to decide.</p>
<h3>301 or 302 redirects</h3>
<p>Finally, you may have noticed that one of the parameters on the last part of the rules is the number 301. This is the type of redirection you are<br />
performing. You can use either 301 or 302 as redirection codes, 301 stands for a permanent redirection, whereas 302 stands for a temporary redirection.</p>
<p>Redirection codes are informed to user agents (browsers), search bots and anyone else who may want to know. While both redirection codes will take you<br />
to the new URI, there are important consequences of choosing either.</p>
<p>Because user agents and bots are informed of the redirection code, they can take actions based on them.</p>
<p>A temporary redirection is equivalent to an &#8220;Out For Lunch&#8221; sign. For some reason, the page is being redirected, but you are confirming the user is on<br />
the permanent URI for the resource. Bear in mind that &#8220;temporary&#8221; doesn&#8217;t imply in any length of time, you are only saying &#8220;Yes, this is the URI. We<br />
are operating there right now, but come back here the next time&#8221;.</p>
<p>Reasons for that could be:</p>
<dt>Maintenance page</dt>
<dd>You may want to redirect the whole traffic of your page for a few minutes or hours while you are performing an upgrade</dd>
<dt>Feedburner redirect</dt>
<dd>If you use feedbuner, you may want people to subscribe to an URI within your domain, but redirect to feedburner. If<br />
    one day you want to use a different service, all your subscribers use your URI, so they will be automatically redirected.</dd>
<p>A permanent redirection is stronger, it is equivalent to say &#8220;We moved, we are now operating there and we are not coming back. Next time<br />
you may prefer to go there straight away&#8221;. The consequence of that<br />
is that search bots, intelligent user agents, social bookmarking sites and whoever else may care, can update their links to the new location.</p>
<p>This is what is going to make possible for Search Engines to transfer the status of your site to the new structure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Categorizing Pages and Posts in WordPress</title>
		<link>http://www.z-oc.com/blog/2008/05/post-and-page-categories/</link>
		<comments>http://www.z-oc.com/blog/2008/05/post-and-page-categories/#comments</comments>
		<pubDate>Sat, 03 May 2008 18:30:47 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2008/05/post-and-page-categories/</guid>
		<description><![CDATA[Having authored a plugin to display sub categories on wordpress, I&#8217;m often faced with users that realize they can&#8217;t use categories on pages, and they turn to me to explain how can be done. This post is meant to help all these people that want to learn why they can&#8217;t use categories on pages and, [...]]]></description>
			<content:encoded><![CDATA[<p>Having authored a plugin to display sub categories on wordpress, I&#8217;m often faced with users that realize they can&#8217;t use categories on pages, and they turn to me to explain how can be done. This post is meant to help all these people that want to learn why they can&#8217;t use categories on pages and, show you that this doesn&#8217;t mean you can&#8217;t categorize pages at all.</p>
<h3>Pages and subpages</h3>
<p><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/05/parent-pages-templates.png' alt='Parent pages and layouts' class="right" />In a conventional CMS, pages within a web site are classified in sections and subsections. Each section tipically contain a description of what the section is about and links to its subsections and pages.</p>
<p>Each CMS has its own way to do it and often its own jargon but, ultimately, it is the same philosophy.</p>
<p>WordPress is not different in this respect. If you want to use it to run a regular (non-blog) web-site, you can.</p>
<p>WordPress has a feature called pages, which are very similar to posts in many aspects, but they differ, essentially, in the fact that there is no chronology associated to it, pretty much like traditional web pages.</p>
<p>In order to run a non-blog website with WordPress, you&#8217;ll rely on pages, rather than posts, to publish your content, and this also means that the publish date of this content will be much less important than in a blog, if important at all.</p>
<p>That might be good enough for a small site with half a dozen pages, but what if you have slightly bigger ambitions and you need to categorize your content?</p>
<h3>Time for an example</h3>
<p>Say you run a cooking site (not blog!) and you need the following pages/sections: Recipes, Desserts, Nutritional facts and an About page.</p>
<p><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/05/food-menu.png' alt='Food Menu' /></p>
<p>In WordPress, the way to do it is to create a page for each one. Each page in WordPress can have a parent page and all pages can be parents as well. These will be the topmost pages, so they have no parent but some of these pages will also work as sections by being parents of other pages.</p>
<p>For the rest of the content, each time you publish a recipe, you will create a page for it, and you will set the main recipes page as a parent. In this way, all recipes are sub pages of the recipes page, and the recipes page immediately becomes a category, as much as a page.</p>
<p>The same goes for the recipes and nutritional facts, but let&#8217;s give a bit of attention to the about page.</p>
<p>Although the about page will be categorized as a root page and be on the same level than the main categories, the about page can merely be a plain a simple page with no children.</p>
<p>Because of the way pages are categorized as sub-pages of other pages, you don&#8217;t have to distinguish sections from regular pages. In addition, if one day you want to add sections the the about page (eg, about the authors, our history, etc) you can simply create the pages and set the about page as parent.</p>
<p>Thanks to the ability to create different page templates, you can even style each section or page differently.</p>
<h3>Posts and categories</h3>
<p><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/05/categories.png' alt='Post Categories in WordPress' class="right" />For a person with a background stronger in blogs than in static websites, categories might seem missing for pages on WordPress, but actually is the other way around. For someone coming from a static sites background, the problem might seem to be quite the opposite.</p>
<p>The only basic difference between pages in static sites and posts in a blog is that posts follow a chronological sequence, while pages just sit there and the sequence in which they were written is not quite important.</p>
<p>Although this is the only remarkable difference, this radically changes the way authors and readers approach to each kind of website, and consequently the features a CMS needs to implement for each one.</p>
<p>For instance, blogs are meant to be followed over time. The latest information is supposed to be the most important at a given time and that is why posts are presented in reverse chronological order. It shouldn&#8217;t have to be like this, but is quite convenient.</p>
<p>Now, having said that, this doesn&#8217;t imply that older posts aren&#8217;t useful, and they should be made available in and presented in an organized way. But because the chronological factor, a blog has a few extra challenges on the organization subject.</p>
<ul>
<li>Usually, much more content is created for a blog than for a static site</li>
<li>With the continuous addition of new content, classifications can grow obsolete pretty quicly</li>
<li>New sections may be needed and accommodate them must be made easy</li>
<li>Posts might belong to more than one section as time goes by</li>
</ul>
<p>Regarding a section of pages as a page on itself does make sense, but a post section being regarded as a post makes no sense at all. I explain:</p>
<p>A post is characterized as such by its chronological aspect while categories&#8217; creation date on themselves usually have no importance at all. Hence, there is no sense in regarding a category as a post. Actually, if you come to think of it, this paragraph is almost unnecessary as this though is pretty much counter-intuitive.</p>
<p><strong>Enter categories!</strong></p>
<p>Categories are simply a name you can create and you can relate posts with, pretty much as parent pages.</p>
<p>And similarities don&#8217;t stop there. A category might have a parent category, just like pages.</p>
<p>Also, you might not be aware, but WordPress allow you to create different pages for displaying each category, so if you have a limited number of them or if you want to highlight some, you can actually style a template that work as parent page in most aspects. But this is out of the scope of this post and in material for a future discussion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2008/05/post-and-page-categories/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tutorial: A category based archive on WordPress</title>
		<link>http://www.z-oc.com/blog/2008/03/category-based-archive/</link>
		<comments>http://www.z-oc.com/blog/2008/03/category-based-archive/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 02:21:20 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[Server Side]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2008/03/category-based-archive/</guid>
		<description><![CDATA[I followed Lorelle&#8217;s advice advice and added a category based archive on Zo&#8217;C's archive page, and now I&#8217;m going to tell you how to create yours. At the end of this post, you&#8217;ll find the complete code in a single piece. Step 1: Create the template file and find the content area The first thing [...]]]></description>
			<content:encoded><![CDATA[<p>I followed <a href="http://www.z-oc.com/blog/2008/02/a-powerful-archive-page-for-your-wordpress-blog/#comment-1111">Lorelle&#8217;s advice</a> advice and added a category based archive on <a href="http://www.z-oc.com/blog/archive/">Zo&#8217;C's archive page</a>, and now I&#8217;m going to tell you how to create yours.</p>
<p>At the end of this post, you&#8217;ll find the complete code in a single piece.</p>
<h3>Step 1: Create the template file and find the content area</h3>
<p>The first thing to do is create a new template page for your theme. The easiest way to do it is by duplicating your default page template which is the file &#8220;page.php&#8221;. Login via FTP, SSH or your favorite method an copy that file to &#8220;category_archive.php&#8221; and start editing.</p>
<p>Edit your file so at the very beginning it has the following lines, they are responsible for telling WordPress this is a template page and its name.</p>
<p><code>
<pre>&lt;?php
/*
Template Name: CategoryArchive
*/
?&gt;</pre>
<p></code></p>
<p>The reason why we copied the default page instead of starting from the scratch is that any theme has is peculiarities (footer, sidebar, header, this and that) and we want to preserve them all, we just want to change the content. So, now, you must find the content.</p>
<p><span id="more-268"></span></p>
<p>It is probably different on your theme, but in mine, I find content starts after this</p>
<p><code>
<pre>&lt;div id="main"&gt;
&lt;div id="container"&gt;
&lt;?php include("menu-sec.php"); ?&gt;
	&lt;div id="content"&gt;</pre>
<p></code></p>
<p>And ends just before this</p>
<p><code>
<pre>	&lt;/div&gt;&lt;!-- content --&gt;
&lt;/div&gt;&lt;!-- container --&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;div class="clearer"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;!-- main --&gt;

&lt;?php get_footer(); ?&gt;</pre>
<p></code></p>
<h3>Step 2: Find the categories and loop through them</h3>
<p>Once you have located the content area let&#8217;s get to the PHP code to make the magic happen.</p>
<p>First you have to inquiry WordPress for the categories</p>
<p><code>
<pre>&lt;?php $cats = get_categories("hierarchical=0"); ?&gt;</pre>
<p></code></p>
<p>Then loop through them and display them. Don&#8217;t forget to check for NULL entries: a sanity check. In case something goes wrong and no categories are returned the script will do nothing instead of crashing.</p>
<p><code>
<pre>
&lt;?php if($cats != NULL) { ?&gt;
		&lt;ul&gt;
		&lt;?php foreach ($cats as $cat) { ?&gt;
			&lt;li&gt;
			&lt;?php if($cat != NULL) {
				$base_url = get_bloginfo('home') . "/category/" . $cat-&gt;slug; ?&gt;
				&lt;h3&gt;&lt;a href="&lt;?php echo $base_url?&gt;"&gt;&lt;?php echo $cat-&gt;cat_name?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;?php } ?&gt;

			&lt;?php // Show category description
				if ($cat-&gt;category_description != NULL) ?&gt;
					&lt;p&gt;&lt;?php echo $cat-&gt;category_description ?&gt;&lt;/p&gt;</pre>
<p></code></p>
<p>For each category, we are presenting the title and the description. Additionally, the category name is a link to the regular category listing page, so people can dig further on a category, if they want to.</p>
<h3>Step 3: Find the posts filed under each category and display them</h3>
<p>On each iteration of the loop above, besides presenting the category info, we need to query the posts filed under that particular category and display them. Start by querying WordPress about the posts of the category you are in.</p>
<p><code>
<pre>&lt;?php $myposts = get_posts("numberposts=-1&#038;category=$cat->cat_ID"); ?&gt;</pre>
<p></code></p>
<p>(UPDATE: get_posts parameters updated to avoid the default limit of 5 posts, thanks Chuck for <a href="http://www.z-oc.com/blog/2008/03/category-based-archive/#comment-1224">pointing out the problem</a>.)</p>
<p>And then, loop through them displaying its name and permalink. And, once we have our hands on it, lets add it a touch of class and display the date in which it was published.</p>
<p><code>
<pre>&lt;ul&gt;
&lt;?php foreach($myposts as $post) : ?&gt;
	&lt;li&gt;&lt;?php the_time('M d') ?&gt;. &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;?php endforeach; ?&gt;
&lt;/ul&gt;</pre>
<p></code></p>
<p>Don&#8217;t forget to close the outer loop:</p>
<p><code>
<pre>&lt;?php } ?&gt;</pre>
<p></code></p>
<h3>Step 4: Create a page using the layout you just made</h3>
<p><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/03/selecting_template.png' alt='Selecting The Template' class="right" />Now that you have created a page template for your category based archive, you must create a page using it.</p>
<p>Go to the admin panel on your blog, to the write page interface and create your page normally, except that on the right panel, under &#8220;Page Template&#8221; you&#8217;ll chose &#8220;CategoryArchive&#8221;. Chose a nice Post Slug for it if you want and a descriptive title but you don&#8217;t need to put any content because it won&#8217;t show anyway.</p>
<h3>The complete code to copy and paste</h3>
<p>If you find it difficult to copy and paste all the pieces of this tutorial, here is the complete code that you can just copy and paste inside the  content of your page template. </p>
<p>Just remember that this is NOT the complete template, as it changes from theme to theme, this is only the juicy part of it, enjoy.</p>
<p><code>
<pre>&lt;?php $cats = get_categories("hierarchical=0"); ?&gt;

&lt;?php if($cats != NULL) { ?&gt;
		&lt;ul&gt;
		&lt;?php foreach ($cats as $cat) { ?&gt;
			&lt;li&gt;

			&lt;?php if($cat != NULL) {
				$base_url = get_bloginfo('home') . "/category/" . $cat-&gt;slug; ?&gt;
				&lt;h3&gt;&lt;a href="&lt;?php echo $base_url?&gt;"&gt;&lt;?php echo $cat-&gt;cat_name?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;?php } ?&gt;

			&lt;?php // Show category description
				if ($cat-&gt;category_description != NULL) ?&gt;
					&lt;p&gt;&lt;?php echo $cat-&gt;category_description ?&gt;&lt;/p&gt;

				&lt;?php $myposts = get_posts("category=$cat-&gt;cat_ID"); ?&gt;
				&lt;ul&gt;
				&lt;?php foreach($myposts as $post) : ?&gt;
					&lt;li&gt;&lt;?php the_time('M d') ?&gt;. &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
				&lt;?php endforeach; ?&gt;
				&lt;/ul&gt;
			&lt;/li&gt;
	&lt;?php } ?&gt;
		&lt;/ul&gt;
&lt;?php } ?&gt;</pre>
<p></code></p>
<h3>Who is using it</h3>
<ul>
<li><a href="http://pshero.com/gallery/">PS Hero</a></li>
<li><a href="http://www.morphodesigns.com/article-time-machine/">Morpho Designs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2008/03/category-based-archive/feed/</wfw:commentRss>
		<slash:comments>70</slash:comments>
		</item>
		<item>
		<title>Animation in Photoshop &#8211; Video Tutorial</title>
		<link>http://www.z-oc.com/blog/2008/03/animation-in-photoshop-tutorial/</link>
		<comments>http://www.z-oc.com/blog/2008/03/animation-in-photoshop-tutorial/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 16:47:51 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[Art & Design]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Podcast]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2008/03/animation-in-photoshop-tutorial/</guid>
		<description><![CDATA[Zo&#8217;C has entered the age of video. It took me a while to get all things right, but better safe than sorry isn&#8217;t it? I intend to periodically share some videos on web design and development things. That can be Photoshop, Illustrator, how to install a tool, CSS tricks and so on. It could just [...]]]></description>
			<content:encoded><![CDATA[<p><object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A%2F%2Fzoc%2Eblip%2Etv%2Frss%2Fflash%2F&#038;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" width="500" height="318" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A%2F%2Fzoc%2Eblip%2Etv%2Frss%2Fflash%2F&#038;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" /><param name="quality" value="best" /><embed src="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A%2F%2Fzoc%2Eblip%2Etv%2Frss%2Fflash%2F&#038;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" quality="best" width="500" height="318" name="showplayer" type="application/x-shockwave-flash"></embed></object></p>
<p>Zo&#8217;C has entered the age of video. It took me a while to get all things right, but better safe than sorry isn&#8217;t it?</p>
<p>I intend to periodically share some videos on web design and development things. That can be Photoshop, Illustrator, how to install a tool, CSS tricks and so on. It could just as well be about videoblogging.</p>
<p>For my first  tutorial on this new era I&#8217;m going to teach you how to create a cool animation in Photoshop like the one on my last <a href="http://www.z-oc.com/blog/2008/03/podcasting-videoblogging-and-social-screencasting-tools-and-ideas/">post about videoblogging and podcasting</a> and I&#8217;ll show you how to export it in several video formats including Flash video, Quicktime .mov and animated Gif&#8217;s.</p>
<p>Have a lot of fun!</p>
<p>Oh, and did I mention that you can <a href="itpc://zoc.blip.tv/rss/itunes/">subscribe via iTunes</a> or any other tool via <a href="http://www.z-oc.com/blog/feed/mediafeed">media feed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2008/03/animation-in-photoshop-tutorial/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Podcasting, Videoblogging and Social Screencasting: tools and ideas</title>
		<link>http://www.z-oc.com/blog/2008/03/podcasting-videoblogging-and-social-screencasting-tools-and-ideas/</link>
		<comments>http://www.z-oc.com/blog/2008/03/podcasting-videoblogging-and-social-screencasting-tools-and-ideas/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 14:55:22 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[screencasting]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[videoblogging]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2008/03/podcasting-videoblogging-and-social-screencasting-tools-and-ideas/</guid>
		<description><![CDATA[The so called Web 2.0 is the medium where readers are also writers or, in a more general sense, consumers are also producers. Every single comment you leave on a blog is content you produce and use to expose yourself while, hopefully, contributing to the whole online community one crumb at a time. While probloggers [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/03/out_of_syntony_tv.gif' alt='Out of Syntony TV' class="left" style="border:none" />The so called Web 2.0 is the medium where readers are also writers or, in a more general sense, consumers are also producers. Every single comment you leave on a blog is content you produce and use to expose yourself while, hopefully, contributing to the whole online community one crumb at a time.</p>
<p>While probloggers build monetization and authority strategies for blogs and internet media sites, millions of other people just share their pictures in social sites like <a href="http://flickr.com/">flickr</a>, videos on <a href="http://www.youtube.com/">youtube</a> and so on.</p>
<p>The curious thing is that, to a certain measure, people are more interested in spontaneity than production. The fact that most people on the internet have access to rather advanced technology, makes it less interesting to see the technology by itself and more interesting to focus on each one&#8217;s perspective and enables people to use the technology to share those unique skills and ideas each one has.</p>
<p><a href="http://michaelmartine.com/2008/02/03/start-video-blogging-in-five-easy-steps/">Michael Martine</a> would go as far as to say:</p>
<blockquote><p>Over-analyzing before you begin is the best way to kill something before it even has a chance. Just go for it.</p></blockquote>
<p>But of course you can&#8217;t do anything if you can&#8217;t handle this technology, so here is a quick guide of interesting stuff around the web, either if you want to be a web video entrepreneur or if you just want to share videos with your friends</p>
<p><span id="more-230"></span></p>
<h3>How do I make a video easily?</h3>
<p>The straight answer would be</p>
<ol>
<li>Get a webcam</li>
<li>Configure it</li>
<li>Make test videos (and don&#8217;t bother to edit them)</li>
<li>Make a real video</li>
<li>Upload it and spread the word</li>
</ol>
<p>It is a little rude to put things like that, but it can actually be that easy. Check <a href="http://michaelmartine.com/2008/02/03/start-video-blogging-in-five-easy-steps/">Michael Martine&#8217;s post</a> to read details on each of these points</p>
<h3>How do I create a video show?</h3>
<p><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/03/blip_tv.jpg' alt='Blip TV' class="right" />Well, if you want to publish a videoblog, then you have to start to concern about other things like giving your video posts a sense of sequence and identity. In other words, you need to think of it as a show.</p>
<p>Youtube isn&#8217;t probably the best tool. You&#8217;ll need a system that offers you more that merely hosting your videos, you&#8217;ll need a system that allows you to host your show. That means, hosting a series of videos that have a chronology, and help you build and maintain your show&#8217;s identity.</p>
<p>I found the <a href="http://blip.tv/">Blip.tv</a> service very good for hosting a show. They accept most video formats and they won&#8217;t resize your video, so you can actually put online a show with the resolution you need.</p>
<h3>How do I do live broadcasting?</h3>
<p>If you want to create a live show and keep the archives, then you can use <a href="http://www.ustream.tv/">Ustream.tv</a>. Ustream.tv is free and allows you to create a program based on live broadcasting and all you need is a camera and a microphone connected to your computer, and your webcam counts.</p>
<h3>How do I create a videoblog?</h3>
<p>Is nice to have a show at Blip.tv or similar service, but you&#8217;ll like to have your own webpage for that, won&#8217;t you. Not only a static page, but you&#8217;ll like the videos to be displayed on it just like a blog and you want a feed for it so people can get your podcast directly from iTunes.</p>
<p>There is a very nice and easy to follow <a href="http://www.freevlog.org/index.php/category/tutorial/">tutorial on Freevlog</a> that helps you with most of that.</p>
<p>You can learn more at <a href="http://blip.tv/learning/">Blip.tv Learning Section</a>, they will even help you monetize your show.</p>
<h3>How do I create a screencast?</h3>
<p>Screencast are videos of your computer screen taken just like old fashioned screenshots, but animated. You can watch <a href="http://www.z-oc.com/blog/2008/02/video-tutorials-on-how-to-configure-the-powerblogroll-plugin/">these two I made</a>, to get the idea.</p>
<p>Screencasts are videos just like any other, so the only question that remains unanswered is how to record one.</p>
<p>There are a lot of screencast options avaliable out there and some of them are free.</p>
<p>As a Mac user, I personally have been playing with three</p>
<dl>
<dt><a href="http://danicsoft.com/projects/copernicus/">Copernicus</a></dt>
<dd>Is distributed free, handles screencasts beautifully but doesn&#8217;t record sound. It is ideal if you want to add sound in post production or if you want (or don&#8217;t mind) to record sound separately. You can use <a href="http://audacity.sourceforge.net/">Audacity</a> for that either in Mac OS, Windows or Linux.</dd>
<dt><a href="http://www.screencast-o-matic.com/">Screencast-o-Matic</a></dt>
<dd>Screencast-o-Matic is a java appication that runs online. No need to install anything, is platform independent and is fully featured. Works like a charm and you can use it wherever you are, even on a cyber cafe in the middle of nowhere. They will even host your video if you want, but you can also export it as a .mov to your computer. The downside is that you can only record in either 640&#215;480, 800&#215;600 or 1024x768px and if you chose to host it with them, they&#8217;ll downsize it to a max of 800x600px</dd>
<dt><a href="http://www.jingproject.com/">Jing</a></dt>
<dd>Jing is exist in Mac OS and Windows flavors and is a cute little application that sits in your desktop and allows you to record upload and share screencasts from a simple and intuitive interface. It is made to work together with <a href="http://screencast.com/">screencast.com</a>, but you can also configure it to share files in any server (or your local computer) via FTP. It also handles snapshots and uploads them directly to flicrk, or any ftp server of your choice.</dd>
</dl>
<p><a href='http://www.z-oc.com/blog/wp-content/uploads/2008/02/jing_snapshot.jpg' title='Jing'><img src='http://www.z-oc.com/blog/wp-content/uploads/2008/02/jing_snapshot.jpg' alt='Jing' class="right" /></a></p>
<p>If you&#8217;d like to see a longer list of software available to other platforms, you can check <a href="http://www.webdesignarchive.org/2008/01/13/free-screencast-software-for-linux-mac-os-x-and-windows/">this one</a>. This is where I learned about Jing and copernicus, but I haven&#8217;t tested any of the Linux and Windows options yet.</p>
<h3>Social Screencasting?</h3>
<p>Ok, ok, ok. Not everyone wants to be the star of her own show. Some people just want to use the power of video to show someone distant a screencast and make her understand things as if she were there.</p>
<p><a href="http://www.jingproject.com/">Jing</a> is a tool that allows you to do just that!</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="462" height="153"><param name="movie" value="http://content.screencast.com/bootstrap.swf"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><param name="flashVars" value="thumb=http://content.screencast.com/media/3c09a515-cf71-48d9-be25-0ea8a0f4e7fb_cec8fb39-4dcb-4aa8-9be9-73ca1f5bbfb2_static_0_0_Thumbnail.gif&#038;content=http://content.screencast.com/media/978fd610-6280-476d-9612-653a8ecc5dd1_cec8fb39-4dcb-4aa8-9be9-73ca1f5bbfb2_static_0_0_00000024.swf&#038;width=462&#038;height=153"></param><param name="allowFullScreen" value="true"></param><param name="scale" value="showall"></param><param name="allowScriptAccess" value="always"></param> <embed src="http://content.screencast.com/bootstrap.swf" quality="high" bgcolor="#FFFFFF" width="462" height="153" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/media/3c09a515-cf71-48d9-be25-0ea8a0f4e7fb_cec8fb39-4dcb-4aa8-9be9-73ca1f5bbfb2_static_0_0_Thumbnail.gif&#038;content=http://content.screencast.com/media/978fd610-6280-476d-9612-653a8ecc5dd1_cec8fb39-4dcb-4aa8-9be9-73ca1f5bbfb2_static_0_0_00000024.swf&#038;width=462&#038;height=153" allowFullScreen="true" scale="showall"></embed></object></p>
<p>By clicking on the little icon that might stand on your desktop (if you want it to) you can start recoding and immediately upload it. You don&#8217;t need a blog or any production. All you need to do is create a screencast account of configure an FTP you have. It will automatically give you embedding code and urls for agile publishing or sharing.</p>
<p>And, hey, why I am explaining this? <a href="http://video.techsmith.com/jing/latest/demo/introvideo/index.html?keepThis=true&#038;TB_iframe=true&#038;height=440&#038;width=640">There is a video</a> that show it much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2008/03/podcasting-videoblogging-and-social-screencasting-tools-and-ideas/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>A powerful Archive Page for your wordpress blog</title>
		<link>http://www.z-oc.com/blog/2008/02/a-powerful-archive-page-for-your-wordpress-blog/</link>
		<comments>http://www.z-oc.com/blog/2008/02/a-powerful-archive-page-for-your-wordpress-blog/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 20:30:01 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[powerful]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2008/02/a-powerful-archive-page-for-your-wordpress-blog/</guid>
		<description><![CDATA[Tired of that old Archive page that displays the months in which you have posts? Even worse, tired of that bulk on your sidebar? If you come to think of it, it is probably helping your visitors very little, unless they are looking for a specific post and have a rather good idea of when [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of that old Archive page that displays the months in which you have posts? Even worse, tired of that bulk on your sidebar?</p>
<p>If you come to think of it, it is probably helping your visitors very little, unless they are looking for a specific post and have a rather good idea of when it was published. But if they do know that much, they are more likely to use the search box instead.</p>
<p><span id="more-226"></span></p>
<p>I consider that archives <a href="http://www.z-oc.com/blog/2007/10/the-right-amount-of-information-to-make-them-useful/">need the right amount if information to make them useful</a>, not more, not less. And in this case, an archive needs more.</p>
<p>In this post I&#8217;ll show you how to create a separate WordPress page that lists all your posts in reverse chronological order and categorized by month, just like <a href="http://www.z-oc.com/blog/archive/">mine</a>.</p>
<p>This will benefit your blog because you&#8217;ll have a permanent reference for all your posts with name and dates, so users can always refer to it, when looking for a post they seen, or digging your site for more.</p>
<h3>Step 1: Create a new template</h3>
<p>This part is easy, you have to duplicate a file in your theme called page.php and name the copy with a name you like. I&#8217;ll call it powerarchive.php.</p>
<p>Open powerarchive.php and Make sure the file starts with this</p>
<p><code>
<pre>&lt;?php
/*
Template Name: PowerArchive
*/
?&gt;</pre>
<p></code></p>
<p>Technically this is a PHP comment, meaning that it won&#8217;t be seen by the PHP interpreter. In practice, the wordpress applications looks for some special comments to find specific files. In this case, the comment is telling wordpress that the file is a page template and its name is Powerarchive. We are going to use this later, when we publish the archive page.</p>
<h3>Step 2: Hollow the layout</h3>
<p>Now, a tricky part. You must find where is the core-content part of the layout. This changes from theme to theme, but you must look for some signs. For isntance, on my theme, you&#8217;d find something like this</p>
<p><code>
<pre>&lt;div id="content" class="hfeed"&gt;

	&lt;h1 class="entry-title"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php echo __('View').' &quot;'.the_title('', '', false).'&quot;'; ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;

&lt;?php /* more php code */ ?&gt;

   &lt;?php endwhile; endif; ?&gt;

&lt;/div&gt;&lt;!-- content --&gt;
</pre>
<p></code></p>
<p>The &lt;div&gt; opened just before the &lt;h1&gt; and closed just after the end of the loop (&lt;?php endwhile; endif; ?&gt;) is the container we are looking for. Just hollow that div, except for the page title and maybe some other information you might want to keep.</p>
<h3>Step 3: Change the content</h3>
<p>So far, we have managed to have an empty page with a title. So our next step has to be change the way it behaves, and show the archives just after the title we left.</p>
<p>The whole idea is to get all the posts in reverse chronological order (newer first), cycle through them and, as we go, print the month name and year as a header for the set of posts on that month.</p>
<p>The first thing to have in mind is that, as we cycle through the posts, is that we must be able to compare a post and the previous one and see if they are on the same month, because if the month has changed, the header for the month must be displayed.</p>
<p>Let&#8217;s initialize a variable that will hold the date for the post being analyzed and another one for the date of the previous post.</p>
<p><code>
<pre>
  &lt;?php
        $prev_date = NULL;
        $date = NULL;
    ?&gt;
</pre>
<p></code></p>
<p>Then, get all posts in the blog</p>
<p><code>
<pre>
&lt;?php query_posts("posts_per_page=-1&#038;order=DESC"); ?&gt;
</pre>
<p></code></p>
<p>Loop through getting the month and year of each one, as well as setting the date of the current post for the sake of comparing it with the previous one.</p>
<p><code>
<pre>
    &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

    &lt;?php
        $date  = get_the_time('m.Y');
        $year  = get_the_time('Y');
        $month = get_the_time('m');
        $baseUrl = get_bloginfo('url');
</pre>
<p></code></p>
<p>If the current date (containing month and year) is different from the previous one, this is because we have started to list posts from a different month, so we should start by printing the header with a link to the listing of those posts. Don&#8217;t forget to start by opening the list tag for the post titles.</p>
<p><code>
<pre>
        if($date != $prev_date)
        {
            if ($prev_date) echo "&lt;/ul&gt;&#92;n";
            $prev_date = $date;
            echo "&lt;h3&gt;";
            echo "&lt;a href='" . $baseUrl ."/". $year ."/". $month . "'&gt;";
            echo get_the_time('F Y');
            echo "&lt;/a&gt;";
            echo "&lt;/h3&gt;";
            echo "&lt;ul&gt;";
        }
    ?&gt;
</pre>
<p></code></p>
<p>Finally, let&#8217;s print the post date and post title into a list item, close the loop and the list tag</p>
<p><code>
<pre>
    &lt;li&gt;&lt;?php the_time('M d') ?&gt;. &lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title() ?&gt;&lt;/a&gt;&lt;/li&gt;

    &lt;?php endwhile; endif; ?&gt;

    &lt;/ul&gt;
</pre>
<p></code></p>
<p>Here is how the code should look</p>
<p><code>
<pre>
  &lt;?php
        $prev_date = NULL;
        $date = NULL;
    ?&gt;

    &lt;?php query_posts("posts_per_page=-1&#038;order=DESC"); ?&gt;

    &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

    &lt;?php
        $date  = get_the_time('m.Y');
        $year  = get_the_time('Y');
        $month = get_the_time('m');
        $baseUrl = get_bloginfo('url');

        if($date != $prev_date)
        {
            if ($prev_date) echo "&lt;/ul&gt;&#92;n";
            $prev_date = $date;
            echo "&lt;h3&gt;";
            echo "&lt;a href='" . $baseUrl ."/". $year ."/". $month . "'&gt;";
            echo get_the_time('F Y');
            echo "&lt;/a&gt;";
            echo "&lt;/h3&gt;";
            echo "&lt;ul&gt;";
        }
    ?&gt;

    &lt;li&gt;&lt;?php the_time('M d') ?&gt;. &lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title() ?&gt;&lt;/a&gt;&lt;/li&gt;

    &lt;?php endwhile; endif; ?&gt;

    &lt;/ul&gt;
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2008/02/a-powerful-archive-page-for-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>How to manage all your mail in Gmail: Filters, Labels, multiple Id&#8217;s and even Backups</title>
		<link>http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/</link>
		<comments>http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 20:18:30 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/</guid>
		<description><![CDATA[Gmail says &#8220;Search, don&#8217;t Sort&#8221; and by all means this is a good idea and they also tell you not to ever delete a message again, which is interesting, at least for the messages that have any value. But if you do this you probably have copious amounts of email in a single archive and [...]]]></description>
			<content:encoded><![CDATA[<p>Gmail says &#8220;Search, don&#8217;t Sort&#8221; and by all means this is a good idea and they also tell you not to ever delete a message again, which is interesting, at least for the messages that have any value.</p>
<p>But if you do this you probably have copious amounts of email in a single archive and while sorting is not the solution, Labels and Filters can give you a hand with all this.</p>
<p>If you <a href="http://www.z-oc.com/blog/2007/06/manage-all-your-email-accounts-with-gmail/">Manage all your emails accounts in Gmail</a> then for sure you need further help by now to manage you gather-all Gmail account.</p>
<p>In either case, you might find useful to use Labels to organize them as  or need a second Gmail account as .</p>
<p>This post will explain</p>
<ol>
<li><a href="http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#search">Why search is better than sort</a></li>
<li><a href="http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#labels">How to set labels</a></li>
<li><a href="http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#filters">How to use filters</a></li>
<li><a href="http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#filterslabels">How to use Filters to set Labels</a> as suggested by Peter Cruickshank (<a href="http://www.z-oc.com/blog/2007/06/manage-all-your-email-accounts-with-gmail/#comment-532">See comment</a>)</li>
<li><a href="http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#multiple">How to use handle multiple Gmails accounts</a> as suggested by Pramod (<a href="http://www.z-oc.com/blog/2007/06/manage-all-your-email-accounts-with-gmail/#comment-552">see his comment</a>)</li>
<li>As a bonus I even tell you <a href="http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/#backup">how to deal with server backups sent by mail to you</a></li>
</ol>
<p><span id="more-185"></span></p>
<p><a name="search"><br />
<h3>Search don&#8217;t sort</h3>
<p></a></p>
<p><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/search-dont-sort/' rel='attachment wp-att-174' title='Search, Don’t sort'><img class="right" src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/search_dont_sort.png' alt='Search, Don’t sort' /></a>The first thing to keep in mind is that Gmail philosophy is &#8220;Search, don&#8217;t sort&#8221;, meaning that instead of organizing mail in folders as soon as you read it, you could search it afterwards when you need it.</p>
<p>Why searching is better that sorting? I would say it is for three reasons.</p>
<ol>
<li>
<p>The first one is that it is just too hard to know in advance what kind of organizing system you will need in a year time, sometimes even in a month time.</p>
<p>If you have a powerful search system you don&#8217;t need to think of this, you will only worry about it when you need to find that archived email.</p>
</li>
<li>
<p>The second one is that in traditional mail archives you can only sort an email in one folder. You might have a folder &#8220;Funnies&#8221; and a folder &#8220;Mom&#8221;, and you will have to decide either time where to put the funnies your mom sends you.</p>
<p>Also you have to be consistent, because as your archive grows it will be hard to know where that funny your Mom sent you was archived in.</p>
</li>
<li>
<p>The third one is that periodically, as your archive grows, you need to re-sort all your mail. One thing is to have a &#8220;Funnies&#8221; folder with twenty messages, a completely different beast to tame is a &#8220;Funnies&#8221; folder with a thousand messages.</p>
<p>And then when you re-organize your archive the original problem arises, how would you do it? Would you organize it by sender (Funnies-Mom, Funnies-John, Funnies-Paul,&#8230;), by theme&#8230;
</li>
</ol>
<p>Search instead of sorting allows you to refine the granularity of your classification on the very moment you need it and through the criteria just pop in your mind at the moment.</p>
<p>Yes, a good search system is really hard to build! But, hey, that is what Google is famous for being good at, so let&#8217;s trust them and move along.</p>
<p><a name="labels"><br />
<h3>Labels: Just like folders but with search properties</h3>
<p></a></p>
<p><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/labels-list-in-gmail/' rel='attachment wp-att-175' title='Labels List in Gmail'><img  class="left" src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/labels_list.png' alt='Labels List in Gmail' /></a>A label in Gmail is pretty much a predefined search.</p>
<p>You can find a Labels box in the sidebar on the left, in green, just below the &#8220;Quick Contacts&#8221; section.</p>
<p>Say you frequently search for email your Mom sent you, well, you can create a label Mom and tag all email from her with this label. </p>
<div class="right"><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/label-settings/' rel='attachment wp-att-176' title='Label settings'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/label_settings.png' alt='Label settings' /></a></div>
<p>To do this you first create the label by clicking &#8220;Edit labels&#8221; on the bottom of the box. A management interface appears with a form in the bottom that reads &#8220;Create a new label&#8221;. Just fill in the name you want for your label and hit &#8220;Create&#8221;.</p>
<p>To apply label to a particular message, you can select the message(s) either with the checkbox in a list view or just opening the message for reading and select from the upper menu &#8220;More actions&#8230;&#8221; &raquo; &#8220;Apply Label: Mom&#8221;.</p>
<p><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/apply-label-in-gmail/' rel='attachment wp-att-177' title='Apply Label in Gmail'><img class="left" src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/apply_label.png' alt='Apply Label in Gmail' /></a>If later you want to search for messages labeled &#8220;Mom&#8221; just click on the appropriate name in the Labels list on the sidebar.</p>
<p>So far so good! Seems great, but this is not anything better that having folders and is not much different that sorting. Indeed, is not, but stick with me because now things will start to get really interesting.</p>
<p>Say you have another label: &#8220;Funnies&#8221;. Your mom sends you a funny, which label to put? Both!</p>
<p>Now you find that particular mail when you select the &#8220;Mom&#8221; label and also when you select the  &#8220;Funnies&#8221; label.</p>
<p>Now, selecting each label for each message by hand, like this, is a terrible annoyance and it is hard to make an extense use of them. What you can do is to set up some filters to automate this all.</p>
<p><a name="filters"><br />
<h3>Gmail Filters: Automate your decisions</h3>
<p></a></p>
<p>Once you have a clear rule of what has to be done with incoming (and outgoing) email, a filter is a handy way to let Gmail perform the actions for you.</p>
<div><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/filter-list-in-gmail/' rel='attachment wp-att-179' title='Filter list in Gmail'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/filter_list.png' alt='Filter list in Gmail' /></a></div>
<p>In our example, each email you recieve from you &#8220;Mom&#8221; will be tagged with the label Mom. Moreover, all mail sent to your mother will be tagged too.</p>
<div class="right"><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/setting-a-label-filter/' rel='attachment wp-att-180' title='Setting a Label Filter'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/setting_label_filter.png' alt='Setting a Label Filter' /></a></div>
<p>Piece of cake. Go to &#8220;Settings&#8221; on the top-right menu and then select &#8220;Filters&#8221;. On the bottom you&#8217;ll find a link &#8220;Create a new filter&#8221;.</p>
<p>A filter is composed of two parts. In the first one you define the select criteria. That is, which messages the filter will be applied to. In the second part you define what to do with the messages that match the criteria defined in the first part.</p>
<p>In this case, we want to select the messages sent from and to mom@mommail.com, so we need two filters: one for incoming and one for outgoing mail.</p>
<p>[The search criteria for a filter allows you to enter information for the field "from:" and field "to:", but keep in mind that you if you specify both as mom@mommail.com you will only select messages that are both from and to you mom, and not messages that either from or to her. That is why we need two filters.]</p>
<p>On the first filter we put mom@mommail.com on the field &#8220;from:&#8221; and click &#8220;Next step&raquo;&#8221;. On the second part select &#8220;Apply Label&#8221; and select &#8220;Mom&#8221;, then click &#8220;Create Filter&#8221;. Now all incoming mail from you Mom will be automatically tagged.</p>
<p>To tag also the outgoing mail create another filter. Put mom@mommail.com in the &#8220;To:&#8221; filter and then chose &#8220;Apply label: Mom&#8221; on the second step. Done! All email from and to your Mom will be tagged.</p>
<p>Well, this is all nice and cool, but not beyond the basic use of it. Now we mastered Labels and Filters let&#8217;s move to three uses that can really be handy.</p>
<p><a name="filterslabels"><br />
<h3>Label mail if you Manage all your email accounts with Gmail</h3>
<p></a></p>
<p>If you <a href="http://www.z-oc.com/blog/2007/06/manage-all-your-email-accounts-with-gmail/">use Gmail to manage all your email accounts</a> then you have managed to gather all your mail to a very handy and powerful interface. Now you might want to classify your incoming mail depending on where it was originally sent to.</p>
<p>For each account create a label with an appropriate name, something like &#8220;myoriginalmail@myserver.com&#8221; should be good enough.</p>
<p>Then, for each acount create two filters. One for incoming and one for outgoing mail.</p>
<p>For incoming mail, in the first part use your original email address (myoriginalmail@oldserver.com) on the &#8220;To:&#8221; field. On the second part, select the appropriate label.</p>
<p>For outgoing mail, in the first part use your original email address (myoriginalmail@oldserver.com) on the &#8220;From:&#8221; field. On the second part, select the appropriate label (remember that <a href="http://www.z-oc.com/blog/2007/06/manage-all-your-email-accounts-with-gmail/">you can select which email identity to use</a> when writing an email).</p>
<p>Now, every message received or sent is labeled accordingly depending of the specific account it was used.</p>
<p><a name="multiple"><br />
<h3>Sending email to different Gmail Accounts</h3>
<p></a></p>
<p>Some people like to have more than one Gmail account, or sometimes they need to.</p>
<p>In my opinion having two email accounts is a great hassle and is better to avoid when possible, that is why I manage all my email on one account in the first place, but, if you need to have more than one, it is better to organize well.</p>
<p>As far as I can see, with all the organizational resources we have discussed here, the only reason to have multiple Gmail accounts is lack of space. If a second (or third, or fourth&#8230;) account is needed to store your mail I would chose between two policies.</p>
<ul>
<li>Use a Gmail account until it fills, then move to another</li>
<li>Use different Gmail accounts different uses (ie, work, personal, blog)</li>
</ul>
<p>In my opinion, a nice solution is:</p>
<ol>
<li>Send all your mail to a main Gmail account</li>
<li>Set up filters to redirect selected mail to other accounts</li>
</ol>
<p>If you are filling one account at a time and moving to another, the solution is fairy simple, you just have to set a forward rule, that is an especial kind of filter even easier to configure.</p>
<p><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/forwarding-mail/' rel='attachment wp-att-183' title='Forwarding mail'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/forwarding_mail.png' alt='Forwarding mail' /></a></p>
<p>A main account is a good idea even if you are filling one account at a time, because that is the only place you ever need to reconfigure as your needs grow. You can send all your mail to this account and give this address to friends, even if you check your mail through another account.</p>
<ol>
<li>Go to Settings &raquo; &#8220;Forwarding and POP&#8221; &raquo; Forward</li>
<li>Check the option to forward email</li>
<li>Fill in the email you want your email redirected to</li>
<li>Select &#8220;Delete Gmail&#8217;s copy&#8221; From the drop down menu.</li>
<li>Save Changes</li>
</ol>
<p>One day your secondary account will be full. Go to Go to :Settings &raquo; Forwarding and POP &raquo; Forward&#8221; and edit your filter so mail is forwarded to a third account you should have.</p>
<p>If instead, you are forwarding mail according to some criteria you can set a specific filter for redirecting mail to specific accounts.</p>
<p>To make it simple, let&#8217;s say have 3 different Gmail accounts for different purposes:</p>
<dl>
<dt>One for work</dt>
<dd>All mail that comes from domains myworkdomain.com is considered work and goes to myworkemail@gmail.com</dd>
<dt>One for your blog</dt>
<dd>Yes, you have a blog and all email the server sends to you has the string [myblog] on the subject. For instance &#8220;[myblog] Please moderate post X&#8221;. All mail from your blog should go to myblogemail@gmail.com</dt>
<dt>One for all the rest</dt>
<dd>Finally, you have an email for all the rest and in this case it is just easier to use the main account for that.</dd>
</dl>
<p>So, we need to set up two filters to handle this.</p>
<p>For the first one, we must filter all the email coming from work.</p>
<ol>
<li>Go to Settings &raquo; Filters &raquo; &#8220;Create a new filter&#8221;</li>
<li>Put &#8220;*@myworkdomain.com&#8221; on the &#8220;From:&#8221; field and press &#8220;Next&raquo;&#8221; (The asterisk means &#8220;all&#8221;)</li>
<li>Check &#8220;Forward it to:&#8221; and put the email address on the form (myworkemail@gmail.com in the example)</li>
<li>Check also &#8220;Delete it&#8221; so it doesn&#8217;t remain on your original mailbox.</li>
<li>Create Filter</li>
</ol>
<p>For the second one, we must filter all email coming from your blog</p>
<ol>
<li>Go to Settings &raquo; Filters &raquo; &#8220;Create a new filter&#8221;</li>
<li>Put &#8220;[myblog]&#8221; on the &#8220;subject&#8221; field and press &#8220;Next&raquo;&#8221;</li>
<li>Check &#8220;Forward it to:&#8221; and put the email address on the form (myblogemail@gmail.com in the example)</li>
<li>Check also &#8220;Delete it&#8221; so it doesn&#8217;t remain on your original mailbox.</li>
<li>Create Filter</li>
</ol>
<p>You can also <a href="http://www.z-oc.com/blog/2007/06/manage-all-your-email-accounts-with-gmail/#step3">set up your secondary emails to send email as your original identity</a></p>
<p><a name="backup"><br />
<h3>Receiving backup files from your server</h3>
<p></a></p>
<p>As a last example here, I will describe how I manage the backup from my blog.</p>
<p>Once <del datetime="2008-02-20T08:28:17+00:00">a day</del> an hour, z-oc.com emails me a backup of the database using <a href="http://www.ilfilosofo.com/blog/wp-db-backup">this plugin</a>. I like this policy because if anything happens to the site, no matter how serious, I have a complete database backup outside the site, and no better place for this than my Gmail.</p>
<p>The email comes always with a very specific Subject and Text and also has an attachment, so it is easy to make a filter for it.</p>
<p>As I first idea I might want to apply a label &#8220;Database Backup&#8221; to all those messages. Also I never have to even look at these messages unless something happens to the site, so I can also archive then by default.</p>
<p>Even if something happens with the site, I only need the last one, so I can go to &#8220;All Mail&#8221; and retrieve the last one.</p>
<p>This filter will work well but still you would have to periodically select all messages labeled &#8220;Database backup&#8221; and delete all but the last, but there is a better solution.</p>
<p><a href='http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/daily-database-backup-in-the-trash/' rel='attachment wp-att-182' title='Daily database backup in the trash'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/10/database_backup.png' alt='Daily database backup in the trash' /></a></p>
<p>All email deleted in Gmail goes to the trash bin and remains there for a month before it is automatically deleted forever. So, why not send the backup straight to the trash by applying a &#8220;Delete it&#8221; rule to the filter?</p>
<p>If nothing happens, gmail will receive a daily backup, keep it for you for 30 days and then discard it automatically. If something happens to your site you have 30 days to go to your Trash folder and get the last one. Just remember not to empty the Trash by hand, or at least remember not to exclude the last backup, just in case your site crashes that very day.</p>
<p>And you? What kind of use do make of Filters and Labels in Gmail?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2007/10/how-to-manage-all-your-mail-in-gmail-filters-labels-multiple-ids-and-even-backups/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Compact digital cameras Vs. DSLR</title>
		<link>http://www.z-oc.com/blog/2007/08/compact-digital-cameras-vs-dslr/</link>
		<comments>http://www.z-oc.com/blog/2007/08/compact-digital-cameras-vs-dslr/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 04:38:02 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2007/08/compact-digital-cameras-vs-dslr/</guid>
		<description><![CDATA[This is the 6th and final part of a tutorial about photography basics. So far we&#8217;ve seen Some physics background related to photography The pinhole camera and the basics of camera building The lenses: Zoom, Focus and Aperture The ISO value: Films and CCD sensors Mastering the Shutter speed Finally, we have seen all the [...]]]></description>
			<content:encoded><![CDATA[<p>This is the 6th and final part of a tutorial about photography basics. So far we&#8217;ve seen</p>
<ul>
<li><a href="http://www.z-oc.com/blog/2007/08/some-physics-background-related-to-photography/">Some physics background related to photography</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/the-pinhole-camera-and-the-basics-of-camera-building/">The pinhole camera and the basics of camera building</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/the-lenses-zoom-focus-and-aperture/">The lenses: Zoom, Focus and Aperture</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/the-iso-value-films-and-ccd-sensors/">The ISO value: Films and CCD sensors</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/mastering-the-shutter-speed/">Mastering the Shutter speed</a></li>
</ul>
<p>Finally, we have seen all the necessary elements to build a camera. The black box, the lens, and the shutter.</p>
<p>Traditionally, there were two kinds of film cameras. Cameras with Direct Viewfinder and SLR (Sinlge Lens Reflex, or just Reflex) cameras.</p>
<p><span id="more-127"></span></p>
<p>Direct Viewfinder cameras have and eyepiece that allow to look at the scene to be photographed and the lens that captured the image to be projected on the film to make the picture.</p>
<p>This camera is very simple to make, but brings up a problem. Because the scene you see and the scene you shot are slightly displaced the picture might not be what you expect, heads sometimes are chopped off the picture, and things like that.</p>
<p>This problem is called Paralax Error, and becomes more of a trouble as the the object photographed is closer to the camera. For landscape photography might even be no problem at all, but for close ups is a huge deal.</p>
<div class="left"><a href='http://www.z-oc.com/blog/wp-content/uploads/2007/07/slr-diagram.png' title='SLR cameras diagram'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/07/slr-diagram.thumbnail.png' alt='SLR cameras diagram' /></a><br />SRL camera internal diagram</div>
<p>SLR cameras work in a very different way. The image you see on the viewfinder is the same that will be photographed. This is accomplished by reflecting the light inside the camera with a mirror and a pentaprism.</p>
<p>Do you remember refraction we talked about on the first post? When a light passes from a medium with higher refractive index to one with a lower one the refracted angle is wider than the incident angle.</p>
<p>Well, when the incident angle is wide enough the refraction angle will be 90 degrees, and what if the angle is even wider? Then an effect called <a href="http://en.wikipedia.org/w iki/Total_internal_reflection">Total Internal Refraction</a> in which the surface behaves like a mirror. This is also how to <a href="http://en.wikipedia.org/wiki/Optical_fiber">Optical Fiber</a> works.</p>
<div class="left"><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/08/totalinternalrefraction.png' alt='Total Internal Refraction' /><br />Total Internal Refraction</div>
<p>A pentaprism is a pentagon extruded on the third dimension. Just like a cilinder but with a pentagonal base, instead of a circular one.</p>
<p>If a pentaprism is made with an adequate geometry and refractive index, it is possible to make light to enter it perpendicular to one face, reflect internally and leave it perpendicular to another face.</p>
<p>Then, the light enters the camera through the lens, reflects on a mirror put at 45 degrees, and enters the pentaprism perpendicularly (see the image for details).</p>
<p>When the shutter is pressed, the mirror is lifted, the curtain behind it is opened and the image is formed either on the film or the CCD.</p>
<p>Now a question, where is the image formed when the mirror is down? It can&#8217;t be directly on our eyes, mostly because the image must be formed at a certain distance that is the focal length, and would be very hard to make this to be our retina.</p>
<p>Actually the bottom face of the pentaprism is what is called Unpolished Glass. That means that is a rough, translucent surface, just like the translucent paper we used on the black box model. Because the surface is rough the image forms on it, but because it is translucent the light goes through, then looking from behind, through the pentaprism one can see the image formed on it.</p>
<p>All this is very nice, precise and sophisticated, but is not all rainbows. A camera like this is heavier, more expensive, more noisy and inherently more fragile because there are more things that can break.</p>
<p>Modern digital cameras are also categorized in compact cameras and Digital SLRs (known as DSLRs). While some compact digital cameras still have Direct Viewfinders, they can also use the sensor to capture the image and show it on a digital viewfinder that is not only more comfortable, but also don&#8217;t have paralax error. Because most people prefer use this digital viewfinder, more and more, digital compact cameras are coming without the direct viewfinder.</p>
<p>A DSLR camera works exactly like the traditional SLR film cameras, except they have a CCD instead on film. Because the sensor is exposed only at the very moment of taking the picture, there is no way for it to continuosly display the image on the LCD viewfinder, you have to use the eyepiece and.</p>
<p>A compact digital camera&#8217;s sensor is continuously exposed to the light that comes from the lens. When taking a picture, it just saves one of the many frames that it is continuously receiving. This is very handy, but by far is not as precise as the mechanical scheme of a SLR that can achieve speeds of 1/8000 of a second and faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2007/08/compact-digital-cameras-vs-dslr/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mastering the Shutter speed</title>
		<link>http://www.z-oc.com/blog/2007/08/mastering-the-shutter-speed/</link>
		<comments>http://www.z-oc.com/blog/2007/08/mastering-the-shutter-speed/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 08:38:00 +0000</pubDate>
		<dc:creator>guioconnor</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.z-oc.com/blog/2007/08/mastering-the-shutter-speed/</guid>
		<description><![CDATA[This is the 5th part of a six-part tutorial about photography basics. So far we&#8217;ve seen Some physics background related to photography The pinhole camera and the basics of camera building The lenses: Zoom, Focus and Aperture The ISO value: Films and CCD sensors By now, we have seen that, by changing the ISO value [...]]]></description>
			<content:encoded><![CDATA[<p>This is the 5th part of a six-part tutorial about photography basics. So far we&#8217;ve seen</p>
<ul>
<li><a href="http://www.z-oc.com/blog/2007/08/some-physics-background-related-to-photography/">Some physics background related to photography</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/the-pinhole-camera-and-the-basics-of-camera-building/">The pinhole camera and the basics of camera building</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/the-lenses-zoom-focus-and-aperture/">The lenses: Zoom, Focus and Aperture</a></li>
<li><a href="http://www.z-oc.com/blog/2007/08/the-iso-value-films-and-ccd-sensors/">The ISO value: Films and CCD sensors</a></li>
</ul>
<p>By now, we have seen that, by changing the ISO value we can change the amount of light needed for a picture, in exchange for quality. We have also seen that, by changing the aperture value, we can change the amount of light actually entering the camera, in exchange for bigger and smaller depth of field.</p>
<p>But increasing the Aperture value is not the only way to increase the amount of light in a picture.</p>
<p><span id="more-126"></span></p>
<p>In a film camera, you need light to make the silver halides react, hence a clear solution would be just to increase the time the film is exposed. The more time the film is exposed, the more light it gets, the more it reacts, even with few light.</p>
<p>Curiously, this is another similarity on digital photography. The more a sensor is exposed, the more light the photo sensors accumulate and the brighter the picture becomes.</p>
<p>You might want to close the aperture to get more sharp pictures and you can compensate this by increasing exposure time, if you have a tripod and a still subject you can take a very slow picture with bad lighting conditions and closed aperture and the picture might look great.</p>
<p>The rule is simple. Camera apertures are measured in f/ stops. Each f/ stop multiplies or divides the amount for a certain factor. To compensate, divide or multiply the exposure by the same factor.</p>
<p>If you half the aperture you must double your exposure time. Simple as that. Most modern cameras can handle this by themselves, and even if yours don&#8217;t you don&#8217;t have to do the math all the time, the camera photometer will do this for you and signal when light is Ok.</p>
<div class="right" style="width:300px"><a href='http://www.z-oc.com/blog/wp-content/uploads/2007/08/shutter_speed_90.jpg' title='Picture at speed 1/90'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/08/shutter_speed_90_t.jpg' alt='Smaller version of picture at 1/90' /></a><a href='http://www.z-oc.com/blog/wp-content/uploads/2007/08/shutter_speed_5001.jpg' title='Picture at speed 1/500'><img src='http://www.z-oc.com/blog/wp-content/uploads/2007/08/shutter_speed_500_t.jpg' alt='Smaller version of picture at 1/500' /></a><br />Pictures taken with speeds of 1/90 and 1/500 of a second. The water in the slowest picture is blurred while in the fastest is sharper. Regard that the slowest picture had a closer aperture and hence a deeper depth of field. You can see the background is sharper in the slowest.</div>
<p>Altering the shutter speed has a trade-off, of course.</p>
<p>What happens in a long exposition is that the sensor collects more light to analize and create the image, but the problem is that this light has to be the same. If the intensity or color change during the exposure the results won&#8217;t be accurate.</p>
<p>Typically, if either the camera shakes or the subject moves, the light reaching the sensor will change and will interfere.</p>
<p>If a single pixel on the sensor receive light information from different sources, then multiple images will impress the same region and the same object will be imprinted on many regions of the sensor, as a result the image will be blurred.</p>
<p>Now, there are at least two ways you can take blur to your advantage. One is when part of the picture is in motion and you want this part to be blurred while the rest is sharp, one common use for this is with running water.</p>
<p><a href="http://www.flickr.com/photos/guioconnor/1141095014/" title="Photo Sharing"><img  class="right" src="http://farm2.static.flickr.com/1032/1141095014_9155ebdd2a_m.jpg" width="240" height="166" alt="Riding in Piazza Fiera" /></a><br />
The second one is called <em>panning</em> and consist in photographing a moving subject by following with the camera while it moves, by doing this, the background will have a motion blur and the main subject will be focused. This is, of course, much difficult that the first one and requires some more experimentation.</p>
<p>In case you wonder how would that be o film, it is the exact same, but is the silver halide instead of the sensor pixel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z-oc.com/blog/2007/08/mastering-the-shutter-speed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

