<?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>Gauke Pieter Sietzema &#187; Web development</title>
	<atom:link href="http://gpsietzema.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://gpsietzema.com</link>
	<description>Web standards, SEO, productivity and photography since 2006</description>
	<lastBuildDate>Wed, 07 Sep 2011 20:16:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<atom:link rel='hub' href='http://gpsietzema.com/?pushpress=hub'/>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>MODX campaigning in the Netherlands</title>
		<link>http://gpsietzema.com/2011/05/28/modx-campaigning-in-the-netherlands/</link>
		<comments>http://gpsietzema.com/2011/05/28/modx-campaigning-in-the-netherlands/#comments</comments>
		<pubDate>Fri, 27 May 2011 23:26:02 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[MODX CMS]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpsietzema.com/?p=491</guid>
		<description><![CDATA[Being at the frontline of the Dutch MODX propaganda machine for a while now, we know it&#8217;s hard to get attention for a CMS which is barely known in the Netherlands. We, Sterc, are making some progress now though! It&#8217;s of the utmost importance to get more users and developers for MODX. We&#8217;re trying to [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><strong>Being at the frontline of the Dutch MODX propaganda machine for a while now, we know it&#8217;s hard to get attention for a CMS which is barely known in the Netherlands. We, Sterc, are making some progress now though!</strong></p>
<p><img class="alignright size-full wp-image-505" title="Sterc is MODX Agency Partner" src="http://gpsietzema.com/wp-content/uploads/2011/05/agency-white-240.png" alt="Sterc is MODX Agency Partner" width="240" height="81" />It&#8217;s of the utmost importance to get more users and developers for MODX. We&#8217;re trying to get more users by holding talks for our partners and interested clients. Last friday was the first talk at MediaCT&#8217;s office, followed shortly by my talk at Traffic Builder&#8217;s office. Both companies are well known and highly respected firms in the Netherlands, so this could mean a real good start for our MODX campaign.</p>
<h2>Friday Afternoon Session at MediaCT HQ in Groningen</h2>
<p>The MediaCT MODX Friday Afternoon Session was streamed live and is also viewable on <a title="MODX FAS keynote recorded video" href="http://www.ustream.tv/recorded/14833213" target="_blank">ustream</a> at this very moment. There were 36 people in total, 18 in the room and 18 online. Slides can be found on <a title="Slides of the MODX FAS Keynote" href="http://www.slideshare.net/sterc/fas-20-mei-gauke-pieter-sietzema-over-modx" target="_blank">Slideshare</a> (Dutch slides).</p>
<p>The FAS keynote was focussed on developers and most questions from the audience were about how implementation was done. The most popular questions was about versioning for the content field, which is currently missing in MODX. Time for a feature request I guess!</p>
<h2>Private keynote for Traffic Builders in Almere</h2>
<p>The Traffic Builders keynote was private for Traffic Builders (TB) employees and a selection of interested clients. This particular presentation was more end-user and SEO focussed; More focus on TV&#8217;s, caching and form customization. All TB&#8217;s employees are SEO and/or SEA specialists and I managed to leave some very excited people behind.</p>
<h2>Want a MODX introduction at your company or congress?</h2>
<p>If you&#8217;re interested in MODX and want me to pay your company or congress a visit for a talk, just drop me an e-mail at gp [at] sterc [dot] nl</p>
<div class="shr-publisher-491"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2011/05/28/modx-campaigning-in-the-netherlands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to start learning Magento</title>
		<link>http://gpsietzema.com/2010/10/18/how-to-start-learning-magento/</link>
		<comments>http://gpsietzema.com/2010/10/18/how-to-start-learning-magento/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 19:52:48 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpsietzema.com/?p=476</guid>
		<description><![CDATA[A fellow developer asked me how to start with Magento, as in &#8220;Where the hell do I start?&#8221;. Usually I tell people to RTFM or buy a book. That&#8217;s rather hard in the case of Magento, because documentation is really bad or simply missing. I have to give them credit for finally starting some serious [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>A fellow developer asked me how to start with Magento, as in &#8220;Where the hell do I start?&#8221;. Usually I tell people to <abbr title="=Read The F*cking Manual">RTFM</abbr> or buy a book. That&#8217;s rather hard in the case of Magento, because documentation is really bad or simply missing. I have to give them credit for finally starting some serious documentation/how-to&#8217;s in their new knowledge-base.</p>
<p>Reading books about Magento is a dangerous path to take, because of the fast release cycle of Magento. Books released yesterday, might be out of date tomorrow. At the time of writing, the only up-to-date book for Magento 1.4 are:</p>
<ul>
<li>None</li>
<li>at the</li>
<li>moment</li>
</ul>
<p>There are however <a title="Magento 1.3 books on Amazon" href="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&amp;field-keywords=magento+1.3&amp;x=0&amp;y=0" target="_blank">many 1.3 books</a> to choose from, so you might try your luck there. Please note that the database structure of Magento has some big differences between 1.3 and 1.4. You should expect changes in the API too because of this.</p>
<p>So, to recap: we have a very complex e-commerce application, we don&#8217;t have any up-to-date books and the manual simply <span style="text-decoration: line-through;">sucks</span> sucked&#8230; Peter to the rescue! There&#8217;s still a way to get into Magento and that&#8217;s by doing two things. Watch out, it requires reading!</p>
<p><strong>First off</strong>, read the new tutorials in Magento&#8217;s new <a title="Magento Knowledge-base" href="http://www.magentocommerce.com/knowledge-base" target="_blank"><strong>knowledge base</strong></a>. This should give you a good idea about the complexity of Magento and enlighten you with some of the logic behind the complexity.</p>
<div id="attachment_6" class="wp-caption aligncenter" style="width: 310px"><a class="lightbox" rel="lightbox" href="http://gpsietzema.com/wp-content/uploads/2010/12/magento-template-path-hints.png"><img class="size-medium wp-image-6 " style="margin-top: 10px; margin-bottom: 10px;" title="Magento - Template Path Hints" src="http://peteralba.com/wp-content/uploads/2010/09/magento-template-path-hints-300x95.png" alt="Magento - Template Path Hints" width="300" height="95" /></a><p class="wp-caption-text">Magento - Template Path Hints</p></div>
<p><strong>Secondly</strong>, turn on the best feature of Magento: <strong>&#8220;Template Path Hints&#8221;</strong>. It fixes the most common Magento issue during theme development: &#8220;Where in my file tree do I find that block???&#8221;. Template Path Hints show you all the locations of your blocks in the front end of your shop. See the video below for a brief how-to.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="327" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/d5siD-7TM4o" /><embed type="application/x-shockwave-flash" width="560" height="327" src="http://www.youtube.com/v/d5siD-7TM4o"></embed></object></p>
<p>An extra useful tip would be to learn <a title="Learn Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a>. Magento is based on Zend Framework. Learning and understanding <strong>Zend Framework</strong> should make your Magento career a lot easier.</p>
<div class="shr-publisher-476"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2010/10/18/how-to-start-learning-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snel en eenvoudig thumbnails genereren met timthumb</title>
		<link>http://gpsietzema.com/2010/07/20/snel-en-eenvoudig-thumbnails-genereren-met-timthumb/</link>
		<comments>http://gpsietzema.com/2010/07/20/snel-en-eenvoudig-thumbnails-genereren-met-timthumb/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 12:26:59 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[dutch]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[thumb]]></category>
		<category><![CDATA[thumbs genereren]]></category>
		<category><![CDATA[timthumb]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://gpsietzema.com/?p=467</guid>
		<description><![CDATA[Bij zowat elke site loop je tegen het maken van thumbnails aan. Content managers moeten afbeeldingen uploaden en resizen. Dit gebeurt vaak uit tijdgebrek via de alom bekende WYSIWYG editor zoals TinyMCE. Hierdoor ziet de afbeelding er kleiner uit, maar qua bestandsgrootte blijft de afbeelding natuurlijk even groot. Een PHP script die hier uitkomst kan [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Bij zowat elke site loop je tegen het maken van thumbnails aan. Content managers  moeten afbeeldingen uploaden en resizen. Dit gebeurt vaak uit tijdgebrek via de alom bekende WYSIWYG editor zoals TinyMCE. Hierdoor ziet de afbeelding er kleiner uit, maar qua bestandsgrootte blijft de afbeelding natuurlijk even groot.</p>
<p>Een PHP script die hier uitkomst kan bieden is timthumb, één van de meest eenvoudige en effectieve thumbnail generator scripts.</p>
<p>Het enige wat je hoeft te doen is het PHP-bestand van timthumb (<a title="TimThumb op Google Code" href="http://code.google.com/p/timthumb/" target="_blank">hier te downloaden</a>) aan te roepen met enkele parameters:</p>
<p><code> src - bron van de afbeelding<br />
w - breedte van de afbeelding in pixels, bijv. 200<br />
h - hoogte van de afbeelding in pixels, bijv. 100<br />
q - kwaliteit van de afbeelding in procenten. Is standaard 75. Persoonlijk zet ik deze altijd op 100 (%).<br />
zc - zoom crop. Zet op 1 om te zoomen en te croppen in plaats van alleen maar te resizen/croppen.<br />
</code></p>
<p><strong>Een voorbeeld timthumb aanroep zou dan zijn:</strong><br />
<code>&lt; img src="timthumb.php?src=images/afbeelding.jpg&amp;w=250&amp;h=125&amp;q=100&amp;zc=0" alt="Afbeelding" / &gt;</code><br />
In het voorbeeld zal de afbeelding ‘images/afbeelding.jpg’ geresized worden, zonder te zoomcroppen, op 250&#215;125 pixels. De kwaliteit is op 100% gezet.</p>
<h2>Zoekmachine vriendelijk dankzij caching</h2>
<p>Na de bekendmaking van Google dat snelheid van websites ook meetelt als ranking factor, is het erg belangrijk dat het maken van deze thumbnail niet teveel resources in beslag neemt. Gelukkig hebben de ontwikkelaars van timthumb een caching-mechanisme ingebouwd zodat het aanmaken van de thumbs niet elke keer hoeft te worden uitgevoerd. De thumbnails worden gecached en standaard opgeslagen in het mapje thumbs, in dezelfde map als het script. Denk erom dat je de map thumbs genoeg rechten geeft (chmod 777 op de map zou voldoende moeten zijn) zodat er ingeschreven kan worden.</p>
<h2>Worden deze afbeeldingen wel geïndexeerd door zoekmachines?</h2>
<p>Jazeker! Google indexeert gewoon de meegegeven parameters (de belangrijkste is in dit geval “src” en zorgt ervoor dat de afbeeldingen afzonderlijk geïndexeerd worden. Het is geen verkeerd idee om in Google Webmastertools in te stellen dat de andere parameters genegeerd worden: w, h, q en zc.</p>
<p>Deze vier parameters hebben geen meerwaarde voor de zoekmachines en zorgen ervoor dat de parameter “src” meer waarde krijgt, al is het waarschijnlijk maar een miniem verschil.</p>
<p>Eerlijkheidshalve moet ik wel toegeven dat het optimaler zou zijn om de afbeeldingen als &#8216;/afbeelding.jpg&#8217; in de code te hebben staan i.p.v. &#8216;/timthubm.php?src=afbeelding.jpg&#8217; maar het is altijd beter dan de bekende afbeelding-namen die via een hash gegenereerd zijn.</p>
<h2>Conclusie</h2>
<p>Timthumb is een uitstekende oplossing om snel en eenvoudig thumbnails te maken. Zelf heb ik het zowel in MODx als WordPress installaties gebruikt en tot zover geen problemen ondervonden. Een aanradertje!</p>
<p>Timthumb is gratis te downloaden op Google Code: <a title="timthumb op Google Code" href="http://code.google.com/p/timthumb/" target="_blank">http://code.google.com/p/timthumb/</a></p>
<div class="shr-publisher-467"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2010/07/20/snel-en-eenvoudig-thumbnails-genereren-met-timthumb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress als CMS en webshop</title>
		<link>http://gpsietzema.com/2010/03/11/wordpress-als-cms-en-webshop/</link>
		<comments>http://gpsietzema.com/2010/03/11/wordpress-als-cms-en-webshop/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 20:12:19 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[dutch]]></category>
		<category><![CDATA[fragnstein]]></category>
		<category><![CDATA[muis]]></category>
		<category><![CDATA[ps3 controller]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://gpsietzema.com/?p=429</guid>
		<description><![CDATA[Voor bijna alle &#8216;normale&#8217; sites maak ik gebruik van het MODx CMS. De laatste tijd overweeg ik echter ook steeds vaker WordPress als CMS. Het is natuurlijk vanuit de basis niet bedoeld als CMS en het is voor websites met een complexe navigatie en veel templates ook niet optimaal, maar voor websites met een groot [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignleft size-full wp-image-430" style="margin: 10px;" title="FRAGnStein" src="http://gpsietzema.com/wp-content/uploads/2010/03/fragnstein-ps3-controller.png" alt="FRAGnStein" width="267" height="92" />Voor bijna alle &#8216;normale&#8217; sites maak ik gebruik van het <a title="MODx SEO CMS" href="http://modxcms.com" target="_blank">MODx CMS</a>. De laatste tijd overweeg ik echter ook steeds vaker <a title="WordPress blogging en CMS software" href="http://wordpress.org" target="_blank">WordPress</a> als CMS. Het is natuurlijk vanuit de basis niet bedoeld als CMS en het is voor websites met een complexe navigatie en veel templates ook niet optimaal, maar voor websites met een groot sociaal aspect vind ik het een ideale tool, met alle plugins die beschikbaar zijn. Daarnaast hebben we sinds kort een nieuw soort site waarvoor we WordPress gebruiken: 1-product-shops.</p>
<p>Zo hebben we met Sterc een nieuw product in de markt gezet, een <a title="FRAGnStein PS3 controller met muis" href="http://www.fragnstein.nl" target="_blank">PS3 controller met muis</a>. De site moest er knallend uitzien, de nadruk leggen op het product en een eenvoudig bestelformulier bevatten. Hiervoor hebben we een template ontwikkeld (met een eenvoudig bestelformulier) die we voor meerdere productsites gaan inzetten, naast de hierboven genoemde <a title="FRAGnStein webshop" href="http://www.fragnstein.nl" target="_blank">FRAGnStein shop</a>.</p>
<p>FRAGnStein heb ik zelf ook getest overigens op mijn PS3, die ik voornamelijk gebruik als <a title="PS3 als media server" href="http://code.google.com/p/ps3mediaserver/" target="_blank">media server</a> (echt een aanrader trouwens). Het is echt een verademing als je het vergelijkt met het spelen van een shooter met een controller. Richten hoort niet te gebeuren met een controller-pookje, maar met een muis, net als op de PC :) Modern Warfare 2 speel ik om die reden uitsluitend op de PC. Met Modern Warfare 3 zou dat zo maar eens op de Playstation 3 kunnen gaan gebeuren.</p>
<div class="shr-publisher-429"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2010/03/11/wordpress-als-cms-en-webshop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Framework debug bar!</title>
		<link>http://gpsietzema.com/2009/04/02/zend-framework-debug-bar/</link>
		<comments>http://gpsietzema.com/2009/04/02/zend-framework-debug-bar/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 21:17:35 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugbar]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://gpsietzema.com/?p=182</guid>
		<description><![CDATA[Finally, a debug bar for Zend Framework: Scienta ZF Debug Bar. It&#8217;s easy to install and I&#8217;m loving it! All it takes to install is: copy the scienta folder into your library add some code to your bootstrap and include your database connection run your app! Get the debug bar here, including installation instructions. Debug [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Finally, a debug bar for Zend Framework: <a title="Scienta Debug Bar for Zend Framework" href="http://jokke.dk/software/scientadebugbar" target="_blank">Scienta ZF Debug Bar</a>. It&#8217;s easy to install and I&#8217;m loving it! All it takes to install is:</p>
<ul>
<li> copy the scienta folder into your library</li>
<li>add some code to your bootstrap and include your database connection</li>
<li>run your app!</li>
</ul>
<p>Get the debug bar <a title="Scienta Debug Bar for Zend Framework" href="http://jokke.dk/software/scientadebugbar" target="_blank">here</a>, including installation instructions.</p>
<p><span id="more-182"></span></p>
<p>Debug bar example:<br />
<img class="size-full wp-image-183" title="2009-scienta_debugbar" src="http://gpsietzema.com/wp-content/uploads/2009/04/2009-scienta_debugbar.png" alt="Scienta debugbar" width="569" height="21" /></p>
<p>That&#8217;s it! Easy as pie. It will display a nicely styled debug bar at the bottom of your screen. It displays the following information:</p>
<ul>
<li>Zend Framework version</li>
<li>All variables (request and view vars)</li>
<li>Number of queries and the execution time of those (individually and the sum of all queries).</li>
<li>Full SQL of your (MySQL) queries</li>
<li>Peak memory usage</li>
<li>Execution time (including all the custom made scripts which were executed: your controllers, views, and (view) helpers.</li>
<li>Errors</li>
</ul>
<p>All these can be turned on and off in the bootstrap.</p>
<p>The debug bar already helped me speed up some of my Zend Framework apps. I noticed some describe queries in my app, which apparently <a title="Caching the MySQL PDO describe queries" href="http://sameerparwani.com/posts/using-zend_registry-as-a-zend_cache-backend/#more-83" target="_blank">can be cached</a>.</p>
<div class="shr-publisher-182"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2009/04/02/zend-framework-debug-bar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend_Currency performance issues</title>
		<link>http://gpsietzema.com/2008/12/23/zend_currency-performance-issues/</link>
		<comments>http://gpsietzema.com/2008/12/23/zend_currency-performance-issues/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 19:09:18 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[number_format]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zend_currency]]></category>

		<guid isPermaLink="false">http://www.nomark.nl/programming/php/zend_currency-performance-issues</guid>
		<description><![CDATA[I was working on an application which was using alot of number-formatting using Zend_Currency. I was using a view helper for this. The view helper looked like this: class Sterc_Helper_ToEuro extends Zend_Controller_Action_Helper_Abstract { public function direct($amount) { require_once('Zend_Currency'); $currency = new Zend_Currency('nl_NL', 'EUR'); return $currency->toCurrency($amount); } } There was a certain page which called this [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I was working on an application which was using alot of number-formatting using Zend_Currency. I was using a view helper for this. The view helper looked like this:</p>
<pre class="brush: php">
class Sterc_Helper_ToEuro extends Zend_Controller_Action_Helper_Abstract {
      public function direct($amount) {
 		require_once('Zend_Currency');
 		$currency = new Zend_Currency('nl_NL', 'EUR');
 		return $currency->toCurrency($amount);
 	}
}
</pre>
<p>There was a certain page which called this view helper about 10 times and the whole page took 12 seconds to load. I was initially looking at my MySQL queries, which caused some problems in this application before, but I was wrong. It was the view helper, containing Zend_Currency, which caused the problem.</p>
<p>To fix this problem, there is a caching option, which is documented <a title="Zend_Currency Documentation" href="http://framework.zend.com/manual/en/zend.currency.usage.html#zend.currency.usage.cache" target="_blank">here in the Zend Framework Manual</a>.</p>
<p>I was about to test this, when I thought of another really easy fix for this issue: use PHP&#8217;s <a title="PHP Documentation on number_format" href="http://nl3.php.net/number_format" target="_blank">number_format</a>. Why use an entire Zend Framework class when a PHP built-in function is available?</p>
<p>My new view helper looks like this:</p>
<pre class="brush: php">
class Sterc_Helper_ToEuro extends Zend_Controller_Action_Helper_Abstract {
      public function direct($amount) {
 		return 'â‚¬ ' . number_format($amount, 2, ',', '.');
 	}
}
</pre>
<p>My page load time dropped from 12 seconds, to 0.13 seconds. Not bad!</p>
<div class="shr-publisher-140"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2008/12/23/zend_currency-performance-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The joy of a simple SQL query</title>
		<link>http://gpsietzema.com/2008/12/05/the-joy-of-a-simple-sql-query/</link>
		<comments>http://gpsietzema.com/2008/12/05/the-joy-of-a-simple-sql-query/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 19:05:54 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.nomark.nl/diversen/the-joy-of-a-simple-sql-query</guid>
		<description><![CDATA[I was working on an application where I needed all unique brands from a mysql table to populate a HTML select box. I have no idea how to do that quickly with Zend_Table, so I found out you can just pass on your own SQL if you want. A simple &#8220;SELECT DISTINCT brand FROM products [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I was working on an application where I needed all unique brands from a mysql table to populate a HTML select box. I have no idea how to do that quickly with Zend_Table, so I found out you can just pass on your own SQL if you want.</p>
<p>A simple &#8220;SELECT DISTINCT brand FROM products ORDER BY brand ASC&#8221; will do in these cases. It would even be better if I had a seperate brands table, so I wouldn&#8217;t have this problem at all. But since this was a quick and dirty job, there was no brands table ;)</p>
<p>Anyway, these lines will do the job (where $db is an instance of your Db adapter):</p>
<pre class="brush: sql">
$statement = $db->query('SELECT DISTINCT brand FROM products ORDER BY brand ASC');
$this->view->brands = $statement->fetchAll();
</pre>
<p>Use foreach() in your view to display the list:</p>
<pre class="brush: sql">
echo '
<select name="brand" id="brand">';

foreach($this->brands as $brand):
    echo '
<option value="' . $brand['brand'] . '">' . $brand['brand'] . '</option>

';
endforeach;

echo '</select>

';
</pre>
<p>And that&#8217;s it!</p>
<div class="shr-publisher-133"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2008/12/05/the-joy-of-a-simple-sql-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View Helpers vanuit View Helpers aanroepen in Zend Framework</title>
		<link>http://gpsietzema.com/2008/10/31/view-helpers-vanuit-view-helpers-aanroepen-in-zend-framework/</link>
		<comments>http://gpsietzema.com/2008/10/31/view-helpers-vanuit-view-helpers-aanroepen-in-zend-framework/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 15:02:57 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[dutch]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[view]]></category>
		<category><![CDATA[view helper]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.nomark.nl/programmeren/php/view-helpers-vanuit-view-helpers-aanroepen-in-zend-framework</guid>
		<description><![CDATA[Ik zat vandaag met het volgende probleem: Er is een view helper (showMenu, te vinden in &#8216;/library/Sterc/View/Helper/ShowMenu.php&#8217;) die een menu genereert vanuit een database In dat menu moeten url&#8217;s worden gegenereerd Er was in het door mij gemaakte systeem echter al een manier om URL&#8217;s te genereren, namelijk een andere view helper (makeUrl) Probleem: je [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Ik zat vandaag met het volgende probleem:</p>
<ol>
<li>Er is een view helper (showMenu, te vinden in &#8216;/library/Sterc/View/Helper/ShowMenu.php&#8217;) die een menu genereert vanuit een database</li>
<li>In dat menu moeten url&#8217;s worden gegenereerd</li>
<li>Er was in het door mij gemaakte systeem echter al een manier om URL&#8217;s te genereren, namelijk een andere view helper (makeUrl)</li>
<li>Probleem: je kan niet even simpel $this-&gt;makeUrl() of iets dergelijks aanroepen</li>
</ol>
<p><strong>Oplossing:</strong></p>
<p>In principe is een view helper gewoon een class. Een class kun je gewoon aanroepen en uitvoeren vanuit bijvoorbeeld de view helper &#8220;showMenu&#8221;:</p>
<pre class="brush: php">
Zend_Loader::loadClass('Sterc_View_Helper_MakeUrl');
$url = new Sterc_View_Helper_MakeUrl();
$link = $url-&gt;makeUrl($linkId, 'page');
</pre>
<p>Kleine kanttekening hierbij is: De view helper staat dus hier: &#8216;/library/Sterc/View/Helper/MakeUrl.php&#8217;.</p>
<p>Zo simpel is het dus: 3 regels code, in plaats van de hele functie makeUrl in bijvoorbeeld de view helper ShowMenu te plakken.</p>
<div class="shr-publisher-128"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2008/10/31/view-helpers-vanuit-view-helpers-aanroepen-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nomark Textmate Theme</title>
		<link>http://gpsietzema.com/2008/10/29/nomark-textmate-theme/</link>
		<comments>http://gpsietzema.com/2008/10/29/nomark-textmate-theme/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 12:55:00 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[dutch]]></category>
		<category><![CDATA[textmate]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.nomark.nl/programmeren/nomark-textmate-theme</guid>
		<description><![CDATA[Textmate is mijn meest gebruikte editor, sinds ik een Macbook heb. Sinds gisteren gebruik ik nu ook mijn zelfgemaakte theme. Je kan hem hier bekijken. Het thema is geschikt voor PHP, HTML (met PHP) en JavaScript en zal ongetwijfeld worden gewijzigd om beter te werken met Zend Framework en jQuery, omdat ik dat dagelijks gebruik.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img src="http://www.nomark.nl/wp-content/uploads/2008/10/textmate-logo.png" width="140" height="140" alt="textmate-logo.png" style="float:left; margin-right:10px; margin-bottom:10px;" /><a href="http://macromates.com/" title="Textmate tekst editor voor OSX" target="_blank">Textmate</a> is mijn meest gebruikte editor, sinds ik een Macbook heb. Sinds gisteren gebruik ik nu ook mijn zelfgemaakte theme. <a href="http://www.nomark.nl/textmate-theme" target="_blank">Je kan hem hier bekijken</a>.</p>
<p>Het thema is geschikt voor PHP, HTML (met PHP) en JavaScript en zal ongetwijfeld worden gewijzigd om beter te werken met Zend Framework en jQuery, omdat ik dat dagelijks gebruik.</p>
<div class="shr-publisher-123"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2008/10/29/nomark-textmate-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Tips van PHP Guru&#8217;s</title>
		<link>http://gpsietzema.com/2008/10/02/10-tips-van-php-gurus/</link>
		<comments>http://gpsietzema.com/2008/10/02/10-tips-van-php-gurus/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 12:43:46 +0000</pubDate>
		<dc:creator>Gauke Pieter Sietzema</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[dutch]]></category>
		<category><![CDATA[nettuts]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.nomark.nl/programmeren/php/10-tips-van-php-gurus</guid>
		<description><![CDATA[Op NETTUTS (geweldige site btw) staat een geweldig artikel over het verbeteren van je PHP-code. Deze tips komen van echte PHP Guru&#8217;s, waaronder de oprichter van PHP en de oprichter van WordPress. Daarnaast zijn er nog 8 andere PHP prominenten die hun gouden tips geven over PHP. Ga naar het artikel &#8220;0 Principles of the [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Op <a href="http://nettuts.com" title="NETTUTS" target="_blank">NETTUTS</a> (geweldige site btw) staat een geweldig artikel over het verbeteren van je PHP-code. Deze tips komen van echte PHP Guru&#8217;s, waaronder de oprichter van PHP en de oprichter van WordPress. Daarnaast zijn er nog 8 andere PHP prominenten die hun gouden tips geven over PHP.</p>
<p><a href="http://nettuts.com/articles/10-principles-of-the-php-masters/" style="text-decoration: none;"><cite style="text-decoration: underline;">Ga naar het artikel &#8220;0 Principles of the PHP Masters &#8211; NETTUTS&#8221;</cite></a></p>
<div class="shr-publisher-110"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://gpsietzema.com/2008/10/02/10-tips-van-php-gurus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: basic
Database Caching 1/41 queries in 0.012 seconds using disk: basic
Object Caching 1427/1527 objects using disk: basic

Served from: gpsietzema.com @ 2012-05-21 07:30:49 -->
