Currently Browsing: Web development

Snel en eenvoudig thumbnails genereren met timthumb

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 bieden is timthumb, één van de meest eenvoudige en effectieve thumbnail generator scripts. ...
read more

WordPress als CMS en webshop

Voor bijna alle ‘normale’ 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 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. Zo hebben we met Sterc een nieuw product in de markt gezet, een PS3 controller met muis. De site...
read more

Zend Framework debug bar!

Finally, a debug bar for Zend Framework: Scienta ZF Debug Bar. It’s easy to install and I’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. ...
read more

Zend_Currency performance issues

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 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...
read more

The joy of a simple SQL query

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 “SELECT DISTINCT brand FROM products ORDER BY brand ASC” will do in these cases. It would even be better if I had a seperate brands table, so I wouldn’t have this problem at all. But since this was a quick and dirty job, there was no brands table ;) Anyway, these lines will do the job (where $db is an instance of your Db adapter): $statement =...
read more
Pagina 1 van 512345