Thread Ban [Paid] [Deleted]

  • Thread starter Thread starter Syndol
  • Start date Start date
I do not anticipate any issues as the add-on does not alter any XF tables.
Whenever threads are fetched, it simply adds a LEFT JOIN to check against the banned list.
I've PC'd you.
 
I just wanted to say that this has been an absolutely invaluable tool for us and works a treat for taking the heat out of tit-for-tat argumentative threads.

Can I confirm that this works okay in XF 1.2.1 (upgrading next week sometime) ?

Thanks,
Shaun :D
 
Getting errors with this. Having a thread redirected to another thread...

Code:
Error Info
ErrorException: Undefined index: isThreadBanned - library/ThreadBan/ControllerPublic/Thread.php:300
Generated By: anthony, 1 minute ago
Stack Trace
#0 /home/ptsdforu/public_html/c/library/ThreadBan/ControllerPublic/Thread.php(300): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/ptsdforu/...', 300, Array)
#1 /home/ptsdforu/public_html/c/library/ThreadBan/ControllerPublic/Thread.php(24): ThreadBan_ControllerPublic_Thread->_getBanNotice(Array, 'extended', false)
#2 /home/ptsdforu/public_html/c/library/AVForums/ModCheckpoint/ControllerPublic/Thread.php(7): ThreadBan_ControllerPublic_Thread->actionIndex()
#3 /home/ptsdforu/public_html/c/library/AnonymousPosting/ControllerPublic/Thread.php(7): AVForums_ModCheckpoint_ControllerPublic_Thread->actionIndex()
#4 /home/ptsdforu/public_html/c/library/XenForo/FrontController.php(337): AnonymousPosting_ControllerPublic_Thread->actionIndex()
#5 /home/ptsdforu/public_html/c/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/ptsdforu/public_html/c/index.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
  ["url"] => string(66) "https://www.myptsd.com/c/threads/trouble-with-diary-posting.36319/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
@Anthony Parsons,
You have two add-ons mentioned there.
I have tested it with Anonymous Posting and it works fine, so my guess is there is a conflict with ModCheckPoint.
Since that is a paid add-on, I'm afraid I don't have access to it in order to check things out.
 
Hi Syndol I've found a bug/addon incompatibility

Code:
ErrorException: Declaration of Merc_ProfileCompletion_DataWriter_Discussion_Thread::_discussionPostSave() should be compatible with ThreadBan_DataWriter_Discussion_Thread::_discussionPostSave() - library/Merc/ProfileCompletion/DataWriter/Discussion/Thread.php:15
Generato Da: Il Custode, 7 minuti fa

Code:
#0 /home/xfitalia/public_html/community/library/XenForo/Autoloader.php(119): XenForo_Application::handlePhpError(2048, 'Declaration of ...', '/home/xfitalia/...', 15, Array)
#1 /home/xfitalia/public_html/community/library/XenForo/Autoloader.php(119): XenForo_Autoloader::autoload()
#2 /home/xfitalia/public_html/community/library/XenForo/Application.php(1000): XenForo_Autoloader->autoload('Merc_ProfileCom...')
#3 /home/xfitalia/public_html/community/library/XenForo/Application.php(514): XenForo_Application::autoload('Merc_ProfileCom...')
#4 /home/xfitalia/public_html/community/library/XenForo/DataWriter.php(2012): XenForo_Application::resolveDynamicClass('XenForo_DataWri...', 'datawriter')
#5 /home/xfitalia/public_html/community/library/XenForo/DiscussionMessage/Definition/Post.php(47): XenForo_DataWriter::create('XenForo_DataWri...', 2)
#6 /home/xfitalia/public_html/community/library/XenForo/DataWriter/DiscussionMessage.php(1092): XenForo_DiscussionMessage_Definition_Post->getDiscussionDataWriter(778, 2)
#7 /home/xfitalia/public_html/community/library/XenForo/DataWriter/DiscussionMessage.php(597): XenForo_DataWriter_DiscussionMessage->getDiscussionDataWriter()
#8 /home/xfitalia/public_html/community/library/XenForo/DataWriter/DiscussionMessage.php(540): XenForo_DataWriter_DiscussionMessage->_updateDiscussionPostSave()
#9 /home/xfitalia/public_html/community/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_DiscussionMessage->_postSave()
#10 /home/xfitalia/public_html/community/library/XenForo/LikeHandler/Post.php(20): XenForo_DataWriter->save()
#11 /home/xfitalia/public_html/community/library/XenForo/Model/Like.php(236): XenForo_LikeHandler_Post->incrementLikeCounter(4616, Array)
#12 /home/xfitalia/public_html/community/library/XenForo/ControllerPublic/Post.php(372): XenForo_Model_Like->likeContent('post', 4616, 317)
#13 /home/xfitalia/public_html/community/library/ThreadBan/ControllerPublic/Post.php(62): XenForo_ControllerPublic_Post->actionLike()
#14 /home/xfitalia/public_html/community/library/XenForo/FrontController.php(337): ThreadBan_ControllerPublic_Post->actionLike()
#15 /home/xfitalia/public_html/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#16 /home/xfitalia/public_html/community/index.php(13): XenForo_FrontController->run()
#17 {main}

