But I can only use $post['threadid'] and $post['postid'] after the build_new_post is hit in the code, correct? I think that'll save me 1 query
This look right?
PHP Code:
// Load vB-Backend
require('./global.php');
require('./includes/functions_newpost.php');
$userid = 5; // The user creating the thread
$forumid = 10; // The forum where the thread should be posted
// Get forum & user info
$foruminfo = fetch_foruminfo($forumid);
$bbuserinfo = fetch_userinfo($userid);
// Setup the thread
$post[title] = 'Some foobar sssstitle';
$post[message] = 'Some foobar message text';
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post['emailupdate'] = 9999;
// build the thread
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);
// Errors?
if (sizeof($errors) > 0) {
// error processing
}
ThreadID = $post['threadid'];
PostID = $post['postid'];
ThreadID and PostID are columns in a table I have created.