Thanks so much! That worked perfectly. I am posting my code containing the build_post_index here just in case anyone needs it:
PHP Code:
require_once('./global.php');
require_once(DIR . '/includes/functions_newpost.php');
require_once(DIR . '/includes/functions_databuild.php');
$postforumid = 2;
$postforum = fetch_foruminfo($postforumid);
$post['title'] = "Thread Title";
$post['message'] = "First post of new thread.";
build_new_post('thread', $postforum, array(), array(), &$post, &$errors);
build_post_index($post['postid'], $post['threadid']);