Back in May I remember seeing
a suggestion that moderators should leave some kind of an explanation post whenever they lock a topic...
I can't imagine that many mods
didn't think:
I remember a part of that suggestion jumping out at me, though:
But for locking a topic there's nothing to signify it was a moderator action.
At the time, I remember quickly skimming over the relevant bits of SMF's code and coming away with the (wrong) conclusion that it would be a bit too complicated to justify doing, so I stopped thinking about it.
Recently, while working on something else, I bumped into the following code-comment:
// A moderator-lock (1) can override a user-lock (2).
Seeing those integer values jogged my memory about this, and I couldn't quite remember why I had previously decided that exposing this information to the user would be difficult...
I guess I was on decaf, or something, because taking a fresh look at things, it's actually really simple.
So, I put together a largish patch (much bigger than the one I finally arrived at below) that adds a tooltip and makes the padlock icon (in all of the locations within SMF that it appears) a different color depending on the lock: blue when it's a user-lock, and copper/brown when it's a moderator-lock. But, playing around with that in my test environment, I couldn't shake the feeling that, while it does
look kind of cool, it's just not important-enough information to justify that kind of presentation/complexity: doing it all in a polished way, and one that wouldn't create any new problems/inconsistencies, leads to a fairly big/messy patch.
Reminding myself that this is information that nobody really needs to have at their fingertips, and it's just something that would be nice to be able to get to in
some way, I simplified the whole thing down to a 1-line change that exposes the information as a tooltip on that little pre-composited icon that appears at the top-left of topic pages:
Here's the diff for @theymos:
--- baseline/Themes/default/Display.template.php 2010-10-22 01:38:35.000000000 +0000
+++ modified/Themes/default/Display.template.php 2024-10-31 06:53:43.827818859 +0000
@@ -202,7 +202,7 @@
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
<tr class="catbg3">
<td valign="middle" width="2%" style="padding-left: 6px;">
- <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
+ <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt=""', (empty($context['is_locked']) ? '' : ($context['is_locked'] == '2' ? ' title="Locked by the topic-starter"' : ' title="Locked by a moderator"')), ' />
</td>
<td width="13%"> ', $txt[29], '</td>
<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
(The descriptions I settled on do make good sense, I think, but it's worth pointing out that they're not technically ideal. For example, if someone with moderation privileges locks their own topic, then you might expect it to read "Locked by the topic-starter" because, well, they are the topic-starter in that case, but, behind the scenes, the lock is recorded in the database as a moderator-lock, not a user-lock, so it'll read "Locked by a moderator". I guess, if you wanted perfectly symmetrical descriptions, then you could make them "Locked by a moderator" and "Locked by a non-moderator", or something, but that exchanges clarity for correctness in a way that doesn't really work, IMO. Anyway, I'll leave the language-finessing up to theymos.)