<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>jakobloekkemadsen.com</title>
	
	<link>http://www.jakobloekkemadsen.com</link>
	<description>Usability. Information Architecture. Design.</description>
	<lastBuildDate>Fri, 19 Feb 2010 08:21:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Jakobloekkemadsen" /><feedburner:info uri="jakobloekkemadsen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Useful PHP libraries, part 2 – Scaffold CSS</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/hUxRzXF1WyQ/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 16:52:24 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=150</guid>
		<description><![CDATA[<p><a href="http://wiki.github.com/anthonyshort/csscaffold/" target="_blank">Scaffold CSS</a> was developed by <a href="http://anthonyshort.com.au/" target="_blank">Anthony Short</a> and it is &#8211; basically &#8211; every CSS-coder’s dream come true:</p>
<p>Variables, nested selectors, abstractions from vendor-specific properties etc. etc. etc. Good stuff!</p>
<p>Installation and usage couldn’t be simpler! (Really. I&#8230; <a href="http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://wiki.github.com/anthonyshort/csscaffold/" target="_blank">Scaffold CSS</a> was developed by <a href="http://anthonyshort.com.au/" target="_blank">Anthony Short</a> and it is &#8211; basically &#8211; every CSS-coder’s dream come true:</p>
<p>Variables, nested selectors, abstractions from vendor-specific properties etc. etc. etc. Good stuff!</p>
<p>Installation and usage couldn’t be simpler! (Really. I don’t see how it could!)<br />
You place the library folder in whatever folder holds you CSS-files. Then you copy-paste the .htaccess-file that redirects every request for your CSS-files to the library. Scaffold then reads through your CSS and interprets whatever tricks you’ve written and serves up nicely formatted (or minifed, if you prefer) W3C-compliant CSS.</p>
<p>”What’s this good for?”, you say?</p>
<p>Well. Consider this piece of regular CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span> label
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span> input
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
-moz-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
-webkit-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
-ms-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;boxsizing.htc&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#departure_date</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#persons</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#location</span> <span style="color: #6666ff;">.popupcalendar_icon</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">./graphics/images/sprites.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">295px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">314px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-271px</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">39px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-inline-box<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Even though it’s nicely ordered and very readable, this code is still quite hard to understand at first look. You can&#8217;t just read what&#8217;s going on. What&#8217;s related to what? You need to look back and forth a few times to see this.<br />
This makes it bad code!<br />
<a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882" target="_blank" title="Clean Code - book on amazon">Good code is always easy to read and understand.</a></p>
<p>Now look at the same code in Scaffold syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@constants {</span>
   labelTextColor<span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
   gutter<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #00AA00;">&#123;</span>
&nbsp;
   <span style="color: #cc00cc;">#arrival_date</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#departure_date</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#persons</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#location</span>  <span style="color: #00AA00;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> !labelTextColor<span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">2</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
&nbsp;
      label <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">10</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&nbsp;
      input <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">4</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">1</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>border-box<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&nbsp;
      <span style="color: #6666ff;">.popupcalendar_icon</span> <span style="color: #00AA00;">&#123;</span>
         image-replace<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'./graphics/images/sprites.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-271px</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">39px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
   <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The nesting immedietaly makes the code easy to read!<br />
The selectors come in a logical order. The code is scannable, and in my opinion this is quite a revolution as far as CSS goes!</p>
<p>And it gets even better!</p>
<p>As you may have noticed, my second code example is full of non-CSS properties.<br />
These are Scaffold-specific functions, constants and ”mixins”.</p>
<p>For example: A standard gutter width of 10px is defined as a constant, then used throughout the style declarations by reference.<br />
No more search-and-replace for simple color changes!<br />
This feature alone will save me countless hours.</p>
<p>Then there’s stuff like ”+inline-block();” or ”+border-box();”. These are ”mixins” that basically call a set of CSS properties that take care of crossbrowser compatibility. Scaffold serves up vendor-specific properties and even a selection of IE-behaviors, filters and expressions to get the desired effect working all around. Now we have a one line trick that’ll fix box model-quirks or get inline-blocks behave like expected. (Or rotation, shadows and other CSS3-goodies for that matter). This means more time for coffee, which is nice!</p>
<p>Finally we have functions like ”image-replace: url(&#8216;./graphics/images/sprites.png&#8217;);”<br />
This line takes care of everything regarding CSS image replacement. It even automatically sets the correct height and width fitting the specified image file.</p>
<p>The library has tons of useful features and some pretty advanced ones too. Everything is cached, so it&#8217;s just as fast as regular CSS. </p>
<p>So if you’re lucky enough to have your CSS-files served from an Apache server with PHP enabled, then by all means, do not miss out on Scaffold CSS!</p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/hUxRzXF1WyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/</feedburner:origLink></item>
		<item>
		<title>Useful PHP libraries, part 1 – SLIR</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/W6D-EmN-hcw/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 19:20:05 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php class design images]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=115</guid>
		<description><![CDATA[<p><em>In this series of blog posts I introduce my favourite PHP libraries.</em></p>
<p>Today&#8217;s library is:<br />
<strong><a href="http://code.google.com/p/smart-lencioni-image-resizer/">SLIR</a></strong></p>
<p>SLIR – or ”Smart Lencioni Image Resizer” – was developed by <a href="http://shiftingpixel.com/">Joe Lencioni</a>. It’s purpose is on-the-fly scaling and cropping of images.&#8230; <a href="http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p><em>In this series of blog posts I introduce my favourite PHP libraries.</em></p>
<p>Today&#8217;s library is:<br />
<strong><a href="http://code.google.com/p/smart-lencioni-image-resizer/">SLIR</a></strong></p>
<p>SLIR – or ”Smart Lencioni Image Resizer” – was developed by <a href="http://shiftingpixel.com/">Joe Lencioni</a>. It’s purpose is on-the-fly scaling and cropping of images.</p>
<p>SLIR works by scaling the image on request, rather than on import.<br />
The benefit is that you can change your image sizes on the fly. If your page layout changes, you can just request images with a size that fits.</p>
<p>It&#8217;s basically a clever PHP script that &#8220;acts&#8221; as like image, combined with a .htaccess-file, that disguises the PHP-file as an actual image file.</p>
<p>This means you activate the resizer just by putting a url into your img-tags.<br />
The url holds the resize parameters and the path to the original image file.</p>
<p>Example:</p>
<p>Original image:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&lt;img src=&quot;http://www.jakobloekkemadsen.com/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&quot; /&gt;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" /></p>
<p>Scaled to fit 100px width:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&lt;img src=&quot;http://www.jakobloekkemadsen.com/slir/w100/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&quot; /&gt;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/slir/w100/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" /></p>
<p>Scaled to fit 25px width and cropped to square:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&lt;img src=&quot;http://www.jakobloekkemadsen.com/slir/w25-c1:1/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&quot; /&gt;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/slir/w25-c1:1/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" /></p>
<p>”What about performance?”, I hear you ask. &#8220;Won&#8217;t the server choke on having to process all image requests?&#8221;</p>
<p>No, it won&#8217;t. (-:<br />
SLIR caches the image the first time it’s requested, so all subsequent requests are served just as fast as any other image file on the server. The redirect is handled by an alias to the cachefile. Only if no matching cache file exists, or if it’s too old, or if the original has changed, then SLIR is invoked and a new image is generated and cached.</p>
<p>”Ok. But what about security, then?”</p>
<p>In theory this script enables a hacker to flood your server with files just by changing the url and requesting all imaginable combinations of width and height. This issue has been discussed in the comments on <a href="http://shiftingpixel.com/2008/03/03/smart-image-resizer/">http://shiftingpixel.com/2008/03/03/smart-image-resizer/</a> and the current version of the script can be made to restrict access to any other combinations than the ones you specify.</p>
<p>Personally I haven’t found an easier, more futureproof and flexible solution for handling image scaling.<br />
And it&#8217;s free!</p>
<p>Simply put: I love this script!</p>
<p><b>Stay tuned for part two of &#8220;Useful PHP libraries&#8221;. Coming soon &#8230;</b></p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/W6D-EmN-hcw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/</feedburner:origLink></item>
		<item>
		<title>What’s with the painting?</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/VmyrUeu1rBQ/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 17:11:35 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Albrecht Dührer]]></category>
		<category><![CDATA[german artist]]></category>
		<category><![CDATA[intertextuality]]></category>
		<category><![CDATA[painting]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=103</guid>
		<description><![CDATA[<p>The background painting on this page is by the German painter Albrecht Dürer (1471 – 1528).</p>
<p>It’s from 1503 and the title of the painting is ”Das große Rasenstück” or ”The Large Turf”.</p>
<p>I decided that I wanted a real&#8230; <a href="http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>The background painting on this page is by the German painter Albrecht Dürer (1471 – 1528).</p>
<p>It’s from 1503 and the title of the painting is ”Das große Rasenstück” or ”The Large Turf”.</p>
<div class="wp-caption alignnone" style="width: 476px"><img title="Das große Rasenstück" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Duerer_the_large_turf.jpg/466px-Duerer_the_large_turf.jpg" alt="Das große Rasenstück" width="466" height="599" /><p class="wp-caption-text">Das große Rasenstück</p></div>
<p>I decided that I wanted a real painting for the background, so I browsed around the web, came across this one and loved it instantly. It has amazing details in both color and perspective. And the colors made a nice palette for the rest of my design.</p>
<p>Considering the paintings&#8217; year of origin, it’s incredibly modern looking!</p>
<p>It does have this special pre-renaissance or late medieval feel about it, though (those who read Foucault – ”The order of things” will probaby know what I mean). There’s something about the way the whole setting is illuminated that gives it a magical edge.</p>
<p>Here are some more pictures by Dürer:</p>
<p>&#8220;Porträt Albrecht Dürer der Ältere&#8221; (1490) is your typical 15th century portrait.</p>
<div class="wp-caption alignnone" style="width: 489px"><img title="Porträt Albrecht Dürer der Ältere" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Albrecht_Dürer_071.jpg/479px-Albrecht_Dürer_071.jpg" alt="Porträt Albrecht Dürer der Ältere" width="479" height="600" /><p class="wp-caption-text">Porträt Albrecht Dürer der Ältere</p></div>
<p>Not too interesting. Rembrandt is the place to look for interesting portraits.</p>
<p>&#8220;<em>Weiher im Walde&#8221; (1495) </em>is more interesting:<br />
<div class="wp-caption alignnone" style="width: 810px"><img title="Weiher im Walde" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Albrecht_Dürer_106.jpg/800px-Albrecht_Dürer_106.jpg" alt="Weiher im Walde" width="800" height="551" /><p class="wp-caption-text">Weiher im Walde</p></div><br />
The brush strokes and colors remind me of van Gogh and at first glance one could easily read this picture into the present day debate about man-made pollution vs. Nature.</p>
<p>It looks almost like chimneys to the left sending agressive black smoke into the forrest to the right.</p>
<p>I love it when old works of art suddenly ressemble something that wasn&#8217;t around when they were made:</p>
<p>Or how about <em>&#8220;Feldhase&#8221; </em>(1502) &#8211; this could be an illustration in a modern encyclopedia. Very impressive and realistic! I could be fooled if someone told me it was 20th century:</p>
<div class="wp-caption alignnone" style="width: 550px"><img title="Feldhase" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Durer_Young_Hare.jpg/540px-Durer_Young_Hare.jpg" alt="Feldhase" width="540" height="599" /><p class="wp-caption-text">Feldhase</p></div>
<p>&#8220;Melancholia I&#8221; (1514)  is much less naturalistic, but instead it has this almost Picasso-like avant garde quality about the composition &#8211; with its interwoven shapes and the twisted perspective. Quite impressive, I think:</p>
<div class="wp-caption alignnone" style="width: 474px"><img title="Melancholia I" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Dürer_Melancholia_I.jpg/464px-Dürer_Melancholia_I.jpg" alt="Melancholia I" width="464" height="599" /><p class="wp-caption-text">Melancholia I</p></div>
<p>And here&#8217;s my personal favourite: <em>&#8220;Rhinocerus&#8221;</em> (1515).</p>
<p>I think the rhinos&#8217; facual expression is priceless! (-:</p>
<div class="wp-caption alignnone" style="width: 732px"><img class=" " title="Rhinocerus" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Dürer_rhino.png/722px-Dürer_rhino.png" alt="Rhinoserus" width="722" height="600" /><p class="wp-caption-text">Rhinocerus</p></div>
<p>&#8220;Wrap it up, dude! Nature calls &#8230;&#8221;</p>
<p>More about Albrecht Dürer:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Albrecht_Dürer">http://en.wikipedia.org/wiki/Albrecht_Dürer</a></li>
<li><a href="http://www.ibiblio.org/wm/paint/auth/durer/">http://www.ibiblio.org/wm/paint/auth/durer/</a></li>
<li><a href="http://www.artchive.com/artchive/D/durer.htm">http://www.artchive.com/artchive/D/durer.htm</a>l</li>
</ul>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/VmyrUeu1rBQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/</feedburner:origLink></item>
		<item>
		<title>How to inject dynamic content from PHP into an old and closed source cms.</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/NOz3xy2zPrE/</link>
		<comments>http://www.jakobloekkemadsen.com/2009/12/how-to-inject-dynamic-content-from-php-into-an-old-and-closed-source-cms/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 10:43:31 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/blog/?p=49</guid>
		<description><![CDATA[<h3>The problem</h3>
<p>Recently I was asked by an e-commerce client if I could create a banner on his website that would let visitors know whether the phone hotline of the store is currently open or closed based on store opening&#8230; <a href="http://www.jakobloekkemadsen.com/2009/12/how-to-inject-dynamic-content-from-php-into-an-old-and-closed-source-cms/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<h3>The problem</h3>
<p>Recently I was asked by an e-commerce client if I could create a banner on his website that would let visitors know whether the phone hotline of the store is currently open or closed based on store opening hours.</p>
<p>In a PHP-based CMS the only task involved would have been writing a function outputting some HTML for use in the banner. So this should have been a no-brainer, had it not been for the fact that my client&#8217;s website is run in a proprietary, hosted (and heavily outdated) CMS with no server-side access what so ever!</p>
<p>My first thought was then to make a solution entirely in Javascript. This would be very possible in theory, but since Javascript is a client-side language, it can only know the time and date from the client&#8217;s local settings.</p>
<p>This fact rendered the client-side solution very impractical. What about time-zone differences? What if the clients clock is set wrong? How about daylight savings time? In reality, the client-side solution was not an option.</p>
<p>So what to do?</p>
<h3>The solution</h3>
<p>The only way to go about this problem was then to write a server-side script, run it on a different domain accessing one single source of time and date information (ie. this server&#8217;s own clock) and then inject the output into the client&#8217;s website using the front-end methods available to me.</p>
<p>That way, the information posted would appear correctly across all visitors regardless of their settings and time zone.</p>
<p>Using AJAX was not an option because of the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">Same Origin Policy</a> preventing me to use something like <a href="http://docs.jquery.com/Ajax/load">jQuery&#8217;s load()-function</a>. Also, the fact that the server running the client&#8217;s CMS itself was inaccessible to me ment that no <a href="http://developer.yahoo.com/javascript/howto-proxy.html">proxy-script</a> could be set up to circumvent the restriction.</p>
<p>What struck me, then, was that I had missed the most obvious solution, which was really lo-tech and simple. Embarrasingly simple, actually &#8211; as I had already spent so much time scratching my head and searching the web for a workaround to get this fancy AJAX-thing working &#8230;</p>
<p>First, here&#8217;s the PHP-script to generate the HTML string telling the visitor whether the hotline is open or closed:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Content-type: application/x-javascript; charset=UTF-8&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Name of variable to output:</span>
<span style="color: #000088;">$nameOfVariable</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;hotline_status&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Strings to output:</span>
<span style="color: #000088;">$open</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;p class='<span style="color: #006699; font-weight: bold;">$nameOfVariable</span>'&gt;The hotline is open!&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$closed</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;p class='<span style="color: #006699; font-weight: bold;">$nameOfVariable</span>'&gt;The hotline is closed!&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Opening hours (in 24-hour clock):</span>
<span style="color: #000088;">$weekday</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
 <span style="color: #0000ff;">'open'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'close'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">17</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$saturday</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
 <span style="color: #0000ff;">'open'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'close'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">14</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Time zone adjustment. (If the server is in a different time zone than the hours configured above refer to):</span>
<span style="color: #000088;">$timeZoneAdjust</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Don't change these:</span>
<span style="color: #000088;">$now</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$daylightSavingsTime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;I&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$now</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$minutes</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$now</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$minuteOfDay</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$minutes</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">1440</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$hourOfDay</span> <span style="color: #339933;">=</span> <span style="color: #990000;">abs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$minuteOfDay</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #000088;">$timeZoneAdjust</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$daylightSavingsTime</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dayOfWeek</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;D&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$now</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Make the string:</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;var <span style="color: #006699; font-weight: bold;">$nameOfVariable</span> = <span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dayOfWeek</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;Sun&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">//Sunday is hardcoded.</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$closed</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dayOfWeek</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;Sat&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hourOfDay</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$saturday</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'open'</span><span style="color: #009900;">&#93;</span> or <span style="color: #000088;">$hourOfDay</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$saturday</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'close'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$closed</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$open</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hourOfDay</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$weekday</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'open'</span><span style="color: #009900;">&#93;</span> or <span style="color: #000088;">$hourOfDay</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$weekday</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'close'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$closed</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$open</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Did you catch the trick?</p>
<p>The trick is to specify a php header like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Content-type: application/x-javascript; charset=UTF-8&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That way the script returns a javascript file.<br />
This file contains a single variable holding the string that I want to inject into the DOM of my client&#8217;s website.</p>
<h3>The result</h3>
<p>On a normal weekday within hotline opening hours the output of the PHP file will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> hotline_status <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;p class='hotline_status'&gt;The hotline is open!&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I can then reference the PHP-file somewhere in the HTML of my client&#8217;s website (preferebly near the bottom for load speed reasons) like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://path/to/php/file/&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;;</span></pre></div></div>

<p>Then I inject the content of the variable in the right place using jQuery:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;div#hotline_status&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>append<span style="color: #009900;">&#40;</span>hotline_status<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Voila!</p>
<p>Visitors now see if the hotline is open at the time of visiting the site.</p>
<p>(-:</p>
<p><strong>Possibilities</strong></p>
<p>And this is only a simple script.</p>
<p>You can use this method to apply all the bells and wistles of PHP (or your server-side language of choice) to your client&#8217;s ancient and closed source website &#8211; including database access, file reads, curls, etc.</p>
<p>Want to feed variables to your PHP script to condition an SQL-call?<br />
No problem! Just append your variables to the filename of the referenced script (like scriptname.php?key=value) and use $_GET['key'] in the script to access them.</p>
<p>I guess you could even inject the script-tag itself on an event rather than on load, thus making user input possible, for instance on submitting a form. I haven&#8217;t tried this yet, though.</p>
<p>Of course, all of this wouldn&#8217;t be necessary at all in a perfect world where all clients have an open mind and understand the benefits of using non-proprietary, open-source CMS and e-commerce platforms.</p>
<p>But until that happens (which is never), little hacks like this are sometimes necessary to get the job done.</p>
<p>Hope you find it useful!</p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/NOz3xy2zPrE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2009/12/how-to-inject-dynamic-content-from-php-into-an-old-and-closed-source-cms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2009/12/how-to-inject-dynamic-content-from-php-into-an-old-and-closed-source-cms/</feedburner:origLink></item>
		<item>
		<title>Hostile signage</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/5nMzgUsGpdc/</link>
		<comments>http://www.jakobloekkemadsen.com/2009/10/fjendtlig-skiltning/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 12:20:15 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[communication]]></category>
		<category><![CDATA[public space]]></category>
		<category><![CDATA[sales lead]]></category>
		<category><![CDATA[signs]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/blog/?p=18</guid>
		<description><![CDATA[<p>A good sign is unambigous. Its message is clear and its purpose immediately understandable in the context.</p>
<p>We&#8217;ve all seen bad signage with obscure wording or unclear use of symbols.<br />
The kind that makes it necessary for you to&#8230; <a href="http://www.jakobloekkemadsen.com/2009/10/fjendtlig-skiltning/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>A good sign is unambigous. Its message is clear and its purpose immediately understandable in the context.</p>
<p>We&#8217;ve all seen bad signage with obscure wording or unclear use of symbols.<br />
The kind that makes it necessary for you to stop and wonder what it means or why it&#8217;s even there.</p>
<p>But sometimes it&#8217;s not just lack of meaning or motivation that makes a sign bad.</p>
<p>Some signs convey angriness in their tone of wording thus bloating the message and risking to make recipients feel like they&#8217;re being told off. As if the sender of the message has another agenda that doesn&#8217;t really belong on a sign.<br />
Often this can be because they&#8217;ve gotten anoyed with something that people keep doing in the particular location and finally resorted to put up a sign to make it stop!</p>
<p>It&#8217;s likely that this leaves us as recipients with a feeling of being treated unjustly, since we are probably not personally responsible for whatever irritation may lie behind the decision to put out such a message in a public space.</p>
<p>Also, as any child psychologist will agree, telling people off is not an efficient way to make them do what you want.<br />
Sometimes it will even have the opposite effect. Especially when the badmouthing is unfair and you don&#8217;t get to defend yourself against the abuse.</p>
<p>Of course, as a usability professional, I regard this as really bad communication. Sometimes I would even call it &#8220;negative signage&#8221; because it attacks the issue backwards. Instead of guiding people in the right direction, helping them avoid the disapproved behaviour by their own means, this type of negative communication readily bashes anyone for their potential misdemeanor.<br />
It&#8217;s the basic schism between the carrot and the stick, really.</p>
<p>My family and I encountered one such piece of negative communication while staying at the lovely island of Samsø last summer.<br />
At the southern point of the island lies the pittoresque and windy <a href="http://www.fyrtaarne.dk/vesborg.html" target="_blank">Beacon of Vesborg</a>.</p>
<p>As we walked from the parking lot up towards the beacon, we were greeted by the following sequence of signs:</p>
<p><img src="http://www.jakobloekkemadsen.com/images/blog/vesborg/1.jpg" alt="1" /></p>
<p><em>&#8220;Bikes prohibited&#8221;, &#8220;Bringing food prohibited&#8221;</em></p>
<p><em></em><br />
<img src="http://www.jakobloekkemadsen.com/images/blog/vesborg/2.jpg" alt="2" /></p>
<p><em>&#8220;the area is open in the time frame between 11.00 &#8211; 18.00&#8243;</em></p>
<p><em></em><br />
<img src="http://www.jakobloekkemadsen.com/images/blog/vesborg/3.jpg" alt="3" /></p>
<p><em>&#8220;Bringing food and bicycles NO THANKS! Picnic &amp; bicycles PROHIBITED&#8221;</em></p>
<p><em></em><br />
<img src="http://www.jakobloekkemadsen.com/images/blog/vesborg/4.jpg" alt="4" /><br />
<img src="http://www.jakobloekkemadsen.com/images/blog/vesborg/5.jpg" alt="5" /></p>
<p><em>&#8220;Cafe Fruen Ved Fyret (≈ Café the Misses By the Beacon) FOOD &#8211; ICE CREAM &#8211; CAKE &#8211; COFFEE&#8221;</em></p>
<p><em></em><br />
<img src="http://www.jakobloekkemadsen.com/images/blog/vesborg/6.jpg" alt="6" /></p>
<p><em>&#8220;OPEN, SOFT ICE&#8221;</em></p>
<p>What a nice welcome!</p>
<p>First we&#8217;re given a couple of little rants that are not even relevant to us since we didn&#8217;t arrive by bike and thus did not put any bikes where it&#8217;s not allowed. Then we&#8217;re being forbidden to eat our packed lunch by the beacon.</p>
<p>At this point we were already beginning to think about leaving again soon, since we were already hungry and had actually planed to enjoy our packed lunch here that we had brought because we weren&#8217;t sure if they were selling anything to eat here.</p>
<p>Vesborg is quite far away from anything else on the island, and it would have been at least irresponsible to bring a 3-year old kid here without eatable backup.</p>
<p>It wasn&#8217;t until we were all the way up by the beacon side-house that we could see that they actually did sell food &#8211; or that is, on the sign it said &#8220;Café&#8221;. No menu in sight.</p>
<p>What was visible instead was a pile of colorful plastic junk that was also for sale there.</p>
<p>To us this ment: Distract the kid and keep walking! No time to stop and look for a menu sign.</p>
<p>The result: We hurried past the house, up the stairs to view the beacon and the scenery and then back to the parking lot to eat our packed lunch. Apparently just like most of the other visitors. The café was seemingly empty, and the parking lot was filled with families eating lunch by their cars.</p>
<h3>What they should have done</h3>
<p>Because of the way this area is laid out with a parking lot (entrance), a path up past the café (point of sale) and on to the beacon (the attraction) this struck me as very nice prototype of how any efficient sales generating lead is structured.</p>
<p>If the owners of the place had just chosen a different signage strategy, they would have probably sold tons of food and beverages &#8211; and maybe even some of the plastic toys and souvenirs they sported.</p>
<p>Regarding the bikes: In order for a restriction to have authority, it most make sense. There was plenty of room for bikes to stand here. Also, there was no real alternative. There was no area where it was visibly allowed to put bikes. So what else should people do, than put them where there&#8217;s room for it.</p>
<p>In this context, the only meaningful message coming from this sign was something like &#8220;I&#8217;m in charge, do what I say, because I say so&#8221; or maybe even &#8220;I hate cyclists&#8221;.</p>
<p>My guess is, that the only reason most bikers don&#8217;t just turn around and leave at once, is that they&#8217;re tired from the long ride to get there. Not a good start.</p>
<p>And, as I mentioned, this sign also has an impact on the mood of people not riding bikes. It&#8217;s the general first impression for all visitors.</p>
<p>Further on, the sheer number of signs give the impression that the owners don&#8217;t have much faith in their visitors&#8217; ability to behave nicely on their own. Wording such as &#8220;The area is open between 11.00 and 18.00&#8243; comes across as unnecessarily harsh or even slightly bureaucratic. If it really is the entire &#8220;area&#8221; that becomes restricted outside opening hours, maybe it would be better to just put up a small fence and a gate and let them do the work. No need to distract visitors within opening hours by telling them what they can&#8217;t do at another time.</p>
<p>What I suspect, though, is that this sign is just a clumsy attempt to let people know what the café opening hours are, in which case it would have been better just sticking to a conventional &#8220;Opening hours: 11.00 &#8211; 18.00&#8243;.</p>
<p>Ok, maybe this is not a major issue, but the devil&#8217;s in the detail, and all the impressions add up when a visitor tries to make sense of a new place.</p>
<p>Finally, if by prohibiting people to eat their own lunch, they hope to boost sales in the café, they obviously failed.</p>
<p>Instead, the owners should asses the behaviour of their visitors and build on what looked like a very healthy customer potential.</p>
<p>If they had put up a clear menu sign instead of the restriction sign &#8211; you know with a nice layout and readable prices &#8211; and put together a selection of sandwiches, soft drinks and coffee to make people want to throw away their own boring packed lunch, then we at least would have settled down and enjoyed a beautiful, windy summer afternoon by the beacon. Just like the casual and rustic tables and benches where ment to invite to.</p>
<p>So, owners of Vesborg, if you read this: Lighten up! Don&#8217;t yell in advance at your potential customers. Use your energy to spread the message to all island visitors: &#8220;Come and enjoy the beautiful and historic Beacon of Vesborg. The view is fantastic in almost all weather. And don&#8217;t worry! You can buy lunch here.&#8221;</p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/5nMzgUsGpdc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2009/10/fjendtlig-skiltning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2009/10/fjendtlig-skiltning/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.382 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-10 08:44:57 -->
