Wakaba - pinned threads (10)

1 Name: Fashnek!JW.umfash. 2005-03-04 16:54 ID:XCTyigK2 [Del]

I added thread-pinning (floating, stickying, perma-aging) capability to my Wakaba implementation. It adds a new column in the databse, easy pin/unpin capability in the Management Panel, and a checkbox to pin new Manager Posts. Also, there is an indicator on pinned posts.

Would you like the code? I think it would be a nice feature to implement, and I'm honestly not sure if it's been brought up before. I figure that if you need a motivation to add it, perhaps a copy of what I did would help. :)

I should warn you, though, that this was my first time ever actually writing or reading a single byte of Perl code. :P But I think I did a pretty good job. It works nicely.

2 Name: !WAHa.06x36 2005-03-04 17:39 ID:0mcCsz98 [Del]

Well, leaving aside for a moment the fact that I am somewhat unsure if sticky threads are a good thing or not, the main problem is the database: Adding a field to the databse is easy for one single user, but requiring every user to add a field to their database to upgrade seems far too complex to do safely.

Sticky threads should be implementable without any database changes, though. For instance, define an arbitary and very large, timestamp as a "sticky" flag. The chronological sorting will put it at the top automatically, and the posting code could check for it and not update the timestamp if it's sticky.

3 Name: Fashnek!JW.umfash. 2005-03-04 18:14 ID:XCTyigK2 [Del]

I understand the databse concern. But (and this is an honest curiosity, I really have no idea) would it be that hard to just have an installation script to just check for and then add the extra column? I added mine with a single MySQL command (I forget what it was; this is also my first time using databases) without losing any data.

The way that my implementation worked was as follows: the column would be initialized with a 0 value. If and when a post was pinned, the "pinned" column would be filled with a timestamp for that moment. Its parent post or children posts (if applicable) would also receive this change. When a thread got unpinned, all the posts in it would simply be have the value changed back to 0.

I considered using a large timestamp for that purpose, but I decided that one benefit of using a seaparate column was that original sorting would remain intact. Removing the pinned status on a thread would put it right back where it belonged with no ambiguity.

Showing pinned threads at the top was simple; I just sorted with pinned timestamps having highest priority. This also allowed for more recently pinned threads to appear above older pinned threads, which was a desired effect.

4 Name: !WAHa.06x36 2005-03-04 18:22 ID:0mcCsz98 [Del]

Well, I do not have enough experience with MySQL to say what kind of database command to use that would work reliably across different versions. Also, Wakaba is designed to also support SQLite, and maybe other databases depending on demand, and figuring out how to do it for across multiple databases is too much of a bother, so I'm trying to avoid doing this.

If I'd had some forethought I'd have put in a column for extra metadata of various kinds, but I didn't.

5 Post deleted by user.

6 Name: Fashnek!JW.umfash. 2005-03-04 22:54 ID:XCTyigK2 [Del]

Thanks for the consideration and discussion. It's nice to know that you're so open to ideas. I really do love Wakaba, and I appreciate the work you've done.

I guess (for now, anyway) pinned threads will just be a unique feature on my little imageboard. Cool. ;)

7 Name: Anonymous 2005-03-06 02:35 ID:bf+SURmc [Del]

I saw this Idea on 4chan and I thought it is cool.

8 Name: Sling!XD/uSlingU 2005-03-06 10:08 ID:9QmudEHa [Del]

I saw those pinned threads on 4chan and thought it was lame.

9 Name: Anonymous 2005-03-06 13:53 ID:Heaven [Del]

10 Name: Anonymous : 2006-10-28 18:47 ID:Heaven [Del]

Name: Link:
Leave these fields empty (spam trap):
More options...