W3Counter 4.0: Getting Started

As you might’ve guessed from the comments in the screenshot in my Development Environment post, I was setting up to start this project.

W3Counter 12.23.2006

I’m making good progress so far. I started out with the Symfony framework 1.0-beta2 sandbox, which is an empty project and a copy of the Symfony libraries within the project folder, meaning it can all be zipped up and dropped into a hosting environment without external dependencies. I had to make a few edits to paths in the front controller to eliminate the need for the project to reside in a subdirectory as it’s set up by default.

I then created the database schema, which while similar to the one used by the hosted version, has a couple extra tables to manage new features (such as multiple users per install, and user roles with per-website granularity), and doesn’t create new tables on the fly as the hosted version does. I let Symfony’s command-line interface take my schema definition and build a database access layer out of it, as well as CRUD screens for the objects. I filled in the routing rules and created stub methods for all the controller actions I expect to need.

While it’d be more exciting to start on the new features I want to implement to make this competitive with new services like CrazyEgg and FeedBurner’s new Blogbeat integration, I’m starting with the core functions and building up from there.

Normally interface design doesn’t come first, but I just can’t work on a project if it doesn’t look good, so you can see a screenshot above of what the interface looks like now. I fully implemented a navigation controller that builds the menu from my list of routing rules and highlights the current location. I also built some reusable components for choosing date ranges (and made use of the Script.aculo.us JavaScript library for the first time to slide-in a custom date range entry area when chosen), and for encapsulating database result sets along with paging information.

Symfony comes bundled with Propel for database access, which provides ORM mapping and Criteria based object selection. Unfortunately most of my database queries, which won’t change much between the hosted version and the new one, don’t map well to Criteria. It’d take hours and hours to try to rewrite them if even possible; they usually involve many self-joins, subqueries, and grouping. Even if I get the Criteria working, Symfony’s built-in paging object doesn’t work well with queries that involve grouping, so I had to scrap that anyway. I went instead with a custom class which encapsulates the data as a simpler multi-dimensional array with some additional information about the result set to provide easy paging.

The next step was to implement an authorization module. I started out with a plugin from Symfony called sfGuard which is supposed to be drop-in user and role management for any application, but found it wasn’t easy to adapt to what I wanted to do with per-website access levels. I removed that and wrote my own auth module; basic login/logout with cookies for persistent logins. Symfony still takes care of most of the work in deciding when to send someone to my authorization controller for login, letting me specify what parts of the application require authorization and various credentials in a configuration file.

W3Counter Login Screen 12.23.2006

I think my next step will be to try implementing an HTML-only charting class to use for the dashboard in the first screenshot. I can’t use the same Flash charts as I do in the hosted version as I’d need to purchase a very expensive licensing contract to distribute those (the single server license was much more affordable). If I can’t get something nice working I may have to go back to generating charts as images with the GD library as I did with the original W3Counter. They did look good, but it’s extra coding for me and rendering time for the CPU I wanted to avoid.

If anyone knows of a free, redistributable Flash chart component set, I’d love to know.

More from this category

  • http://www.site.ru AltaGid

    Hello! Help solve the problem.
    Very often try to enter the site, but says that the password is not correct.
    Regrettably use of remembering. Give like to be?
    Thank you!

  • http://wwwwww.com Anikrichard

    hello , my name is Richard and I know you get a lot of spammy comments ,
    I can help you with this problem . I know a lot of spammers and I will ask them not to post on your site. It will reduce the volume of spam by 30-50% .In return Id like to ask you to put a link to my site on the index page of your site. The link will be small and your visitors will hardly notice it , its just done for higher rankings in search engines. Contact me icq 454528835 or write me tedirectory(at)yahoo.com , i will give you my site url and you will give me yours if you are interested. thank you

  • http://financial-tips.biz.ly DavideCornL

    Transferring Credit card balance is a good way of minimizing credit card debt, and can also be a way out of the burden of debt. In detail:0 balance transfer

  • http://how-to-burn-dvd.com accickperlicy

    I want to share this tip:

    I know there is someone out there like me that tried and failed to download movies and http://how-to-burn-dvd.com – Burn DVD’s from the internet that play on a regular DVD player.

    Thanks,

  • http://car777.prohosts.org BruceZuritaHonda

    If you are interested in cars, then this information is useful to you o Look club car pe

  • http://mydomain.com esopychomporo

    subj
    ?

  • Speerevot

    Your site was so interesting and informative I had to call a friend to tell her about it. Great work
    my jewelry siteslisst

  • http://myblog.es/workinhomeonline stewartfunk

    Finally a real online business that brings in a couple hundred a day with some effort

    As your sitting there reading this stop and now convince yourself to feel more excited to finally find the only…….

    “No bullshit review of real online business oppertunities.”

    Finally we scoured the internet for countless and countless of hours. Searching for the top oppertunities out their. After finding only a select few that meet are strict criteria for making real money every month.”

    “We decided to test these business programs out ourselves. To see if they were really as good as they say they are. After 8 months of testing and comparing. What was left was only the best oppertunity for making real money monthly with some effort on your part you’ll find to date.”

    Now as your feeling more curious Stop and Click here to uncover the ultimate program Available to date!!

    work in home online