Author

Topic: Determining a topic's lock-type (SMF patch) (Read 280 times)

hero member
Activity: 1036
Merit: 933
Find your Digital Services at- cryptolibrary.pro
November 10, 2024, 04:11:33 PM
#16
Achievement unlocked, inspire PowerGlove Grin
Grin Grin Grin
And now what about another mission for the "moved topic"?

As this topic was on "Beginners & Help" board but now it moved to "Hardware" board, the question is who moved here mod or the topic starter?



hero member
Activity: 510
Merit: 4005
November 02, 2024, 06:42:04 AM
#15
Added, thanks!
Nice. Thanks, theymos. Smiley

While I've got you, there's a line in Themes/default/languages/Errors.english.php that looks like this:

Code:
$txt['smf31'] = 'This was locked by an administrator. You cannot unlock it.';

Maybe you can change that to one of the following:

Code:
$txt['smf31'] = 'This was locked by a moderator or administrator. You cannot unlock it.';

Code:
$txt['smf31'] = 'This was locked by a moderator. You cannot unlock it.';

(That error message, as it currently stands, gives off the impression that there's something even stronger than a moderator-lock: an administrator-lock. But, I can't find such a thing in 1.1.19.)



@PowerGlove this was probably the fastest patch to be approved and added.
I haven't checked but you're probably right. (I think the quoting-from-locked-threads one was same-day, too.)



Time for a moderator to lock this topic, so we know it works Tongue
Haha, yeah. Cheesy



I know it's not caused by your patch, but does this mean that a Mod who loses his Mod status after he locked his own topic can't unlock it anymore?
Yup, it does. (Nice catch, BTW.)

What it comes down to is that, when locking a topic, SMF first tries to do it on the basis of allowedTo('lock_any') before allowedTo('lock_own'). So, even in cases where the lock could've been recorded in the database as a user-lock (2) rather than a moderator-lock (1), it isn't. I can see what'd need to change logic-wise in LockTopic.php to fix that, but it's a slightly hairy change (it looks deceptively simple, but it's actually kind of tricky to do in a completely clean way), and I don't know that fixing it at this point would be worth it.



Achievement unlocked, inspire PowerGlove Grin
Grin Grin Grin
legendary
Activity: 1862
Merit: 5154
**In BTC since 2013**
November 01, 2024, 02:10:54 AM
#14
Quote
So 2 pages is "hot" and 3 or more is "very hot". SMF developers didn't expect a lot of pages.


 Cheesy

Mega topics were not expected. Because as we all know, there are few mega topics that don't really end up being offtopic or spam.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
November 01, 2024, 01:49:46 AM
#13
Because the three pages are not related to blocking, but rather to the number of posts a topic has.
That makes sense. PowerGlove's screenshots made me think it had a different meaning.

Quote
So 2 pages is "hot" and 3 or more is "very hot". SMF developers didn't expect a lot of pages.
legendary
Activity: 2422
Merit: 1451
Leading Crypto Sports Betting & Casino Platform
November 01, 2024, 12:44:53 AM
#12
Achievement unlocked, inspire PowerGlove Grin
Thanks! The definition of "be the change you want to see in the world".  Cheesy
legendary
Activity: 1862
Merit: 5154
**In BTC since 2013**
Why does my locked topic show 3 "pages" behind the lock, instead of 1?

Because the three pages are not related to blocking, but rather to the number of posts a topic has.
The difference is, when you hover the mouse over the icon, the message appears.

Look at this case: https://bitcointalksearch.org/topic/make-300-per-day-free-quit-your-job-futures-trading-5507647
Closed by moderator, only 2 pages icon.

copper member
Activity: 3948
Merit: 2201
Verified awesomeness ✔
Why does my locked topic show 3 "pages" behind the lock, instead of 1?
According to the icon URL, your topic is very hot (and locked). There is also a regular hot variant (and locked).
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
October 31, 2024, 04:19:31 PM
#9


Why does my locked topic show 3 "pages" behind the lock, instead of 1?

Quote
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 know it's not caused by your patch, but does this mean that a Mod who loses his Mod status after he locked his own topic can't unlock it anymore?
copper member
Activity: 3948
Merit: 2201
Verified awesomeness ✔
October 31, 2024, 03:34:58 PM
#8
Time for a moderator to lock this topic, so we know it works Tongue
legendary
Activity: 1862
Merit: 5154
**In BTC since 2013**
October 31, 2024, 02:51:06 PM
#7
@PowerGlove this was probably the fastest patch to be approved and added. Congratulations!

Added, thanks!


There's not much point in giving my opinion, but I think it's an adjustment that makes perfect sense.
The advantage of only changing one line of code, which does not affect anything else, allowed this speed.
administrator
Activity: 5222
Merit: 13032
October 31, 2024, 02:41:09 PM
#6
Added, thanks!
legendary
Activity: 2254
Merit: 2406
Playgram - The Telegram Casino
October 31, 2024, 12:59:07 PM
#5
I have not come across many situations where I need to use this, but it can be helpful to know and will point out what actions or inactions will make the mods lock your thread, added advantage if the code just slots right in without distorting anything else.

Topic authors of topics locked by admins or moderators know the reasons, without the SMF patch, because they can not unlock these threads. If they try to unlock, they will see a following message.
Without trying to unlock the thread, a user should be almost 90% sure they were not the ones who inadvertently locked their own thread.
hero member
Activity: 840
Merit: 522
October 31, 2024, 06:26:33 AM
#4
I liked it. If community support has any means to theymos, then I would give it a vote to implement it. Thanks, Powerglove for another patch. Finally, some controversy is coming to an end, or probably it will open another door to create more forum drama. Whatever is going to happen, the patch is still helpful for the community. We have seen a couple of threads before that threads are getting locked on the gambling board but we didn't know who locked it. Sometimes, forum drama happens on the reputation board too. Either this patch will fuel them, or stop them.
hero member
Activity: 1442
Merit: 775
October 31, 2024, 03:45:32 AM
#3
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:
Your SMF patch is helpful for forum members to hover their mouse on the icon and see who locked a topic, the topic author or forum moderator, admin.

Topic authors of topics locked by admins or moderators know the reasons, without the SMF patch, because they can not unlock these threads. If they try to unlock, they will see a following message.

After the moderator or administrator closes the topic, the creator of the topic can not unlock it. If the creator tries to unlock the topic, he will receive a message:



Generally your SMF patch is helpful, and I hope theymos will use it.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
October 31, 2024, 03:31:03 AM
#2
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:

Search engines would love this sort of information. it would allow them to determine which posts are permanently archived so that they don't have to keep crawling them to check for updates.

Although I am not expecting Google et al to jump on this, but it is more useful for the hobbyist search engine implementations and designers out there to make indexing slightly faster.
hero member
Activity: 510
Merit: 4005
October 31, 2024, 03:10:01 AM
#1
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:

Code:
// 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. Cheesy

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:

Code:
--- 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 @@
 
 
 
 
 

-
+
 
', $txt[29], '

(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.)
Jump to:
© 2020, Bitcointalksearch.org