Sunday, April 16, 2006

PostNuke Auction Module

I'm going to write in a bit about the work I am currently doing to create a new module for the Slothmud III site that will be used for an equipment list, but first I wanted to brag a little about a module I wrote a couple of years ago based on the PostNuke CMS that is nominally and Ebay-style auction module. It has been up and running for a couple of years now and only has a couple of known bugs, but has several limitations.

Here are some of the features it has:
  • Integration with PostNuke CMS user tables
  • Automatic bid increments while bidder is away
  • Requires users to be registered in PostNuke
  • Allows user to select the time for auction to end
  • Allows a minimum bid to be set
  • Built-in support for internationalization
It's written for the SlothMud III game, so it has "gold coins" as the currency, but this can be easily be changed via configuration.

It needs a lot of features like:
  • Online Administration
  • Auction Search
  • Archiving Auctions
  • Feedback
It's got a couple known bugs that used to work in a previous version of PostNuke:
  • Closing an auction early if there are no bids
  • Editing an auciton if there are no bids
I like a lot of the core features within PostNuke and that is one of the reasons I went ahead and made this a module instead of trying to hack up someone else's auction script. Another annoying thing I found about other scripts was that most required some sort of fee.

I learned a lot of things from working on the module. The first thing is that the example modules that come with Post Nuke absolutely suck. They aren't documented and have no usable functionality to exemplify any best practices. There are about 30 ways to do anything in PHP/Post Nuke and there really should be some suggestions on what is at least unacceptable, much less is ideal.

The second thing I learned is that there doesn't seem to be much early benefit from doing any of the abstraction that is common in many of the other modules I have seen written in Post Nuke. There are two main types that I saw when I did it, internationalization support and database query abstraction. I think the big problem was that there is not a good MVC architecture example template.

The latest version of Post Nuke I have used (about 0.7.6) has samples that uses the pnRender engine and this seems to have a scripting language in it to create the view layer, but I still think there isn't a good example of a controller (the missing piece that at least I haven't seen).

In any case, when I work on the next module I may take a look at the pnRender system but I doubt I'll go through the effort of using it throughout the entire module since I haven't yet figured out it really is going to be useful.

No comments: