SamuZai
Touhou-Project.com
Touhou-Project.com

patreon


Wait, there's feeds? What's a feed?

Hey all, hope you’ve had a good start to the year. While it’s been somewhat quiet for THP as of late, I’ve been able to spend some time working on the site’s code.

I was tempted to title this post something appropriately self-depreciating because the vast majority of what I got done probably only really matters to me or a lunatic few; tweaks here and there to the site’s appearance, for better clarity and consistency, and behind-the-scenes changes for the most part. Sure, there’s a new setting and maybe some will notice the more obvious modifications to the bottom of pages but changes to moderation action are far more subtle.

In the eternal war against spam there’s been a few small but significant alterations – for one, automatic bans caught by filters get progressively longer the more times someone has been banned. The front-facing buttons that moderators see when logged in should be clearer as well. And, behind the scenes, the code that checks whether or not a user is really qualified to delete a post or ban a user is slightly less obtuse.

As the rest of the changes on that front are equally riveting, I’ll move on to something else that no one really uses or cares about: RSS. The site has always had individual feeds for each board, meaning that one could subscribe to a feed and get the latest posts periodically and have them linked to their reader of choice. Save for some alterations a year or two on how this is generated by the backend, that aspect of the site has remained mostly untouched until now. I almost entirely overhauled the backend again, making both template and information generation more streamlined and with more information added into the process.

While actually sticking to spec is a pain and a half because of how limited RSS is (or atom, dublincore etc) I believe I’ve made the feeds be more useful. Better presentation for sure but also the addition of a feed for all posts is also handy to have. Not to mention actually taking into account things like the subject of a post or who posted it when it comes to displaying it in a reader. I’m satisfied how it’s turned out and the optimizations on the code-side are also good – there’s still room for improvement that I’ve noted down but that can wait for the time being.

I’ve also taken the time to streamline some of the various generator functions (like when outputting threads to files or making the RSS files) slightly. In particular, some duplicated calls to objects were eliminated and things like minification of output is done in a smarter fashion. It’s small potatoes, to be sure, but given how persistently messy the code remains in some places, every bit helps. I also used the opportunity to update other libraries the site depends on so we’re running the latest and greatest software™.

I could go on about other minor additions, appearance tweaks or improved compatibility for screens/devices of all sizes, but it’s not really worth the extra reading time. Instead, I want to use the rest of this post to what comes next.

After thinking about the roadmap of overhauls, changes, and improvements I’d like to see for THP I’ve decided to work on the moderation side of things. Particularly, the way privileges and different classes of users are treated by the system. I’ll obviously go into more detail in the future but there’s only two things that really matter right now: that part of the code is an absolute mess despite my trimming around the edges several times and integrating any new features with any hypothetical new user class would be a pain.

Too abstract? Well, I don’t want to commit to anything at this juncture. But say I wanted to give people the ability to accept story tag definitions or something like that without making them an admin/mod – there is no easy way of doing that without writing a system from scratch that’s outside of everything else that already exists. My general goal, aside from sorting out the mess that are those thousands of lines of code somewhat, is to make something flexible that I can later build on as I see fit.

I don’t really have a timeline of when such a thing would be done as it’s a rather large undertaking (about on par with a lot of the type of work that was needed for the storylist). I’d like to say that I’ll have it done in a month or whatever but I’m not sure yet. Yes, it’ll depend on free time and resources—as always—but also my figuring out how and exactly whatI’ll be doing. Still have to finish analyzing how everything works currently before trying to replace it or tear it down!

In all likelihood the next one of these technical posts will take a while but I might write about something else in the meantime. As always, if you have any thoughts, let me know in the comments or via discord (#vip needs its Ps to act VI, after all). Until next time, take it easy!


More Creators