Bulk loading threads with thread fields
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Bulk loading threads with thread fields
XThreads runs off the MyBB posthandler validation, so you don't need to do anything special there.

You probably do have to set your XThreads values into the $mybb->input array though because there's not really an easy way for a plugin to modify the array that gets sent into the posthandler.

It would probably look something like:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 $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" => ''
);

is_array($mybb->input) or $mybb->input = array();
$mybb->input['xthreads_myfield'] = 'value'; // sets value for the custom thread field named "myfield"

$posthandler->set_data($new_thread);
$valid_thread = $posthandler->validate_thread();


My Blog
07-25-2013 12:05 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Bulk loading threads with thread fields - ZiNgA BuRgA - 07-25-2013 12:05 PM

 Standard Tools
Forum Jump: