<?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>BigSmoke &#187; WWW</title>
	<atom:link href="http://blog.bigsmoke.us/tag/www/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.bigsmoke.us</link>
	<description>Smokes your problems, coughs fresh air.</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:03:39 +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>10 Tips for Budding Web Programmers and Designers</title>
		<link>http://blog.bigsmoke.us/2010/06/23/10-tips-for-budding-web-programmers-and-designers</link>
		<comments>http://blog.bigsmoke.us/2010/06/23/10-tips-for-budding-web-programmers-and-designers#comments</comments>
		<pubDate>Wed, 23 Jun 2010 20:40:33 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1193</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://chrysbader.com/10-tips-for-budding-web-programmers-and-desig">Some things</a> that every new web developer should know.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2010/06/23/10-tips-for-budding-web-programmers-and-designers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modern self-hosted, open-source web statistics software</title>
		<link>http://blog.bigsmoke.us/2009/10/23/modern-self-hosted-open-source-web-statistics-software</link>
		<comments>http://blog.bigsmoke.us/2009/10/23/modern-self-hosted-open-source-web-statistics-software#comments</comments>
		<pubDate>Fri, 23 Oct 2009 14:46:50 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=863</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.google.com/analytics/">Google Analytics</a> for most of my websites for quite some time. Philosophically, I&#8217;d prefer a self-hosted solution though. In the past I&#8217;ve used Webalizer and I still use awstats for <a href="http://www.bigsmoke.us/">my ad-hoc, static website</a>, but these programs are a bit primitive and limited compared to Analytics.</p>

<p>Of the newer programs that I&#8217;ve been looking into <a href="http://piwik.org/">Piwik</a> looks the most promising to me, but there&#8217;s also <a href="http://obsessive.sourceforge.net/">Obsessive Website Statistics</a> which looks pretty reasonable. <a href="http://www.w3perl.com/">W3Perl</a> looks pretty, but seems rather spartan.</p>

<div id="attachment_865" class="wp-caption alignnone" style="width: 632px"><img src="http://blog.bigsmoke.us/uploads/2009/10/piwik-e280ba-web-analytics-reports7.png" alt="An example of Piwik in action" title="Piwik example screenshot" width="622" height="367" class="size-full wp-image-865" /><p class="wp-caption-text">An example of Piwik in action</p></div>

<p>One of the things that has made me a bit shy of Google Analytics is its reliance on JavaScript, a dependence that means that I can&#8217;t gather statistics about robots or other user agents lacking JavaScript support. On the other hand, this method lets you gather much more data for the clients that <em>do</em> support JavaScript. Piwik depends on JavaScript in the same way as Google Analytics does. This can be seen as either an advantage or a disadvantage depending on your view on this issue.</p>

