07-24-2013, 04:17 PM
I'm working on a plugin for bulk loading data into a forum that allows XThreads.
So far, I've got the package to read a CSV file and upload the threads into the forum with the thread subject and body. This was done by the following code, which invokes the posthandler for ordinary threads, $posthandler->validate_thread:
$new_thread = array(
"fid" => 21,
"subject" => $finalSubject,
"icon" => ' ',
"uid" => '1',
"username" => $mybb->user['username'], /* Screened for Super Admin */
"message" => $finalBody,
"ipaddress" => '127.0.0.1',
"posthash" => ''
);
$posthandler->set_data($new_thread);
$valid_thread = $posthandler->validate_thread();
My question is: Is there a corresponding posthandler->validate_thread for XThreads? I was unable to find one.
How do I modify the above code so that an XThread with thread field data is created instead of an ordinary thread?
Should "xthreads_input_posthandler_insert" be called instead?
So far, I've got the package to read a CSV file and upload the threads into the forum with the thread subject and body. This was done by the following code, which invokes the posthandler for ordinary threads, $posthandler->validate_thread:
$new_thread = array(
"fid" => 21,
"subject" => $finalSubject,
"icon" => ' ',
"uid" => '1',
"username" => $mybb->user['username'], /* Screened for Super Admin */
"message" => $finalBody,
"ipaddress" => '127.0.0.1',
"posthash" => ''
);
$posthandler->set_data($new_thread);
$valid_thread = $posthandler->validate_thread();
My question is: Is there a corresponding posthandler->validate_thread for XThreads? I was unable to find one.
How do I modify the above code so that an XThread with thread field data is created instead of an ordinary thread?
Should "xthreads_input_posthandler_insert" be called instead?