SamuZai
Touhou-Project.com
Touhou-Project.com

patreon


Thats's a Wrap!

Hey all, hope you’re doing well as this very long year finally wraps up. I have a few goodies to announce this time around. While the end-of-year period has been especially busy for me, I’ve still managed to get some work done on the site.

Let’s get the most complex feature out of the way: post editing. Yes, I hear you, anathema to an imageboard. But we’re not exactly a bog-standard imageboard. Our focus on, well, text sets us apart and probably every single writer has posted an update and then seen some dire mistake in their text. So, my solution? Allow writers to use the user page to edit their recent posts.

Only posts that are still deletable are eligible (so, currently, roughly a half an hour) and only those that have been marked as an update. Further limitations include a hard limit to how many times overall you may edit that post (no one should edit a post a dozen times in only a half hour!) and things like dice rolls cannot be changed if any cheeky soul wants to alter the odds. Other than that, if you respect the character limit, you can do whatever it is you wish with the option to revert the post to its original state whenever you wish.

In my (admittedly, limited) testing it’s a feature that works well. It’s somewhat technically complex as it required un-parsing a post from its stored state into the input field that we’re all familiar with. This isn’t as simple as simply reversing every step of the process as THP’s internal code does a lot, some of which doesn’t really apply to every post. I had to recreate some parts especially for this feature and rewrite existing code to optimize some bits and pieces. Overall, interesting to do but it required a bit of analysis and planning before I could even get to writing code. Of all the things I’ve rolled out, this took the most manhours to get just right. After all, even simple things like checking if you’re submitting the same text again requires a fair deal of transformation of data into equal formats.

But enough about my long weekends figuring that out. I did do some other things. Nice, quality-of-life things. Chief among them is a tiny little thing that sits at the bottom of story threads. It mimics the page switcher at the bottom of every board page. Its purpose is to allow easier navigation between related threads. In other words, it’s a little switcher for threads in a story.

This is something that I’ve wanted to implement for a while but spent a lot of time thinking of how to best do it. As most of the site is static (html), dynamically generating content requires user-side scripts. After all, I couldprint out related threads when a page is generated but, then, what about archived threads that never get updated? So I had to turn to Javascript. Even there there’s room for debate as to use semi-permanent storage (like json or xml) or simply to query directly from the database. I went with the latter, given that most of the data I wanted was exposed in a sensible manner due to the story list overhaul earlier this year. If a thread is in the story list, it’ll be picked up by the intermediary php code I wrote and be delivered asynchronously via JS. It’s not a perfect system and I would prefer to have something with better caching but, without overhauling most of the site, I think it’s an acceptable solution.

Another thing that might as well be mentioned is a small link at the bottom of each thread which opens the postbox if clicked. As more traditional forums have their reply boxes on bottom, it seems like it’d be something a little less confusing for new users. It can be disabled in the settings for purists and requires JS to show up in the first place. I didn’t want to duplicate HTML in every thread so, sorry, noscript users, but simplicity and ease of use wins yet again.

Now, I could go on about a bunch of minor fixes and enhancements. But that’s dull. Suffice it to say that I’ve put on quite a bit of polish and quashed a series of bugs with the latest rollout. There’s even been some changes to captcha challenges, making users who haven’t posted in some time (several months), or at all, have to fill out the portion to post. It’s a one-time thing that’s sort of put in on a trial basis but I hope will help cut down on some of the annoying spam I have to deal with from time to time.

I have plenty planned for 2021 and, once I decide just what to focus on, I’ll let you guys know what’s next. Hope you all have a comfy New Year and remember to take it easy!


More Creators