« Who needs PHP? | Main | Couldn't resist it. »

Monday, March 21, 2005

I need PHP!

I recently blogged about the relatively new XMLHttpRequest functions and how they can enhance the web browsing experience if used correctly.

I've used this technology to solve the forum marker quagmire that has plagued most bulletin boards since the dawn of time. Currently, IPB uses a mixture of methods to cobble together some kind of logic which is mixed between topics read, and topics posted since your last visit and stores the forum marker dates in a cookie. I won't go into why we do it like this but even after 4 years of writing bulletin boards I couldn't think of a better way of doing it without complex caches or queries.

Enter XMLHttpRequest!

I've done away with the cookies for a start and written an extra field in the member's table to store a serialized array of forum IDs and the last marked time. I've also done away with the "new posts since your last visit" confusion and all we're interested in now is purely unread topics.

Now, when you click on a topic link from the forum view (in other words, when you get the list of topics) an onclick handler checks to see how many topics in that display are newer than the last known marked time. If there is only one unread topic left in that display and its the one you just clicked on, an XMLHttpRequest is sent to the PHP engine which updates the member's serialized array in the database table.

Of course, there are a few cavaets. One being that if you have any unread topics on pages 2 or more, the forum will still be marked as read and if you click on the "last topic" from the board index, it won't mark the forum as read - however, its still a massive improvement and with a few other tweaks I'm going to make, manual forum marking should be a thing of the past.

Rikki and I have been bouncing ideas back and forth for most of the day and although the IPB 2.1 development schedule doesn't permit most of what we've thought up, IPB 3.0 should be a really nifty release.

March 21, 2005 | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83423035953ef00d83458686b69e2

Listed below are links to weblogs that reference I need PHP!:

» http://www.ee.ee from
[Read More]

Tracked on Apr 12, 2005 12:29:14 PM

Comments

So IPB 3.0 is next?
Well, hey, im all about nifty now.

Posted by: Cybertimber2004 and Cooldude7273 | Mar 21, 2005 8:46:09 PM

IPB 2.1 developement schedule doesn't permit? Come on Matt, now your trying to rush the developement and are pushing good features and improvements away?

Please take whatever time you need to squeeze in all the goodies, new features and board improvements. I don't want to wait until 3.0 haha.

Posted by: Logan | Mar 22, 2005 2:40:03 AM

It'd be nice if clicking the forum icon to mark the forum as read did not reload the page. >_<

Also it'd be great if you implmented XmlHttpRequest as a library on both the client and server-side and I can promise some good uses. ;)

Posted by: Chris Griego | Mar 22, 2005 4:43:55 AM

I been play around with the XMLHttpRequest and added a nice little check if username is in user for the registration form. I'm thinking about added if the user is not running a compatable browser then open a popup with a similar message.

Posted by: Munja | Mar 22, 2005 7:30:38 AM

"It'd be nice if clicking the forum icon to mark the forum as read did not reload the page."

Already in IPB 2.1. It changes the image to the unread marker and then sends an XML request to the PHP engine to update the member's forum marker array without refreshing the page or redirecting you to another forum, etc.

Posted by: Matt | Mar 22, 2005 10:32:02 AM

It sounds really fantastic and besides that it would solve some issues with dialup connections, it would also open some doors to better/faster user frontends. But it raises one question to me: wouldn't this cause much more traffic on the server's side?

I personally don't care much about traffic with the current worldwide broadband coverage and high datatraffic limits, but I can imagine it could cause financial problems for low budget boards.

Posted by: Franklin | Mar 22, 2005 12:12:15 PM

well it costs alot to run a good board software like develp it and update it. how much banwidth do yall think IPB uses


joshua johnson
http://www.centralgroups.com

Posted by: josh johnson | Mar 23, 2005 2:11:10 PM

"Rikki and I have been bouncing ideas back and forth for most of the day and although the IPB 2.1 development schedule doesn't permit most of what we've thought up, IPB 3.0 should be a really nifty release."

Awwww.... I must admit I'm torn between having all this coolness right away in the next version, or having that version come sooner, and waiting for the next next one for those features. Ah well.

Anyway, if you are going into 3.0 after 2.1 is released, that might well make IPB 2.x the shortest-lived forum out there... With a good reason of course ;)

So whatever path you choose, as long as these features (or even better ones :o ) end up in it at some point, I'll be happy ^_^

Posted by: TheBrain0110 | Apr 5, 2005 12:26:18 AM

Post a comment