viet4777 wrote:
Look into file com_fireboard/template/default/view.php
at line 471
if ($topicID)
modify it
if ($_lockTopicID)
It works fine.
Unfortunately that was not the complete solution. Because only the message that the moderator locks becomes "locked=1" in the database row, if an end-user browses to any other message, they are able to reply to it. This must be the source of other comments in this thread.
First off, my lines 467-470 in view.php now look like this:
$_lockTopicID = $this_message->thread;
$topicLock = $this_message->locked;
if ($topicLock)
It achieves the same as the above, but to me it's a bit cleaner.
The simplest solution I've found is to change the SQL update statements to lock every message in the thread.
In post.php (same folder), change line 1113 from:
//lock topic post
$database->setQuery("update #__fb_messages set locked=1 where id=$id"

;
to:
//lock topic post
$database->setQuery("update #__fb_messages set locked=1 where thread=$id"

;
and change line 1140 from:
$database->setQuery("update #__fb_messages set locked=0 where id=$id"

;
to:
$database->setQuery("update #__fb_messages set locked=0 where thread=$id"

;
An alternative solution in view.php would be to do a further query to find out whether the first message in the thread is locked, but I didn't feel like writing the code for that. This one will be efficient enough if the thread isn't hundreds of messages long.