Resource icon

Create Thread on warning 1.2

No permission to download
  • Thread starter Thread starter ragtek
  • Start date Start date
Just had my first warning since installing this and the thread that got created was called "ragtek_tow_profile_posttitle" and the content was "ragtek_tow_profile_posttext"
yes, i've forgotten that warnings are possible for all content types.

That's why the refactoring takes so long;)
 
Just to confirm, does the thread title say who was warned?

Also, does it combine multiple warnings for the same user into the same thread?

Both of those we'd need. :)
 
Ah, ok - it wasn't clear in the screenshots before what the username was!

Is the latter likely to be added as an option at all?
I prefer 1 thread per warning.
With 1 thread for all users warning, this would be more complex, because i would also need to store the thread id, check if a thread exists, if it exists => create post, if it not exists => create thread
 
This is a great add-on.

Have you considered extending this add-on so that it creates a thread for...

1) a contact form submission,
2) when a post is reported
3) when a user is warned.

The thread should always be created by the users account.

I'm sure most of us would happily pay a few dollars for an add-on like that and it would mean we dont install 3 different add-ons for the same/similar job.
 
Hi ragtek!

I translated your addon but there is still the {content_type} template var that remains in english when I directly warn a user. Did you use an existing phrase (that I was unable to find, heh, looking for phrases with "user" in them...)? Or is it hard coded?
 
Hi ragtek!

I translated your addon but there is still the {content_type} template var that remains in english when I directly warn a user. Did you use an existing phrase (that I was unable to find, heh, looking for phrases with "user" in them...)? Or is it hard coded?
That's hardcoded:(
 
ragtek, I'm getting the "please enter a value using 100 characters or fewer" error when warning a post in a thread w/ a long title. yes, I've updated to the newest version & I'm still getting the error. disabling this addon makes the error go away. I'm able to make warnings from the profile page. I can see the code trimming the title so I don't know why it's happening.

just for fun I change the value from 100 to 90 & the warning worked / the thread was created.
Code:
$subject = XenForo_Helper_String::wholeWordTrim($subject, 90, 0);
 
ragtek, I'm getting the "please enter a value using 100 characters or fewer" error when warning a post in a thread w/ a long title. yes, I've updated to the newest version & I'm still getting the error. disabling this addon makes the error go away. I'm able to make warnings from the profile page. I can see the code trimming the title so I don't know why it's happening.

just for fun I change the value from 100 to 90 & the warning worked / the thread was created.
Code:
$subject = XenForo_Helper_String::wholeWordTrim($subject, 90, 0);
I'll check this next week
 
Hi Ragtek,

I wanted to display a quote of the warned content, so I slightly modified your code in Ragtek_TOW_Model::createThread().
This is pretty easy because it is loaded in the getContent() function. Feel free to use the code below if you ever update this addon. The modified code is between MODM tags.
PHP:
 public function createThread($nodeId, array $warningData)
{
    $this->_warningHandler = $this->_getContentWarningHandler($warningData);
    $this->_warningData = $this->_warningHandler->getContent($warningData['content_id']);
    $warningData['content_link'] = $this->_warningHandler->getContentUrl($this->_warningData, true);
 
    $subject = $this->_getThreadTitle($warningData);
 
    /*
     * MODM
     */
    $warningThreadParams = $this->_getWarningThreadParams($warningData);
 
    $message = new XenForo_Phrase($this->_getWarningThreadPhraseName('text', $warningData),     $warningThreadParams);
    $user = XenForo_Visitor::getInstance();
 
    if (isset($this->_warningData['message']))
    {
        $message .= "\n\nWarned content : [quote"
                . ($warningThreadParams['content_type'] != "post" ? "" : "=\""
                . $this->_warningData['username']
                . ', post:'
                . $this->_warningData['post_id']
                . ', member:'
                . $this->_warningData['user_id']
                . "\"")
                . "]"
                . $this->_warningData['message']
                . "[/quote] \n\n";
    }
    /*
     * /MODM
     */
 
    if ($warningData['notes'] != '') {
        $message .= "\n\n" . new XenForo_Phrase('note') . ":[quote]" . $warningData['notes'] . '[/quote]';
    }
 
    // ugly c& paste code but people don't like my framework so here we go...
 
    /** @var $writer XenForo_DataWriter_Discussion_Thread */
    $writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');
    $writer->set('user_id', $user['user_id']);
    $writer->set('username', $user['username']);
 
    $writer->set('title', $subject);
    $postWriter = $writer->getFirstMessageDw();
    $postWriter->set('message', $message);
    $writer->set('node_id', $nodeId);
    $writer->preSave();
    $writer->save();
}
 
Hi Ragtek,

I wanted to display a quote of the warned content, so I slightly modified your code in Ragtek_TOW_Model::createThread().
This is pretty easy because it is loaded in the getContent() function. Feel free to use the code below if you ever update this addon. The modified code is between MODM tags.

I'm a bit of a noob. Whereabouts do I add this?
 
stumbled upon a relatively large bug with this in 1.2.1, we had a couple spammers come through our board from china, posted alot of really long thread titles in chinese characters, along with some really long posts after that. When we went to give them warnings to ban them (because we have an automatic perma ban warning that mods use) the plugin caused an error saying ... "Please enter a value of less then 100 characters.", when i disabled the plugin, i was able to give the warning without issue. I assume it was related to the long thread titles, not entirely sure.
 
Is anyone still using this add-on? Any issues other than the one mentioned by @Spawne32? I see @ragtek's post are listed as a "guest" now. Not sure what that means, but I guess it won't be supported in the future. :(

I really have no idea how everyone else manages/discusses/reviews their moderator actions on XenForo without this functionality. o_O It's essential to my staff's workflow.
 
This plugin seems to be randomly causing an error when issuing warning points, "Please enter a value using 100 characters or fewer."

Any ideas?
 
Top Bottom