Subscribe to PHP Freaks RSS

The creation of the new site

by Daniel on May 28, 2008 10:00:14 AM - 15,290 views

I thought that, seeing as this is a programmer community, the people who have not had the privilege to have access to the forums where these things were discussed or access to the code itself might be interested in knowing a bit about the underlying technology and code that powers this website. Besides, we need some content on the site ;) It is not possible to go really in-depth due to confidentiality reasons, so this will probably not be a particularly long post.


The site is built using Zend Framework which is my personal favorite PHP framework. The server is running CentOS with MySQL 5.0 and PHP 5.2.

Some of the code I wrote requires at least PHP 5.2. In itself that is no problem, but for some peculiar reason, the official CentOS repositories does not include the 5.2.x branch which meant we were stuck with PHP 5.1. First we considered compiling PHP 5.2.6 (current latest version) ourselves, but then I found a third party repository which included that version of PHP. You can find that repository at a site called Utter Ramblings.

Writing the code

A thing which had been wanted for a long time from the users was a unified login throughout the entire PHP Freaks. Therefore, the first thing to do was writing a login system which would use the existing user table of the forums powered by SMF. It was first considered to use SMF's SSI.php which is meant for integration with the forums. However, seeing as this would bind the site and the forums too tightly, this idea was dropped. ZF's Zend_Auth was instead used and the class PHPFreaks_Auth_Adapter_SMF was written. This also has the benefit of being able to switch to any other authentication system later if that should be needed. I think I read somewhere that SMF 2.0 will support OpenID, so perhaps that could be added to PHP Freaks when SMF 2.0 has been released and we have upgraded?

After users were able to login, it would be nice to be able to have a way to add additional information to the users' profiles, but for the reasons stated above, modifying the existing user table in SMF was not very good. Instead another user table was created and the two tables are being joined using a MySQL JOIN. The new table is populated on an on-request basis, i.e. a user profile is added when it is needed.

It was also necessary to control what users can and cannot do. For this purpose Zend_Acl is being used. The ACL is based on what group the user belongs to.

Users can now login using their existing credentials and it is possible to control their permissions using the access control list. This means that creating the actual features of this site was next: tutorials, blog posts and syndicated news. Along with those three content type, a fourth type, generic exists. An example of a such page could be the donations page. All of these four types would probably share much of the same logic, so they are placed in the same table and handled by the same controller.

That is essentially how you create a "PHP Freaks". Other important things that is used from ZF are: Zend_Feed for consuming external feeds for news syndication and for generating our own feeds, Zend_Form for form creation and validation, Zend_Db for doing database stuff, and others...

The layout

Initially a design made by John Kleijn was chosen. The site had been almost completed with that layout when the owner of PHP Freaks, Eric Rosebrock, decided that it should not be used after all. This lead to one of our other members, Jeff Combs, designing the layout and the new revamped logo. This design was then implemented, bug fixes were being made and code was tweaked. Eventually the site was launched (and bugs were fixed again and code was tweaked again).

Thanks to everyone who have helped with the creation of this site!


John Kleijn May 28, 2008 12:15:47 PM

I've said it before, and I'll say it again: Daniel you did a great job. Actually my exact wording was "My God Daniel! Don't you have work/school/whatever???". :) Anyway. My point is: everybody should be thanking you!

While we're giving members ' a look behind the scenes', and since you mentioned that Eric chose a different design than the staff voted on, thought I'd share the one that didn't make it with the general public.

GENERAL NOTE: If you like my design, I am of course flattered, but please, please don't start pointless discussion along the lines of <whiney>why cant we use that one?</whiney>, hmkay? It's a done deal, this is just for 'historical' reference. Also, I do intent to USE this design, so if you are tempted to steal it, be aware that I will send my two-headed hell hounds to hunt you down and rip you to easy-to-swallow pieces. That's all. Enjoy. ;)

This is what PHPFreaks would've looked like:

Daniel May 28, 2008 1:01:18 PM

I forgot to add that I used this awesome parser for the bbcodes:

DarrenL May 30, 2008 12:39:03 AM

Hi I really think you guys did a good job on the new site... it has a really nice look and feel plus the fact that you guys coded it with the Zend Framework is great.

Corbin Hughes May 30, 2008 3:26:07 AM

Hrmmm kind of interesting to know what the server is running and what you coded the site with...

Anyway, site looks great, and functions great ;p.

Eric Rosebrock Jun 1, 2008 12:36:07 AM

To all who have contributed, Thank You from the bottom of my heart. I'm tapped out really bad on a project right now and have not been able to contribute to this new site yet. The development has taken place without my assistance (code-wise) and the results are astonishing. I am very pleased with the new site and how clean everything is and how fast it runs. Very nice job!

I hope to be participating again soon, as I am back into the code and getting up to speed with all the latest and greatest that I have missed out on over the past couple of years while I was occupied elsewhere.

Again, nice job and Thanks!
Eric 'phpfreak' Rosebrock

jay3ld Jun 3, 2008 1:16:28 AM

Yes SMF 2.0 will support openID.

Congratulations on the new site though

Jonh Mark Oct 12, 2010 8:53:19 AM


Add Comment

Login or register to post a comment.