<p>I&#8217;d have to install Piwik to determine my view…</p>

]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2009/10/23/modern-self-hosted-open-source-web-statistics-software/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>www.stichting-ecosafe.org</title>
		<link>http://blog.bigsmoke.us/2009/09/16/www.stichting-ecosafe.org</link>
		<comments>http://blog.bigsmoke.us/2009/09/16/www.stichting-ecosafe.org#comments</comments>
		<pubDate>Wed, 16 Sep 2009 10:19:56 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[406]]></category>
		<category><![CDATA[AHAH]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mod_include]]></category>
		<category><![CDATA[mod_negotiation]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[www.stichting-ecosafe.org]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=683</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Stichting EcoSafe is a Dutch foundation for the safe-keeping of the funds that are necessary for the maintenance of hardwood plantations. In July of 2006, together with Johan Ockels, I created a website for the Foundation. Johan was responsible for the organization of the whole process. This went very smooth and the website ended up being an emblem of simplicity and clarity. That&#8217;s why I wanted to blog a bit about it now, even though there are a few things that I&#8217;d probably end up doing different if I were to start from scratch. [There's actually a disturbing number of things for which this is true, I'm coming to notice.]</p>

<table class="invisible" style="border: none;"><tr><td valign="top">
<div id="attachment_708" class="wp-caption alignnone" style="width: 310px"><a rel="lightbox-screen" href="http://blog.bigsmoke.us/uploads/2009/07/ecosafe-index-en.png"><img src="http://blog.bigsmoke.us/uploads/2009/07/ecosafe-index-en-300x206.png" alt="The Welcome page of the EcoSafe website" title="www.stichting-ecosafe.org/index.en" width="300" height="206" class="size-medium wp-image-708" /></a><p class="wp-caption-text">The Welcome page of the EcoSafe website</p></div>
</td><td valign="top">
<div id="attachment_794" class="wp-caption alignnone" style="width: 310px"><a rel="lightbox-screen" href="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-plantations-en.png"><img src="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-plantations-en-300x206.png" alt="EcoSafe page for plantations" title="www.stichting-ecosafe.org/plantations.en" width="300" height="206" class="size-medium wp-image-794" /></a><p class="wp-caption-text">EcoSafe page for plantations</p></div>
</td><td valign="top">
<div id="attachment_810" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-cost-structure-en.png"><img src="http://blog.bigsmoke.us/wp-factory/../uploads/2009/09/ecosafe-cost-structure-en-300x205.png" alt="EcoSafe cost structure" title="www.stichting-ecosafe.org/cost-structure.en" width="300" height="205" class="size-medium wp-image-810" /></a><p class="wp-caption-text">EcoSafe cost structure</p></div>
</td></tr></table>

<h2 id="file-structure">File structure</h2>

<p>Like with most websites, I started with creating an SVN repo so that I wouldn&#8217;t have to be afraid of ever losing anything.</p>

<p>The file structure was pretty standard:</p>

<ul>
<li>a <tt>css</tt> dir for stylesheets;</li>
<li><tt>img</tt> for images;</li>
<li><tt>inc</tt> for shared PHP and mod_include stuff and for AJAX partials;</li>
<li><tt>jot</tt> for to-do&#8217;s and other notes;</li>
<li>and <tt>js</tt> for JavaScript files and libraries.</li>
</ul>

<h3>Possible file structure improvements</h3>

<p>If I were to redesign this file structure, I&#8217;d collapse <tt>css</tt>, <tt>img</tt> and <tt>js</tt> into one directory called <tt>layout</tt>, because these are typically things that require the same <tt>robots.txt</tt> and caching policy. Also, it is meaningless to organize things by file extension. If you want to sort something by file extension, use <q><tt>ls -X</tt></q> (or <q><tt>ls --sort=extension</tt></q> if you&#8217;re on GNU).</p>


<h2 id="ssi">Server-side includes</h2>

<p>The site would be so simple that I felt that any type of CMS or content transformation would be completely unnecessary. Instead, I decided to rely on Apache&#8217;s <a href="http://httpd.apache.org/docs/1.3/mod/mod_include.html">mod_include</a> and just use a few partials for repeating page elements such as the left sidebar containing the logo and the menu.</p>

<p>Also, because I didn&#8217;t need to transform the HTML files, I decided I could use good ol&#8217; HTML 4 instead of XHTML 1 (which I&#8217;d have to send to the browser with the wrong mime-type anyway).</p>

<p>This is the HTML for <tt>contact.nl.shtml</tt>:</p>

<pre class="php">&lt;!DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD HTML 4.01//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/html4/loose.dtd&quot;</span>&gt;
&nbsp;
&lt;html lang=<span style="color: #ff0000;">&quot;en&quot;</span>&gt;
  &lt;head&gt;
    &lt;title&gt;Contact EcoSafe&lt;/title&gt;
&nbsp;
    &lt;meta http-equiv=<span style="color: #ff0000;">&quot;Content-Type&quot;</span> content=<span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> /&gt;
&nbsp;
    &lt;link rel=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> type=<span style="color: #ff0000;">&quot;text/css&quot;</span> href=<span style="color: #ff0000;">&quot;/css/style.css&quot;</span>&gt;&lt;/link&gt;
  &lt;/head&gt;
&nbsp;
  &lt;body&gt;
    &lt;!--<span style="color: #808080; font-style: italic;">#include virtual=&quot;/inc/left-side.en.html&quot;--&gt;</span>
&nbsp;
    &lt;!--<span style="color: #808080; font-style: italic;">#include virtual=&quot;/inc/alt-lang.phtml&quot;--&gt;</span>
&nbsp;
    &lt;div id=<span style="color: #ff0000;">&quot;content&quot;</span>&gt;
      &lt;h1&gt;Contact&lt;/h1&gt;
&nbsp;
      &lt;p&gt;Your email to EcoSafe kan be sent to the following address:
      &lt;a href=<span style="color: #ff0000;">&quot;mailto:service@stichting-ecosafe.org&quot;</span>&gt;service@stichting-ecosafe.org&lt;/a&gt;.
      Or, alternatively, you can fax us at <span style="color: #cc66cc;">+31</span> <span style="color: #cc66cc;">50</span> - <span style="color: #cc66cc;">309</span> <span style="color: #cc66cc;">66</span> <span style="color: #cc66cc;">58</span>.&lt;/p&gt;
&nbsp;
      &lt;h2&gt;About this website&lt;/h2&gt;
&nbsp;
      &lt;p&gt;For comments and/or suggestions concerning this website,
      you can direct an email message at:
      &lt;a href=<span style="color: #ff0000;">&quot;mailto:webmaster@stichting-ecosafe.org&quot;</span>&gt;webmaster@stichting-ecosafe.org&lt;/a&gt;.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>

<div id="attachment_788" class="wp-caption alignright" style="width: 197px"><img src="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-alt-language.png" alt="Alternative language selection" title="www.stichting-ecosafe.org alternative language selection" width="187" height="38" class="size-full wp-image-788" /><p class="wp-caption-text">Alternative language selection</p></div>

<p>I use <tt>&lt;!--#include virtual--&gt;</tt> to include the repeating parts. <tt>&lt;!--#include virtual--&gt;</tt> has several advantages over <tt>&lt;!--#include file--&gt;</tt> in that it allows for content-negotiation, execution of dynamic content etc., but here the only place were it holds an advantage is in the inclusion of <tt>/inc/alt-lang.phtml</tt>. <tt>alt-lang.phtml</tt> is a messy PHP script that figures out which language variants of a page are available and displays a selection of alternative language versions (variants with a language different from the current).</p>

<h3>SSI and caching</h3>

<p>Without the <A href="http://httpd.apache.org/docs/1.3/mod/mod_include.html#xbithack">XBitHack directive</a> set to <tt>full</tt>, all content handled by <tt>mod_include</tt> is sent without a <tt>Last-Modified</tt> header. However, I don&#8217;t want to use <tt>XBitHack</tt> at all, because I don&#8217;t want just any executable file to be handled by <tt>mod_include</tt>; that just too much of a … hack.</p>

<p>If I were to do something similar now, I&#8217;d use some kind of (sed) substitution to pre-process the includes locally so that more of what I end up uploading is simple static content. The dynamic part of the included PHP script, I would simply replace with JavaScript.</p>

<h2 id="visual">Visual design</h2>

<p>As you can see in the HTML example, there&#8217;s hardly anything layout oriented in the HTML source. This is good, and means that I have to touch only the CSS for most minor and major lay-out modifications. (It is a pipe-dream to think that you only need to change the CSS to make the same HTML page look however you want as long as that HTML is rich enough in meaning, but for a site with pages of such simple structure, it&#8217;s a dream that comes pretty close to reality.)</p>

<p>I&#8217;m not much of a designer, but I think design is overrated anyway. Actually, I think that most website suffer from too much design.</p>

<div id="attachment_692" class="wp-caption alignright" style="width: 275px"><img src="http://blog.bigsmoke.us/uploads/2009/07/ecosafe-logo.jpg" alt="The EcoSafe logo" title="EcoSafe logo" width="265" height="217" class="size-full wp-image-692" /><p class="wp-caption-text">The EcoSafe logo</p></div>

<p>To start the design, I got a logo made by <a href="http://wiki.hardwood-investments.net/Huite_Zijlstra">Huite Zijlstra</a>. Because the logo was pretty big and didn&#8217;t look good scaled down, I decided to put it at the left of the content area instead of at the top. This would still leave enough room for the menu (which actually takes less space horizontally than the logo).</p>

<h3 id="colors">Colors</h3>

<p>For the color scheme, I just picked a few colors from the logo. As always, the base of the scheme would be black text on a white background for maximum readability. The print version hardly uses any colors.</p>

<pre class="css"><span style="color: #a1a100;">@media screen {</span>
body            <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span>: <span style="color: #993333;">white</span>;  <span style="color: #66cc66;">&#125;</span>
*               <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #000000; font-weight: bold;">black</span>;             <span style="color: #66cc66;">&#125;</span>
a<span style="color: #3333ff;">:link </span>         <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: #<span style="color: #cc66cc;">585</span>;              <span style="color: #66cc66;">&#125;</span>
h1              <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: #<span style="color: #cc66cc;">880</span>;              <span style="color: #66cc66;">&#125;</span>
h2              <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: #<span style="color: #cc66cc;">888</span>;              <span style="color: #66cc66;">&#125;</span>
strong          <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: #a62;              <span style="color: #66cc66;">&#125;</span>
#menu li a      <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span>: #<span style="color: #cc66cc;">660</span>;              <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>

<h3 id="underlines">Underlines</h3>

<p>I wanted an underline below the level 1 and 2 headings. Because I didn&#8217;t like the effect of <tt>text-decoration:underline</tt> (too thick for <tt>&lt;h2&gt;</tt>s, too dark for <tt>&lt;h1&gt;</tt>s and different from browser to browser) and because <tt>border-bottom</tt> was set too far from the text, I made two simple PNG images that I could <tt>repeat-x</tt> along the bottom edge.</p>

<pre class="css"><span style="color: #a1a100;">@media screen {</span>
h1 <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/img/h1-border-bottom.png'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">repeat-x</span>; <span style="color: #66cc66;">&#125;</span>
h2 <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/img/hx-border-bottom.png'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">repeat-x</span>; <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>

<h3 id="menu">Menu</h3>

<p>The menu is very simple. The markup is part of <tt>inc/left-side.en.html</tt> for the English version and <tt>inc/left-side.nl.html</tt> for the Dutch version:</p>

<pre class="bash">cat inc/left-side.en.html</pre>
<pre class="php">&lt;div id=<span style="color: #ff0000;">&quot;left&quot;</span> lang=<span style="color: #ff0000;">&quot;en&quot;</span>&gt;
  &lt;a <span style="color: #000000; font-weight: bold;">class</span>=<span style="color: #ff0000;">&quot;logo&quot;</span> href=<span style="color: #ff0000;">&quot;/index.en&quot;</span>&gt;&lt;img <span style="color: #000000; font-weight: bold;">class</span>=<span style="color: #ff0000;">&quot;logo&quot;</span> alt=<span style="color: #ff0000;">&quot;[Logo]&quot;</span> src=<span style="color: #ff0000;">&quot;/img/logo.jpg&quot;</span>&gt;&lt;/img&gt;&lt;/a&gt;
&nbsp;
  &lt;ul id=<span style="color: #ff0000;">&quot;menu&quot;</span> <span style="color: #000000; font-weight: bold;">class</span>=<span style="color: #ff0000;">&quot;menu&quot;</span>&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/index.en&quot;</span> rel=<span style="color: #ff0000;">&quot;start&quot;</span>&gt;Start page&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/plantations.en&quot;</span>&gt;For plantations&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/investors.en&quot;</span>&gt;For investors&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/history.en&quot;</span>&gt;History&lt;/a&gt;&lt;/li&gt;
    &lt;!--&lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/goals&quot;</span>&gt;Goals&lt;/a&gt;&lt;/li&gt;--&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/methods.en&quot;</span>&gt;How it works&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/cost-structure.en&quot;</span>&gt;Cost structure&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/cost-calculator.en&quot;</span>&gt;Cost calculator&lt;/a&gt;&lt;/li&gt;
    &lt;!--&lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/clients.en&quot;</span>&gt;Clients&lt;/a&gt;&lt;/li&gt;--&gt;
    &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;/contact.en&quot;</span>&gt;Contact&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&nbsp;
&lt;script type=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> src=<span style="color: #ff0000;">&quot;/js/menu.js&quot;</span>&gt;&lt;/script&gt;</pre>

<div id="attachment_710" class="wp-caption alignright" style="width: 270px"><img src="http://blog.bigsmoke.us/uploads/2009/07/ecosafe-menu-en.png" alt="The EcoSafe menu (in English)" title="EcoSafe menu EN" width="260" height="438" class="size-full wp-image-710" /><p class="wp-caption-text">The EcoSafe menu (in English)</p></div>

<p>As is customary, I started by removing all the default list styles and made the anchors behave as block-level elements. I used the big O from the logo for bullets in the list (using <tt>background-image</tt> instead of <tt>list-style-image</tt> because the latter gives unpredictable cross-browser results and doesn&#8217;t make the bullet clickable).</p>

<pre class="css"><span style="color: #cc00cc;">#menu <span style="color: #66cc66;">&#123;</span></span>
  <span style="color: #000000; font-weight: bold;">margin-top</span>: 2em;
  <span style="color: #000000; font-weight: bold;">margin-left</span>: 2em;
  <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">none</span>;
  <span style="color: #000000; font-weight: bold;">padding</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
#menu li <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
#menu li a <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">block</span>;
  <span style="color: #000000; font-weight: bold;">background-image</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/img/o-21x16.png'</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">background-position</span>: <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span>;
  <span style="color: #000000; font-weight: bold;">background-repeat</span>: <span style="color: #993333;">no-repeat</span>;
  <span style="color: #000000; font-weight: bold;">padding-left</span>: 30px;
  <span style="color: #000000; font-weight: bold;">text-decoration</span>: <span style="color: #993333;">none</span>;
  <span style="color: #000000; font-weight: bold;">font-family</span>: <span style="color: #993333;">sans-serif</span>;
  <span style="color: #000000; font-weight: bold;">font-weight</span>: <span style="color: #993333;">bold</span>;
  <span style="color: #000000; font-weight: bold;">color</span>: #<span style="color: #cc66cc;">660</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
#menu li a:hover,
#menu li<span style="color: #6666ff;">.active </span>a <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-image</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/img/oSafe-21x16.png'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
#menu a<span style="color: #3333ff;">:hover </span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span>: #<span style="color: #cc66cc;">787800</span>;
<span style="color: #66cc66;">&#125;</span></pre>

<h4>JavaScript menu item activation</h4>

<p>To add the <tt>active</tt> class to the currently active list item (<tt>&lt;li&gt;</tt>), I used a client-side solution using JavaScript. After all, it&#8217;s proper use of JavaScript to enhance your user interface with it (as long as, as many would say, it isn&#8217;t <em>required</em> for the UI to function (as it is in the Cost Calculator)).</p>

<pre class="javascript"><span style="color: #009900; font-style: italic;">// menu.js</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> menu = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'menu'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> anchors = menu.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> locationHref = window.<span style="color: #006600;">location</span>.<span style="color: #006600;">pathname</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>i = anchors.<span style="color: #006600;">length</span> - <span style="color: #CC0000;">1</span>; i &gt;= <span style="color: #CC0000;">0</span>; i--<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  a = anchors<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;
  aHref = a.<span style="color: #006600;">href</span>;
    
  <span style="color: #009900; font-style: italic;">// Does this menu item link to the current page?</span>
  <span style="color: #009900; font-style: italic;">// We find out by looking if the window location contains the URL in the anchor</span>
  <span style="color: #009900; font-style: italic;">// or the other way arround. The reason to look at both is content-negotiation.</span>
  <span style="color: #009900; font-style: italic;">// It's also true if the location is just '/' and we're looking at the anchor of</span>
  <span style="color: #009900; font-style: italic;">// the 'start' page.</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span>locationHref === <span style="color: #3366CC;">'/'</span> &amp;&amp; a.<span style="color: #006600;">rel</span> === <span style="color: #3366CC;">'start'</span><span style="color: #66cc66;">&#41;</span> ||
       <span style="color: #66cc66;">&#40;</span>locationHref !== <span style="color: #3366CC;">'/'</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span> locationHref.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span>aHref<span style="color: #66cc66;">&#41;</span> !== <span style="color: #CC0000;">-1</span> ||
                                  aHref.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span>locationHref<span style="color: #66cc66;">&#41;</span> !== <span style="color: #CC0000;">-1</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    a.<span style="color: #006600;">parentNode</span>.<span style="color: #006600;">className</span> = <span style="color: #3366CC;">'active'</span>;
    <span style="color: #000066; font-weight: bold;">break</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>

<p>I actually just fixed a long-standing bug that was caused by me not being able to fully rely on HTTP language negotiation for the selection of the appropriate language variant, which made me change all links from being language-neutral to including the language in the link target (e.g.: <tt>http:///history</tt> became <tt>http:///history.en</tt> and <tt>http:///history.nl</tt>), the problem with this being that, instead of being able to link to link to <tt>http:///</tt> (<tt>http://www.stichting-ecosafe.org/</tt>), I had to link to <tt>http:///index.en</tt> or <tt>http:///index.nl</tt>, making it more difficult to detect the active anchor if we&#8217;re requesting the home page through <tt>http:///</tt> instead of on of its language-specific URLs.</p>

<p>The JavaScript rested on the assumption that by reverse iterating through all the anchors in the menu and thus processing the link to <tt>http:///</tt> as last, I&#8217;d know that I had struck the home page and wouldn&#8217;t need to worry that <em>any of the links</em> contain a slash. (I don&#8217;t know if I intended it to work this way, but it sure seems to me now that the only way this could ever have worked was as an apparent side-effect of the looping order; the SVN logs seem to agree.)</p>

<p>I could have solved this by redirecting all requests for <tt>http:///</tt> to the appropriate variant. Maybe I should have (to avoid duplicate content). Instead I chose to add a <tt>rel="start"</tt> attribute to the links to the home page, as can be deduced from the JavaScript above. (To resolve the duplicate content issue, I could also add a <a href="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html">canonical link</a> to the header of the two language variants.)</p>

<p>Anyway, all this brings me to the messy subject of content negotiation.</p>

<h2 id="content-negotiation">Content and language negotiation</h2>

<p>The EcoSafe website would be bi-lingual (English and Dutch) from the onset. Initially, I wanted to use language negotiation to the extend of having completely language-neutral URLs. For example: <q><tt>http:///cost-calculator</tt></q> instead of <q><tt>http:///cost-calculator.en</tt></q> and <q><tt>http:///cost-calculator.nl</tt></q>. In the end, you can make this work properly in the browser with the help of a cookie, but it&#8217;s still a pipe-dream because nothing else will work if you do not also offer another navigational path to the different variants. Maybe, we&#8217;ll revisit this topic for a later experiment.</p>

<p>Content-type negotiation is almost effortless with Apache thanks to <tt><a href="http://httpd.apache.org/docs/1.3/mod/mod_negotiation.html">mod_negotiation</a></tt>. If, like me, you despise to have <tt>.html</tt>, <tt>.htm</tt>, <tt>.xhtml</tt>, <tt>.phtml</tt>, <tt>.pxhtml</tt>. <tt>.sxhtml</tt>, <tt>.php</tt>, <tt>.xml</tt> in your URL (I actually used all of these at some time or other), you only have to make sure that <tt>MultiViews</tt> is in your options.</p>

<p>I&#8217;ve configured SSI by means of the following instead of a “magic mime-type”:</p>

<pre class="apache"><span style="color: #00007f;">AddType</span>         text/html       .shtml
<span style="color: #00007f;">AddHandler</span>      server-parsed   .shtml
<span style="color: #00007f;">AddCharset</span>      UTF<span style="color: #ff0000;">-8</span>           .shtml
AddOutputFilter <span style="color: #0000ff;">Includes</span>        .shtml</pre>

<p>For PHP I couldn&#8217;t do the same because my web host was still at Apache 1.3. Otherwise, the following should have worked equally well for PHP:</p>

<pre class="apache"><span style="color: #adadad; font-style: italic;"># This doesn't work with Apache 1.3</span>
<span style="color: #00007f;">AddType</span>        text/html       .phtml
<span style="color: #00007f;">AddHandler</span>     php-<span style="color: #00007f;">script</span>      .phtml
<span style="color: #00007f;">AddCharset</span>     UTF<span style="color: #ff0000;">-8</span>           .phtml</pre>

<p>Configuring language priority is easy with Apache:</p>

<h3>Integrating PHP and SSI</h3>

<p>The integration of PHP with all the weirdness that I had configured and created around SSI took some figuring out. Luckily, PHP offers a <a href="http://www.php.net/virtual"><tt>virtual()</tt></a> function that works roughly the same as <tt>mod_include's</tt> <tt>&lt;!--#include virtual--&gt;</tt>. Here&#8217;s an example:</p>

<pre class="php">&lt;body&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/virtual"><span style="color: #000066;">virtual</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/inc/left-side.en.html'</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #0000ff;">$uri</span> = <span style="color: #ff0000;">'/cost-calculator.en.phtml'</span>; <span style="color: #b1b100;">include</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'inc/alt-lang.phtml'</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre>

<p>In retrospect, it&#8217;s pretty much bullshit to use it. I could have just as well <tt>require()</tt>d the partials (which I actually did for the alternate language selection), but I probably started out using virtual on a more generic URL without language and content-type selection in it.</p>

<h3>406 handling</h3>

<p>Because I deployed on Apache 1.3 and the <tt><a href="http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html#forcelanguagepriority">ForceLanguagePriority</a></tt> directive was only introduced with Apache 2.0.30, I had to write an ugly hack to avoid visitors getting 406 errors. To that end, I added a 406 handler to my <tt>.htaccess</tt> file:</p>

<pre class="apache"><span style="color: #00007f;">LanguagePriority</span> en nl
ForceLanguagePriority Prefer Fallback <span style="color: #adadad; font-style: italic;"># This doesn't work with 1.3</span>
&nbsp;
<span style="color: #00007f;">ErrorDocument</span> <span style="color: #ff0000;">406</span> /error<span style="color: #ff0000;">-406</span>.php <span style="color: #adadad; font-style: italic;"># Luckily, this does </span></pre>

<p><tt>error-406.php</tt> is a PHP file that figures out the available variants based on <tt>$_SERVER['REQUEST_URI']</tt>. Then, it simply picks the first one (which works because, accidentally, that&#8217;s the one I&#8217;ve given priority using the <tt><a href="http://httpd.apache.org/docs/1.3/mod/mod_negotiation.html#languagepriority">LanguagePriority</a></tt> directive as well), outputs a 200 OK header instead of the 406, and <tt>virtual()</tt>s the file of the variant. The code looks somewhat like this:</p>

<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/chdir"><span style="color: #000066;">chdir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SERVER</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'DOCUMENT_ROOT'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$filenames</span> = <a href="http://www.php.net/glob"><span style="color: #000066;">glob</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/basename"><span style="color: #000066;">basename</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SERVER</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'REQUEST_URI'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;.*&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$filename</span> = <span style="color: #0000ff;">$filenames</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
<a href="http://www.php.net/apache_setenv"><span style="color: #000066;">apache_setenv</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'DOCUMENT_URI'</span>, <span style="color: #ff0000;">&quot;/$filename&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'HTTP/1.1 200 OK'</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/virtual"><span style="color: #000066;">virtual</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;$filename&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre>

<div id="attachment_807" class="wp-caption alignright" style="width: 310px"><a rel="lightbox-ecosafe" href="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-cost-calculator.png"><img src="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-cost-calculator-300x137.png" alt="EcoSafe Cost Calculator" title="www.stichting-ecosafe.org/cost-calculator" width="300" height="137" class="size-medium wp-image-807" /></a><p class="wp-caption-text">EcoSafe Cost Calculator</p></div>

<div id="attachment_808" class="wp-caption alignright" style="width: 194px"><a href="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-cost-calculation.png"><img src="http://blog.bigsmoke.us/uploads/2009/09/ecosafe-cost-calculation-184x300.png" alt="EcoSafe Cost Calculator results" title="EcoSafe cost calculation" width="184" height="300" class="size-medium wp-image-808" /></a><p class="wp-caption-text">EcoSafe Cost Calculator results</p></div>

<h2>The Cost Calculator</h2>

<p>The EcoSafe Cost Calculator is some of the least neatly contained and most procedurally oriented PHP code I&#8217;ve ever produced while knowing full well what I was doing. It does almost everything it does in global scope. Yet, it does it well.</p>

<p>The thing is designed as a dynamic web page rather than a web application. What I mean by this is that it&#8217;s simply two pages (one for English and one for Dutch) using PHP among a number of pages using SSI. In an application, it&#8217;s usual to have just one ‘view’ that is the same for all languages, but here I chose to put the different language versions in different language pages and then include everything reusable (and language-neutral) from within these files.</p>

<p>Most of the actual processing and calculating is done in <tt>inc/costs-functions.php</tt>.  (The part about gotos is a joke. (Labeled blocks would have been quite sufficient. <img src='http://blog.bigsmoke.us/wp-factory/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ))</p>

<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #808080; font-style: italic;"># costs-functions.php - Stuff that's includes by cost-calculator.{nl,en}.phtml</span>
<span style="color: #808080; font-style: italic;">/**
 * Just remember that this code was never meant to be general purpose or anything.
 * So, relaxeeee and keep your OO-axe burried where it belongs.
 * Oh, if only PHP would support GOTO's ... Sigh ...
 */</span></pre>

<p>The rest of the file is just a whole lot of processing of form data and turning it into something that can be easily traversed for display to the user. There are even the function calls without arguments doing all their work on globals. These are actually only added to make it clearer <em>em</em> a piece of code is doing. And—I must say—after a few years it&#8217;s still remarkably clear to me what each part of the code is doing. There&#8217;s no deep, confusing nesting structures or anything. There&#8217;s just a whole lot of very simple code.</p>

<h3>Some simple AHAH increases form interactivity</h3>

<p>Users of the calculator can add any number of plantings and locations. When the user decides to add a planting or a location, the <tt>onClick</tt> event triggers the execution of <tt>addExtraPlanting()</tt> or <tt>addExtraLocation()</tt>. Here&#8217;s how <tt>addExtraPlanting()</tt> looks:</p>

<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> addExtraPlanting<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  lang = document.<span style="color: #006600;">documentElement</span>.<span style="color: #006600;">lang</span>;
&nbsp;
  <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #006600;">Updater</span><span style="color: #66cc66;">&#40;</span>
    <span style="color: #3366CC;">'plantings'</span>, <span style="color: #3366CC;">'/inc/planting.'</span> + lang, <span style="color: #66cc66;">&#123;</span>
      method: <span style="color: #3366CC;">'get'</span>,
      insertion: Insertion.<span style="color: #006600;">Bottom</span>
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>

<p><a href="http://api.prototypejs.org/ajax/ajax/updater.html"><tt>Ajax.Updater</tt></a> comes from the <a href="http://www.prototypejs.org/">Prototype JavaScript framework</a>.</p>

<p>Here&#8217;s what <tt>inc/planting.en.phtml</tt> looks like. The same file is also included in a loop to rebuild the form&#8217;s state after submitting.</p>

<pre class="php">&lt;li&gt;
  &lt;input name=<span style="color: #ff0000;">&quot;num_hectares[]&quot;</span> type=<span style="color: #ff0000;">&quot;text&quot;</span> size=<span style="color: #ff0000;">&quot;5&quot;</span> value=<span style="color: #ff0000;">&quot;&lt;?php echo $num_hectares ?&gt;&quot;</span> /&gt;
&nbsp;
  hectares have been planted in
&nbsp;
  &lt;select name=<span style="color: #ff0000;">&quot;plant_years[]&quot;</span>&gt;&lt;?php <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'planting_options.php'</span><span style="color: #66cc66;">&#41;</span> ?&gt;&lt;/select&gt;
&nbsp;
  <span style="color: #66cc66;">&#40;</span>&lt;a title=<span style="color: #ff0000;">&quot;Remove this planting&quot;</span> href=<span style="color: #ff0000;">&quot;#&quot;</span> onclick=<span style="color: #ff0000;">&quot;removePlanting(this); return false;&quot;</span>&gt;x&lt;/a&gt;<span style="color: #66cc66;">&#41;</span>
&lt;/li&gt;</pre>

<p>I think that I&#8217;ve gone into small enough detail by now to get to the conclusion. Also showing the contents of <tt>planting_options.php</tt> would be pushing it. Ah, well…</p>

<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> !<a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this_year</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #0000ff;">$this_year</span> = <a href="http://www.php.net/intval"><span style="color: #000066;">intval</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/date"><span style="color: #000066;">date</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> !<a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$plant_year</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #0000ff;">$plant_year</span> = <span style="color: #0000ff;">$this_year</span>;
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span> = <span style="color: #0000ff;">$this_year</span>; <span style="color: #0000ff;">$i</span> &gt;= <span style="color: #0000ff;">$this_year</span> - <span style="color: #cc66cc;">20</span>; <span style="color: #0000ff;">$i</span>--<span style="color: #66cc66;">&#41;</span>
  <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;&lt;option&quot;</span> . <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span> == <span style="color: #0000ff;">$plant_year</span> ? <span style="color: #ff0000;">&quot; selected='1'&quot;</span> : <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;&gt;$i&lt;/option&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre>

<p>(Yesterday, I couldn&#8217;t resist the temptation of turning this into a simple file to <tt>require()</tt> instead of the function definition it was. I think it&#8217;s funny to refactor something to <em>remove</em> encapsulation.)</p>

<h2>Conclusion</h2>

<p>As is usual when looking at old code, I see many things that I&#8217;d do (even just a little) different today, but I saw a surprising number of solutions that I actually still like now that I see them back after three years. Removing some of the remaining warts probably won&#8217;t do much good besides the masturbatory satisfaction it could give me. (It&#8217;s likely that the website won&#8217;t live much longer, making such extra attention very undeserved.) But, nevertheless, I&#8217;ve enjoyed blogging about it now to recoup the whole experience and to at least <em>look</em> at what I&#8217;d do different now and what I learned in the meantime.</p>

<h2>Some links</h2>

<ul>
  <li><a href="http://www.w3.org/TR/html401/types.html#type-links">The HTML spec. on <cite>Link types</cite></a></li>
  <li><a href="http://www.stichting-ecosafe.org/">The EcoSafe website</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2009/09/16/www.stichting-ecosafe.org/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TheSixtyOne, a better social music site</title>
		<link>http://blog.bigsmoke.us/2009/07/20/the61</link>
		<comments>http://blog.bigsmoke.us/2009/07/20/the61#comments</comments>
		<pubDate>Mon, 20 Jul 2009 09:17:22 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=725</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>If you liked Last.fm, you&#8217;ll <em>love</em> <a href="http://www.thesixtyone.com/">TheSixtyOne</a>. Discovering music is turned into a reputation game. Much like Last.fm, you can explore similar artists, genres, tags, moods and users. But, by doing so and <q>hearting</q> songs, you can earn reputation points and extra hearts. As your points increase, you <q>level up</q>, which gives you more authority. There&#8217;s an endless amount of quests to earn points faster and to make you discover all the facets of the application.</p>

<p>Just try it out. It&#8217;s fun and&#8212;unlike Last.fm these days&#8211;it&#8217;s free. <em>You</em> can choose when and how to help these starving artists! <img src='http://blog.bigsmoke.us/wp-factory/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p> ]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2009/07/20/the61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jeroen Dekker (photography) on-line</title>
		<link>http://blog.bigsmoke.us/2007/05/30/jeroen-dekker.com</link>
		<comments>http://blog.bigsmoke.us/2007/05/30/jeroen-dekker.com#comments</comments>
		<pubDate>Tue, 29 May 2007 23:02:19 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Familiars]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/2007/05/30/jeroen-dekker.com</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://jeroen-dekker.com/">Jeroen Dekker</a>, a friend and photographer, has recently, on May the 5th, put his website on <a href="http://jeroen-dekker.com/">concert photography</a> on-line. (Go check it out! He has some great pictures there.)</p>

<p>I was very flattered when I was asked by Jeroen to give some <abbr title="Search Engine Optimization">SEO</abbr> advice in the test stage of his website. I was even happier when I saw how well he had implemented my suggestions. In his concert photography section, he now has links consisting of the event name and the band name and the number of the photo. An example URL: <a href="http://jeroen-dekker.com/concerts/noordschok-2007/prey-band/1/">http://jeroen-dekker.com/concerts/noordschok-2007/prey-band/1/</a>. Also his page titles follow the same structure. As is often the case with <abbr title="Search Engine Optimization">SEO</abbr>, the best results are acquired by remembering that good URLs are URLs which are cool enough that you won&#8217;t want to change the in the future and that good titles are titles which look good anywhere, be it in a bookmark or a search result.</p>

<p>
<a rel='lightbox[jeroen-dekker]' href='http://blog.bigsmoke.us/uploads/2007/05/jeroen-dekker-concerts.jpg' title='Jeroen Dekker concert photography'><img src='http://blog.bigsmoke.us/uploads/2007/05/jeroen-dekker-concerts.thumbnail.jpg' alt='Jeroen Dekker concert photography' /></a>

<a rel='lightbox[jeroen-dekker]' href='http://blog.bigsmoke.us/uploads/2007/05/jeroen-dekker-news.jpg' title='Jeroen Dekker news'><img src='http://blog.bigsmoke.us/uploads/2007/05/jeroen-dekker-news.thumbnail.jpg' alt='Jeroen Dekker news' /></a>
</p>

<p>I also noticed that, following some evangelizing on semantics and CSS from me, he had greatly cleaned up the HTML markup. Some pages could still profit from some <del>better</del><ins>more pedantic</ins> markup though. An example from the news section (cleaned up for readability):</p>

<pre class="php">&lt;p&gt; The following bands played:&lt;br&gt;
 - &lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/eluveitie-band/&quot;</span>&gt;Eluveitie&lt;/a&gt;&lt;br&gt;
 - &lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/thy-majestie-band/&quot;</span>&gt;Thy  Majestie&lt;/a&gt;&lt;br&gt;
 - &lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/drottnar-band/&quot;</span>&gt;Drottnar&lt;/a&gt;&lt;br&gt;
&nbsp;
 - &lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/whispering-gallery-band/&quot;</span>&gt;Whispering Gallery&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;</pre>

<p>In my opinion, the above is a <em>very</em> awkward way to define what is really an unordered list:</p>

<pre class="php">&lt;p&gt;The following bands played:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/eluveitie-band/&quot;</span>&gt;Eluveitie&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/thy-majestie-band/&quot;</span>&gt;Thy  Majestie&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/drottnar-band/&quot;</span>&gt;Drottnar&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=<span style="color: #ff0000;">&quot;http://jeroen-dekker.com/concerts/fear-dark-festival-hedon-12-mei-2007/whispering-gallery-band/&quot;</span>&gt;Whispering Gallery&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>

<p>Finally, a nice touch that I noticed on his site is that he doesn&#8217;t have explicit pagination. By this I mean that clicking on the page 2 link simply takes you to the first photo on that page, so that he needs only an URL for each photo and not an URL for each page or even photoset.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2007/05/30/jeroen-dekker.com/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using the standard HTML link colors</title>
		<link>http://blog.bigsmoke.us/2007/02/02/default-html-link-colors</link>
		<comments>http://blog.bigsmoke.us/2007/02/02/default-html-link-colors#comments</comments>
		<pubDate>Fri, 02 Feb 2007 22:48:42 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/2007/02/02/default-html-link-colors</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Occasionally, I have to foray into web design. From the look of this blog you can deduce that I&#8217;m not really into the <q>design</q> part of web design. First and foremostly this is because I  suck at graphics and colors. But another reason is that I assume that people visit my blog to read some text and not to look at the fancy graphical borders and background of that text.</p>

<p>Recently I&#8217;ve gotten into the habit of simply using the default HTML link colors instead of trying to come up with a comprehensible color scheme for each design. This means that my links are <strong style="color: blue">blue</strong>, my visited links are <strong style="color: purple">purple</strong> and my active links are <strong style="color: red">red</strong> as in the example CSS snippet below.</p>

<pre class="css">a<span style="color: #3333ff;">:link </span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #000000; font-weight: bold;">blue</span>;     <span style="color: #808080; font-style: italic;">/* #00f */</span>
<span style="color: #66cc66;">&#125;</span>
a<span style="color: #3333ff;">:visited </span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #993333;">purple</span>;   <span style="color: #808080; font-style: italic;">/* #800080 */</span>
<span style="color: #66cc66;">&#125;</span>
a<span style="color: #3333ff;">:active </span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #993333;">red</span>;      <span style="color: #808080; font-style: italic;">/* #f00 */</span>
<span style="color: #66cc66;">&#125;</span></pre>

<h3>Related links</h3>

<ul>
  <li><cite><a href="http://www.bohmann.dk/articles/against_non_standard_link_colors.html">Against Non-Standard Link Colors</a></cite> by <a href="http://www.bohmann.dk/kristoffer/">Kristoffer Bohmann</a></li>
  <li><cite><a href="http://www.useit.com/alertbox/20040510.html">Guidelines for Visualizing Links</a></cite> by <a href="http://www.useit.com/">Jacob Nielsen</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2007/02/02/default-html-link-colors/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

