RSS - Latest posts Code Category

Home » Category » Code
13Apr
2009

Regex for Autolinking URLs

For a recent project I was wanting to perform an exceptionally common task. Converting things that look like URLs in the text into clickable links. However wherever I’ve seen this implemented before I’ve always encountered the same annoying problem, namely the links break when the user types a URL and adds some punctuation at the end since the punctuation gets captured as part of the link.

(more…)

Categories:

19Feb
2009

Improving Design by Using a Grid System

When I first heard of grids for design (and frameworks for CSS as a matter of fact) I was quite sceptical. Why limit yourself to a predefined outline? Mathematical precision in a creative process? Well needless to say I was surprised with the outcome.

Obviously you do tend to repeat certain pieces of code over and over in a project, but a framework? Behind a word like that usually stands a complex set of predefined elements. Though solid and reliable, these are often not very flexible and not easily modifiable. And the last two features seem to be crucial for projects that involve html and css. (more…)

Categories:

17Feb
2009

Zend Framework Decorators - Labels and Checkboxes

Very often it is the smallest things that annoy us the most. It took me a while to figure out why the placement parameter was not changing anything. I started of with the following:

'decorators' => array(
	array('Label'),
	array('ViewHelper')
)

(more…)

Categories:

28Dec
2008

Using Zend_Mail and Google SMTP to send emails

You can set this globally, for example in your bootstrap.php file:

$tr = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array(
	'auth' => 'login',
	'username' => 'YOUR_USERNAME@gmail.com',
	'password' => 'YOUR_PASSWORD',
	'ssl' => 'ssl',
	'port' => 465)
);
Zend_Mail::setDefaultTransport($tr);

(more…)

Categories:

12Nov
2008

Wordpress NextGen gallery tweak

Recently I found myself in that very anoying situation where a very good piece of software seemed to lack just this one function… again. I have been doing a gallery website and used the NextGen gallery plugin to display the photos. Unfortunatelly it was a case of a gallery per post with about 1 or 2 photos per gallery.

The biggest issue with this setting was the process of creating galleries. By default in NextGen you create the gallery on one page, upload the images in another, and then create new post yet elsewhere. But there had to be a way to at least merge the gallery creation with photo upload, especially considering a new gallery form consisted of a single “gallery name” field. (more…)

Categories: