Archive | frameworks RSS feed for this section

Digital Base v3 – Launch

14 Dec

I am proud to announce we launched our new website. On this website you’ll find a detailed portfolio & more about us. Although there is still alot of work todo (optimise css/xhtml, w3c validation, content correction). Check out our site in english & dutch

Propel / Pager / Datagrid

15 Dec

Because we are using propel in most of our larger projects, it’s very common we need a datagrid for the listing of the objects. A year ago we made a datagrid with the most important features combined with an ajax approach (sorting, filtering…), for the ajax functionality we wrote our own javascript function calls, what led to alot of unmanageable code, both javascript and php.

As time moved on, this loading of the datagrid became slower and slower (due to increasing objects, about 9000 records with multiple joined tables). This was mainly because the old datagrid first loaded all objects, and then sorted the entire array by the columns as defined by the user….don’t tell me..i know ! This is a bad approach, that means all records get looped, and if you are using propel that would mean for each of those 9000+ records an object is created…that’s crazy…(it has some advantages though)…

So now i finally found some time to do a total rewrite of this datagrid, combined with the power of the propel pager, propel criteria & the php/ajax framework xajax, i came up, faster then expected, with a powerfull scalable datagrid that only loads the visible records. All switchpages, sorting & filters call a corresponding ajax function. These functions change the criteria in the object and reload the datagrid. I’ll elaborate on this later, by showing you some code and perhaps an online example.

Internationalization – seo – mod_rewrite : Part II

2 Aug

As a follow-up to my previous post (Internationalization – seo – mod_rewrite : Part I). If you followed my previous instructions, by now you should be the proud owner of a ‘google sitemaps‘ account and your webhost supports statistics that can tell you when a crawlbot visited your website (or raw logs, if you’re a sherlock holmes type).

Because you are reading this howto, i can conclude you have a website running on a domain or atleast a subdomain. For multi-language systems i prefer using the subdomain to set the language of the user. So if you were using www.mydomain.tld/index.php?lang=en before, you will now be using en.mydomain.tld. For a website with multiple languages that would become :

  • www.mydomain.tld : would point to the default language, or will relocate the user based on browser/os/nslookup (whatever you prefer)
  • en.mydomain.tld : would point to the website in english
  • fr.mydomain.tld : would point to the website in french
  • X.mydomain.tld : would point to the website in …

If you are using a subdomain this could be done with en.subdomain.mydomain.tld etc….
This way of working has some advantages :

  • users will be able to bookmark directly in their language.
  • Search engine optimalisation can be targetted on subdomains seperately
  • crawlbots will easily know which language they are crawling (also due to tag)

Step 1 : Set up your nameserver records

Make sure the A records all point to the same adress, i prefer setting a records for all different languages as i do not want to point *.domain.tld to the website (for various reasons). As this is not a dns administration guide, try to find more information in the docs of your dns daemon, but before doing that check if undefined subdomains do not already point to the same ip as your main domain, this could be the case and then no configuration is needed…

You can check this by doing :

 ping mydomain.tld

Compare the result ip adress with a ping to a subdomain :

 ping en.mydomain.tld

If both ip match, you will most probably have the right nameserver configuration already, you can go straight to step 2.

Step 2 : Make sure the webserver catches the subdomain

As i am using apache only at this moment, i will only explain you briefly how to do this in apache, for all other webservers check the documentation. Try to look for the virtualhost directive of your domain in the webserver configuration, by default this will be in /etc/httpd/conf, searching for httpd.conf, apache.conf or apache2.conf will tell you where it’s located…If you split up your virtualhost directives in different files, you are most probably clever enough to find your virtualhost directive, if you didn’t check the bottom of your configation file, there should be something like this :




  ServerName yourdomain
  DocumentRoot "/path/to/your/webroot"
  DirectoryIndex index.php
  
   AllowOverride All
   Order allow,deny
   Allow from All
  

Add a serveralias, so apache knows to catch the subdomains, there are 2 ways of doing this, you can add a ServerAlias for all different languages, or you could add a * alias, so from now on apache will catch all unknown subdomains for this domain.

Option 1 : Catch only the subdomains i want




  ServerName yourdomain
  ServerAlias language1.yourdomain
  ServerAlias language2.yourdomain
  DocumentRoot "/path/to/your/webroot"
  DirectoryIndex index.php
  
   AllowOverride All
   Order allow,deny
   Allow from All
  

Option 2 : Catch all subdomains




  ServerName yourdomain
  ServerAlias *.yourdomain
  DocumentRoot "/path/to/your/webroot"
  DirectoryIndex index.php
  
   AllowOverride All
   Order allow,deny
   Allow from All
  

Save your virtualhost config file, or main webserver configuration file and restart your webserver

 apachectrl -k restart

More information on setting Apache virtualhosts serveralias’es.

You should now be able to see the same website you had before, using the lang.mydomain.tld subdomains, if this is not the case, check your include paths etc….I have to stop this howto for now, we will go the the coding itself in Part III

My first project in Symfony

11 Jul

I’ve started on a project using a very good framework i am pleased about. If you take your time to have a look around on the website, you can clearly see this is a framework with alot of documentation, one of the major requirements for selection (in my case).

I decided to give it a go and use the framework on my latest project for EuPR (www.plasticsrecyclers.eu), as the timeframe for this project was quite limited, i needed a good framework, with plenty of documentation to solve the issues i would run into…

A snippet from the symfony about page :

Symfony is a web application framework for PHP5 projects.

It aims to speed up the creation and maintenance of web applications, and to replace the repetitive coding tasks by power, control and pleasure.

The very small number of prerequisites make symfony easy to install on any configuration; you just need Unix or Windows with a web server and PHP 5 installed. It is compatible with almost every database system. In addition, it has a very small overhead, so the benefits of the framework don’t come at the cost of an increase of hosting costs.

If you want to have a look at the results, go over to plasticsrecyclers.eu, i implented a login form, upload functionality (in different categories and a pager to browse through the various results of newsletters & documents…Keep in note that this is a “non-released” website still open for feedback & improvements….

Whatta ya think ?

Internationalization – seo – mod_rewrite : Part 1

10 Jul

I am running a pretty big company website that uses multiple languages so users can browse the website in their language. Lately i have been working on the Search Engine Optimalisation, and i noticed google (and some other crawl bots) do not correctly crawl the other languages, this had something todo with various reasons :

  • language selection was saved in session or by $_GET argument
  • meta language tag was not always set
  • there was no clear line how the language was selected, user couldn’t see by url which language he selected

I did a few lookups on the internet, some various SEO forums, and i’ve collected this information and, with the help of Apache mod_rewrite, turned the website into a fancy, easy-to-use, multilanguage environment, and this is how i did it. I will explain you in 3 different parts, which i will try to finish in the upcoming 3 days….

To start off i am using .xml files to hold all the different language strings, nowadays you can find some php frameworks that fully support i18n, but back in the days i was making international websites, they were not that commonly available. If you would go for a framework i would choose Mojavi, Prado or Symfony, i am not going to elaborate on that, as this post is not about frameworks, but howto put different languages on your website, and making sure google (and other search engines), crawl em like they should….

Start off by making sure you have a google sitemaps account and have a way to gather website statistics, very good would be a package where you can list the crawl bots seperately (i prefer awstats)

Sitemaps what/where went wrong when crawling your site. The Google Sitemaps program has two major components:

I’ll leave you the time to make sure you have both of the above items + it’s a really nice excuse to stop writing and do something else…Part II soon…

Awstats

Prado v3.0 alpha edition is out

25 Jan

I just got a very nice email concerning the release of an update of my favourite MVC php framework.

We are very pleased to announce that PRADO 3.0 alpha version is now available for downloading. Please use PRADO v3 discussion for topics about this v3 alpha release. We are working on a new website at pradosoft.com which will be available upon v3 beta release.

I got the 3.0a version just 5 minutes ago, because i am starting a new project with another user registration / signup, i decided to give prado a shot. Very nice is the v3 quickstart tutorial, the guys over at xisc realize how important it is to have good user documentation / sample applications.

I used prado v2 before to develop a small intranet, and back then the petshop example (available by CVS) helped me quite alot trying to figure things out…and it seems like they are putting a big effort into documentation once again. Another big advantage is that prado has a good / friendly community, decent questions on the forum get a fast reply, and also developers are hanging around to help people as much as possible, keep up the good work guys ! i’m with ya !

Go get it over at xisc.com