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

How to mass create threads under a specific topic?

Vinz

New member
#1
Hi there,

Is there a way to mass create threads under a specific topic? I have a list of about 2,000 pages which I want to create into threads. These info are not exported from other forum software, so I cannot use the default import function.

So is there a way where I can import via CSV or add-on that I can use to mass create the threads?
 

Cooper

Active member
#5
Write a PHP script and use the xenforo datawriter, like:

PHP:
//post new thread on forum       
            $writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');
            $writer->set('user_id', $userid);
            $writer->set('username', $username);
            $writer->set('title', $threadtitle);
            $postWriter = $writer->getFirstMessageDw();
            $postWriter->set('message', $intromsg);
   
            $writer->set('node_id', $nodeid);
                    $writer->preSave();
                    $writer->save();
                    $thread = $writer->getMergedData();
 

Vinz

New member
#6
Write a PHP script and use the xenforo datawriter, like:

PHP:
//post new thread on forum      
            $writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');
            $writer->set('user_id', $userid);
            $writer->set('username', $username);
            $writer->set('title', $threadtitle);
            $postWriter = $writer->getFirstMessageDw();
            $postWriter->set('message', $intromsg);
  
            $writer->set('node_id', $nodeid);
                    $writer->preSave();
                    $writer->save();
                    $thread = $writer->getMergedData();
Hi Cooper, thanks!

Would you be able to help us import? We are willing to pay you nominal fee to help us import the data as we are not developer, may have problems writing the script.