Add www to your domain or remove the www from your domain
Posted on Tuesday 26 May 2009

This is important not only for aesthetic reasons, but for SEO (Search Engine Optimization). Forcing www before your domain or removing it prevents search engines from ending up with duplicate results and different page ranks per page. Some websites don‘t even return a page when you leave out the www. This depends on how your webserver is set up.
Multi-language support with Smarty
Posted on Wednesday 13 May 2009
Languages have always been a stumbling block for developers. With smarty you can make language files containing all the words that need to be translated and smarty will replace the language variables with the correct language. Smarty is also able to automatically check the browser language. I found this language class on the http://smarty.incutio.com/ website.
How to force plaintext insertion on paste in tiny_mce
Posted on Sunday 10 May 2009
Several clients of ours seem to type the text for their websites in a Word document fires and copy them afterwards in tiny_mce. Apparently tiny_mce copies the layout from word or any other program so the layout in your website gets messed up. I found a solution for this. You have to enforce pasting as plaintext which removes all markup when you paste something within tiny_mce.
copy these lines within your init function:
//force text to be pasted as plaintext
setup: function(ed) {
ed.onPaste.add( function(ed, e, o) {
ed.execCommand('mcePasteText', true);
return tinymce.dom.Event.cancel(e);
});
},
Getting started with Smarty templating
Posted on Thursday 7 May 2009

A few days ago I started using smarty. I was amazed by what you can do with this templating engine. Smarty is a templating engine written in php which allows you to easily split the PHP code from your html code. The smarty developers call it a "Template/Presentation Framework” because it‘s not just a tag replacing template engine. Templating is especially useful when you work with web designers who have little or no knowledge of PHP. They can easily change the html code in the tpl files without being bombarded with PHP code. I am a web developer and I started using a templating class which just enabled me to assign variables and blocks. I now use smarty for my CMS. It took me about 2,5 days to implement it because the templating class I used, worked completely different from Smarty. Smarty enables me to loop through arrays, use modifiers (which are basically custom PHP functions that work within smarty), cache files, debugging and so much more.
Add tweets and get latest tweets from Twitter using Twitter API
Posted on Monday 27 April 2009
This weekend I made a twitter module for our CMS. This was fairly easy to do. I included the files. You can download them below. I think the curl module has to be installed on your webserver to use it. You can get your latest posted tweet with the variable $last_tweet. To echo all of your latest tweets use the variable $twitter_tweets. It also includes a javascript file to limit the amount of characters. Twitter only allows tweets of 140 characters. Don‘t forget to change your twitter credentials on top of the index.php file. Change the $twitter_username to your username and the $twitter_psw to your password.
PHP XML sitemap generator
Posted on Monday 20 April 2009

Recently I came across a php script that automatically generates an XML sitemap.The script crawls through a website, searching for href‘s within the same domain. I‘ve altered the script a bit so it lets google know when a new xml sitemap has been generated. When your website changes a lot you should frequently update your sitemap. By using this sitemap generator you can do this without any hassle.
You can change the location of the sitemap within the index.php. Just alter the variable $filename to your location (line 451 or so). You should also change the paramater $url_xml in the pingGoogle function on line 494 to the full path of the sitemap (e.g. http://www.domain.com/sitemap.xml). Otherwise you‘ll get a 400 error on pinging google. Make sure sitemap.xml has write permissions, so chmod sitemap.xml to 777.