Code:
array(3) {
  ["url"] => string(48) "http://www.xfitalia.it/community/posts/4616/like"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(40) "/community/threads/sviluppatore-nkz.778/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}



Code:
ErrorException: Argument 1 passed to Merc_ProfileCompletion_DataWriter_Discussion_Thread::_discussionPostSave() must be of the type array, none given, called in /home/xfitalia/public_html/community/library/XenForo/DataWriter/Discussion.php on line 453 and defined - library/Merc/ProfileCompletion/DataWriter/Discussion/Thread.php:5
Generato Da: Il Custode, 1 minuto fa

Code:
#0 /home/xfitalia/public_html/community/library/Merc/ProfileCompletion/DataWriter/Discussion/Thread.php(5): XenForo_Application::handlePhpError(4096, 'Argument 1 pass...', '/home/xfitalia/...', 5, Array)
#1 /home/xfitalia/public_html/community/library/XenForo/DataWriter/Discussion.php(453): Merc_ProfileCompletion_DataWriter_Discussion_Thread->_discussionPostSave()
#2 /home/xfitalia/public_html/community/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_Discussion->_postSave()
#3 /home/xfitalia/public_html/community/library/XenForo/DataWriter/DiscussionMessage/Post.php(100): XenForo_DataWriter->save()
#4 /home/xfitalia/public_html/community/library/XenForo/DataWriter/DiscussionMessage.php(587): XenForo_DataWriter_DiscussionMessage_Post->_messagePostSave()
#5 /home/xfitalia/public_html/community/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_DiscussionMessage->_postSave()
#6 /home/xfitalia/public_html/community/library/XenForo/LikeHandler/Post.php(20): XenForo_DataWriter->save()
#7 /home/xfitalia/public_html/community/library/XenForo/Model/Like.php(236): XenForo_LikeHandler_Post->incrementLikeCounter(4616, Array)
#8 /home/xfitalia/public_html/community/library/XenForo/ControllerPublic/Post.php(372): XenForo_Model_Like->likeContent('post', 4616, 317)
#9 /home/xfitalia/public_html/community/library/ThreadBan/ControllerPublic/Post.php(62): XenForo_ControllerPublic_Post->actionLike()
#10 /home/xfitalia/public_html/community/library/XenForo/FrontController.php(337): ThreadBan_ControllerPublic_Post->actionLike()
#11 /home/xfitalia/public_html/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#12 /home/xfitalia/public_html/community/index.php(13): XenForo_FrontController->run()
#13 {main}


Code:
array(3) {
  ["url"] => string(48) "http://www.xfitalia.it/community/posts/4616/like"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(40) "/community/threads/sviluppatore-nkz.778/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Any thought to changing the name? The term "thread ban" could be a bit offputting - perhaps holiday or timeout or something like that?
 
The add-on is fully phrased. Simply change all relevant phrases to whatever you wish.
Not sure I wish to rename the add-on "Naughty Step" or anything like that :D
 
FYI
Please note that I will be away until the 25th of October.
I shall respond to any questions or reported issues upon my return.
Thank you.
 
Any chance you can add an option for the thread starter to thread ban other members posting in their threads? I plan on adding an Elite usergroup and would like to make this one of their perks.
 
Would love to see an option to ban a user from all threads containing a selected thread prefix?

I run a football forum and some members let frustration get the better of them in match day threads, having the option to ban users from any thread with a prefix 'match day' would be splendid.
 
Server error? Had one of these. Using 1.0.7 with XF 1.3.
ErrorException: Undefined index: thread - library/ThreadBan/ControllerPublic/Thread.php:22
Generated By: eireann10, Today at 9:15 AM

#0 /home/sites/avforums/public_html/library/ThreadBan/ControllerPublic/Thread.php(22): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/sites/avf...', 22, Array)
#1 /home/sites/avforums/public_html/library/AVForums/ModCheckpoint/ControllerPublic/Thread.php(7): ThreadBan_ControllerPublic_Thread->actionIndex()
#2 /home/sites/avforums/public_html/library/AVForums/Competitions/ControllerPublic/Thread.php(7): AVForums_ModCheckpoint_ControllerPublic_Thread->actionIndex()
#3 /home/sites/avforums/public_html/library/CTA/FeaturedThreads/ControllerPublic/Thread.php(7): AVForums_Competitions_ControllerPublic_Thread->actionIndex()
#4 /home/sites/avforums/public_html/library/XenForo/FrontController.php(347): CTA_FeaturedThreads_ControllerPublic_Thread->actionIndex()
#5 /home/sites/avforums/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/sites/avforums/public_html/index.php(13): XenForo_FrontController->run()
#7 {main}

array(3) {
["url"] => string(74) "http://www.avforums.com/threads/music-system-with-different-zones.1865523/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
@Stuart Wright - It would seem that one of the add-ons mentioned in your error is returning the template parameters without the expected thread index.
While I can easily make the error go away it will not explain why it is happening. Also I will then no longer be able to guarantee that a banned user will be blocked from viewing the thread.
Since you have a few paid add-ons there which I have no access to, I'm afraid there is no way for me to check for the reason.
Perhaps if you get the same member mentioned in the error to view that thread with my add-on disabled you will find out what template/message they were supposed to get which would provide a clue.
 
@Stuart Wright - It would seem that one of the add-ons mentioned in your error is returning the template parameters without the expected thread index.
While I can easily make the error go away it will not explain why it is happening. Also I will then no longer be able to guarantee that a banned user will be blocked from viewing the thread.
Since you have a few paid add-ons there which I have no access to, I'm afraid there is no way for me to check for the reason.
Perhaps if you get the same member mentioned in the error to view that thread with my add-on disabled you will find out what template/message they were supposed to get which would provide a clue.
Thanks David. More investigation here is in order.
 
Gents,

I just looked at this... Ever have one of those moments where you think o_O what the heck did I do that for?

Oddly enough it was none of the add-ons mentioned in the stack trace. I'll send you the updated files, Stuart.

@Syndol,

While debugging I did take a quick peek at your ControllerPublic/Thread.php. The issue here only happened during a thread redirect.

In 99.9% of cases your check to see if there is a params property in the parent object is fine. Except there are other add-ons which may set params wrongly when there is a redirect.

You may find it useful to protect yourself from this in future using this code instead:

PHP:
        if ($viewObject instanceof XenForo_ControllerResponse_View)
        {
            // Your code
        }
        
        return $viewObject;

This handles the case where it's a redirect instead of the view you're expecting - and basically protects your code from executing when someone else has wrongly set a param by themselves not checking if there's a view or not. I have reported such issues to add-on developers before, popular add-on developers, and I got ignored. So there's a chance you may see this crop up again.
 
Back
Top Bottom