Persistent Topic Marking

by Matt Mecham on April 28, 2005

Persisent topic marking has been something that’s often been requested across various forums. Until now, most systems relied on cookies to mimic a reliable system. To a point, this is fine but the usual problems with cookies plague the system; unreliable storage, easy corruption and them not being shared across computers.

IPB 2.0.0 introduced a semi-DB method where topics that you’ve read were added to a database but this didn’t do anything for forum markers which still relied on a mixture of cookies and your last visit date (which itself is problematic).

IPB 2.1 has a system where both the read topics and forum marker information is stored in the database.

Now, before you run for the hills shouting "bloat, inefficient, it’ll make IPB too slow!" – you might want to understand how the system works.

The system is based around Remco’s wonderful system for the Invision Blog software. It’s hard to convert the code into English, so I won’t bother. Suffice to say that it doesn’t take up much more resources than IPB 2.0.0s system and in fact, it’s probably a touch more efficient. Infrequently it needs to determine how many topics are unread in the forum and it runs a COUNT(*) query on the topics table. This is all indexed so full table scans, temporary tables and filesorts are all avoided. It doesn’t do this on every page view and I estimate that it will only do it for 10% of the topics you’ll read. It avoids the need to query the database for topics you’ve read which avoids a rather nasty ‘range’ query. I’ve also removed the filesort operation when in the forum view, so overall IPB 2.1 should be more efficient than IPB 2.0.3 even with this new marking system.

This system also means that you don’t have to view a forum first to get your unread topics synchronised. If there was only one new post/topic in the forum and you went straight to it from the board index and went back to the board index, the forum marker will be marked as read.

Naturally, for those who wish to squeeze every ounce of performance out of their board, this system can be switched off and it’ll go back to using cookies.

In other news, a less exciting use of Ajax has been implemented in the ACP. It’s rather basic at the moment, but it’s a nice little touch to avoid large page refreshes. I’ve included a little movie of this feature in action. I might make the final implementation much more fancy with each row written with a cross or other icon and convert it to a tick when it’s complete.

I think that there’s a fair bit of bandwidth to be saved using this method. Oh, and to that crazy guy over on the vB forums who is determined to prove that anything with Ajax in it is massively bloated and likely to crash your browser. Wise up, dude. It’s just a few lines of javascript, it’s not loading a java sized program into your memory.

I’ve also added a little movie of IPB 2.1’s wonderful new inline editing and moderation. It just doesn’t get easier than this to manage your forums.

ACP Ajax refresh (Quicktime .mov file, 1mb)
In-line moderation and editing (Quicktime .mov file, 4.8mb)
Working in the ACP (Quicktime .mov file, 5.1mb)

{ 24 comments… read them below or add one }

1 William April 28, 2005 at 1:55 pm

Update all caches with a single action… *drool*

2 jinzo April 28, 2005 at 2:06 pm

Yes. I am also liking 2.1. Your fingers (or hands) or something of your body must be exhusted from coding php/javascript all day (if you do that). ACP looks wonderful.

3 Cobay April 28, 2005 at 3:22 pm

27 new messages, huh?

4 Matt April 28, 2005 at 3:38 pm

29 now.

5 Dan April 28, 2005 at 4:05 pm

Nice stuff Matt!

You said you were most proud of the backend, now I see why!

6 Matt April 28, 2005 at 4:25 pm

I love my backend.

7 Dan April 28, 2005 at 4:35 pm

I’m sure everyone else will, when they see it.. lol.

8 mikee April 28, 2005 at 6:35 pm

Very nice additions. Especilly being able to close topics just by a click in topic view. Just wunderfull.

Matt, could you add the possibilty to edit one’s own profile by double clicking on the field ?

9 Phil Vessey April 28, 2005 at 6:58 pm

Hi Matt

Just a bit off topic but what program are you using to make the videos?

Phil

10 krocheck April 28, 2005 at 9:37 pm

Matt, the inline editing video blew my mind. Incredible stuff! I’ve had a vision in recent months about websites acting just like a piece of desktop software – no refreshing needed … getting there, that’s all I have to say.

You’ve done a wonderful job and I’m sure you and your coding will continue to blow my mind.

Keith

11 jinzo April 28, 2005 at 10:18 pm

Nice movies. dont’ give to many movies/screen shots of 2.1 now V_V.

12 Logan April 28, 2005 at 10:47 pm

I love it! I really can’t wait for this release…

Hopefully you add the “per admin section permissions” feature next, I don’t want you to leave that feature out.

13 jinzo April 28, 2005 at 10:52 pm

and for the 2.1 Roadmap could you move all of the completed features into one section (like the NEW FEATURES / MAJOR ENHANCEMENTS completed one after another) and all the 1’s commig later underneath then the one’s still left to do. it would make it much easier to know what’s completed and what’s not, and could you make the grey like blue, sort of hard to tell if something gray or not without closing your eyes (still open though). (altest for me).

14 Matt April 28, 2005 at 10:55 pm

[quote]Hopefully you add the “per admin section permissions” feature next, I don’t want you to leave that feature out.[/quote]

That’ll be in for sure.

15 Chad April 29, 2005 at 2:26 am

Quite honestly, I am not sure why that per-admin section feature was not added in the first place.
Possibly a feature that was not contemplated until now?
Either way, very nice.

Chad

16 Mez April 29, 2005 at 2:34 am

Why is the user management under “content management” shoudlnt it be under “admin2 *shrugs*

17 mikee April 29, 2005 at 10:39 am

[quote]Matt, could you add the possibilty to edit one’s own profile by double clicking on the field ?[/quote]

Or is there an easy way to achieve that now, with the completed IPB-ajax classes ? (are the topic fields checked, for lenght input for example ?)

18 Logan April 29, 2005 at 11:16 am

I would like to be able to “quick edit” posts by double clicking on their content if that was possible, and if it wasn’t hard have the RTE load as well.

19 Cybdertimber2005 and Cooldude7273 April 29, 2005 at 9:04 pm

RE: Double Click on post

Not liking that idea… maybe click a button below the post (like the current edit button?) and edit away without reload… but just click on a post? NO. Think of people with parkinsans (spelling?). Heck, I dont have it but I have gotten used to clicking on a window before using my scroll wheel because my window goes deactive after a bit :\
And I dont want to be looking at the topic log later and say “Huh.. I dont remember editing 14 posts here!”

20 Michael April 30, 2005 at 5:37 am

Logan, I think that would be taking it a little too far. It’s really not that hard to click the “Edit” button.

21 Logan April 30, 2005 at 3:14 pm

I guess, but I do like what cooldude and cybertimber suggested. Kind of like the mod that I use called “Quick Edit” where you can click a button and it opens a small window to edit the post.

I just think it would be more convenient, and since this release is really about “simplifying” things…

22 Think Systems May 3, 2005 at 10:38 am

Editing on click seems like a good idea, not important but a nice suggestion.

23 Dan May 3, 2005 at 11:25 am

I’d like to see that too… Being incredibly lazy and impatient, I tend to use Fast Reply a lot, so this would be ideal for me ;)

24 James May 3, 2005 at 5:47 pm

As Dan said… it helps for the lazy people.

Leave a Comment

Previous post: Well, that was a difficult day

Next post: My Assistant