I wrote some code to use DM to post:
PHP Code:
$newpost =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, threadpost);
$newpost->set('forumid', 2);
$newpost->set('title', "Test " . rand());
$newpost->set('userid', "1");
$newpost->set('pagetext', "Testing Testing Testing Testing " . rand() . " " . rand());
$newpost->set('allowsmilie', 0);
if ($newpost->errors)
{
print ("Errors: ");
print_r ($newpost->errors);
} else {
print ($newpost->save());
}
After running it, the new posts do appear in the thread and post table, but, they don't show on the forum pages! (I wrote similar code to reply to threads, and got the same results).
I'm not sure what the problem is... it seems like the forum pages are denormalized and need to be rebuilt explicilty... I took a look at the build_new_post() and they used set_info() instead of plain set() - not sure what that is or if it's relevant.
Any ideas?