Steady March
Added 2021-10-16 23:48:26 +0000 UTCHey all, hope you’ve been well. I’ve been working on several things, both user-facing and otherwise and have progress to report. So let’s get right to it.
First off, I spent a deal of time tweaking some things on the moderation side of things. I noticed that in some cases when an image was banned (its md5 hash, more accurately), it wouldn’t be entered into the database properly. I sleuthed around trying to figure out why it would only sometimes do that and narrowed things down to deletions directly from the board as a mod (as opposed through the mod interface) and a few other cases would result in the error.
It’s a little boring to get into all the corner cases but the short of it was that the hash info was sometimes removed when the images were deleted in certain ways or they simply weren’t forwarded to the relevant parts. Hence, no info added to the database. So I traced back every possible way that an image or user could be banned and started to identify the problems in the code. If you’ve been reading these posts closely, you might have already guessed that a big part of the problem here were the older parts of the site’s codebase that behaved in unexpected ways.
So, to sort that out, I ended up simplifying, rewriting or just tweaking several hundred lines in a few of the longer classes in the board software. I was left scratching my head a few times as I didn’t understand why some of the bits of code were originally so overengineered; one of the parts that dealt with deletion assumed that multiple deletions by moderators could be called from a single click but such a feature was never implemented beyond a few disused parameters and blocks of (useless and incomplete) code. There was no need for a loop nor was there a need to write cases out verbosely when global variables (and others within the scope of the class) could be used instead.
This spring cleaning also saw me polish some of my own related additions, such as the file deletion by staff with lower authority and rework how some of the “instant” ban and delete buttons worked on the actual board pages when logged in. While there’s still a few things I’d like to tweak and polish in regards to deletions and bans, I think that things are working in a far more predictable and smooth manner. It can definitely wait until the next time I’m messing around with the moderation bits.
You might recall from a while ago that I did a big overhaul of the archives and standardized how the information was stored. Quick summary: it’s currently much easier for me to change or update these old threads to be in line with the rest of the site thanks to a lot of hours of effort. Having that ability is useful to make things consistent across the site and, thanks to that foundation, I was able to do a couple of neat things.
The most noticeable of these are the addition of navigation and settings menus to all archive pages. Not to mention our various board logos. Since archived threads are no longer “just” plain html files that have to be edited by script or manually, it only takes a few tweaks and several quality checks to make sure that it’s all working as designed. Things like making sure that all specially formatted text works the same way required only a mild amount of effort. As a lot of the site is interconnected, I found myself squashing a lot of long-standing minor bugs and annoyances.
Still, more importantly, I standardized the “id” of each post. Previously, a reply, the original post and others (like in really old threads) had inconsistent nomenclature. I could update it for the “current” site but archives would obviously be a pain to deal with before all of these reforms. Now it’s all uniform and that, in turn, allowed me to simplify some of THP’s scripts that had to account for all these special cases. Going forward, it’ll be easier to manipulate parts of pages since they’re all very similar under the hood now. I even went so far as to get rid a smaller, auxiliary, script that I kept for legacy compatibility since the new system supersedes it entirely.
While I was messing around with the scripts. I made sure to fix other bugs and make quality-of-life improvements. Many related to the archives, such as how highlighting or quote links (eg >>2214) work and are dealt with. Backlinks and embedding posts are notable that they’re far more consistent on what happens and issues related to nesting or breaking the flow are gone as far as I can tell.
The ongoing struggle to get the captcha system just right was also a beneficiary of all of this. I had already had some anti-necrobumping measures in place so I ended up dropping captcha for old threads and instead focused on preventing spam in more current threads. I changed some things on both the backend of the board software as well as the aforementioned user-facing scripts. I’m satisfied with the balance I struck between being aggressive enough to deter spam but also not being annoying enough to inconvenience normal users of the site; checks should be a little more seamless and the cases where no captcha appears at all are most likely gone completely.
There’s still some work left to be done on the captcha front but it’s low priority. Really, more than that, it’s more of a “fun” tangent for me to busy myself with whenever I have the time rather than a matter of functionality.
I could go on about small things here and there but what’s most interesting for you guys to know is that getting most of this out of the way allows me to work on cooler things down the line. More immediately, there will be a few visible changes to the user side of things in the next batch of changes. I think it’ll take me two weeks to a month to get things just right. And beyond that, I can already plan for more ambitious changes as I have a solid foundation I can continue to build off of. But all that is, as always, subject to change as I figure things out.
In the meantime, I hope you keep on enjoying using THP and using its features. The work is always worth it when the users have a good experience. Until next time, take it easy!
Comments
Makes sense. I wasn't sure how to parse that at first, but it seems obvious in retrospect.
Benjamin Oist
2021-10-19 00:15:44 +0000 UTCThey're generated from database entries if I need to.
Touhou-Project.com
2021-10-17 10:02:15 +0000 UTC>Since archived threads are no longer “just” plain html files that have to be edited by script or manually So, it's all like plain-text that's generated into HTML, or...
Benjamin Oist
2021-10-17 00:21:37 +0000 UTC