• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest [Tweak] Locked Threads doesn't stop report button.

Carlos

Well-known member
#1
Recently I locked a thread where a member was trying to scold users into downloading a copy of MW3 on my forum.

This didn't stop the thread starter from reporting a post that I made saying that [that] thread is locked. I found it irritating.

The report button is supposed to be used for an open thread, informing a moderator or administrator of an open thread of some trouble.

Can we please disable reports on a LOCKED thread?
 

Fuhrmann

Well-known member
#2
There is a tweak to achive this, if you want.

Open the file library/XenForo/ControllerPublic/Post and find this:

PHP:
if (!$this->_getPostModel()->canReportPost($post, $thread, $forum, $errorPhraseKey))
Replace with this:

PHP:
if (!$this->_getPostModel()->canReportPost($post, $thread, $forum, $errorPhraseKey) || !$thread['discussion_open'])
 

James

Well-known member
#4
Probably be easier to tweak it in the templates rather than the code, unless you plan on using an event listener.
 

Fuhrmann

Well-known member
#7
But if I do it now it's going to be overwritten and then I have to come back to this thread and do it all over again.

Or, as James said, you could open the template post, find this:

Code:
<xen:if is="{$post.canReport}">
and replace with this:

Code:
<xen:if is="{$post.canReport} && {$thread.discussion_state} == 1">