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

Script to use Datawriter to auto-create threads

NeoCHI

Active member
#1
Hi, I'm looking to create some sort of script to help me create threads using Datawriter. Can someone point me to some documentation to help me out?
 

Daniel Hood

Well-known member
#2
Currently the only documentation I can think of is the commenting and code in these three files:

library/XenForo/DataWriter.php
library/XenForo/DataWriter/Discussion.php
library/XenForo/DataWriter/Discussion/Thread.php
 

Daniel Hood

Well-known member
#4
PHP:
$threadWriter = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');
$threadWriter->set('title', "New Thread");
$threadWriter->set('message', "Content of thread.");
$threadWriter->save();
or something like that, I don't have the DataWriter open to check variable names.
 

truonglv

Formerly Nobita.Kun
#5
View this function: XenForo_ControllerPublic_Forum::actionAddThread You will get more and more information when try to using script for creating new thread ;)