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

Set IP Address on new thread/post

Jafo

Active member
#1
Consider:

Code:
$writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');

        $writer->set('user_id', $user['user_id']);

            $writer->set('username', $user['username']);

            $writer->set('discussion_open', 0);

        $writer->set('title', $row['subject']);

        $writer->set('view_count', $row['views']);
                 
        $postWriter = $writer->getFirstMessageDw();

        $postWriter->setOption(XenForo_DataWriter_DiscussionMessage::OPTION_IS_AUTOMATED, true);

            $postWriter->set('message', $post['message']);
 
            $writer->set('node_id', $forumid);

                $writer->preSave();

                $writer->save();

                $thread = $writer->getMergedData();
How would I set the IP for this first post?