N NeoCHI Active member Sep 13, 2013 #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?
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 Sep 13, 2013 #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
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
N NeoCHI Active member Sep 14, 2013 #3 How about a simple example of a script that'll create a thread with some text as it's message.
Daniel Hood Well-known member Sep 14, 2013 #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.
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 Well-known member Sep 14, 2013 #5 View this function: XenForo_ControllerPublic_Forum::actionAddThread You will get more and more information when try to using script for creating new thread
View this function: XenForo_ControllerPublic_Forum::actionAddThread You will get more and more information when try to using script for creating new thread