I fixed a couple things from the first block of code but am still having problems. Please help!
PHP Code:
error_reporting( E_ALL & ~E_NOTICE );
require_once( '/home/myhybrid/www/forums/includes/functions_misc.php' );
require_once( '/home/myhybrid/www/forums/includes/class_dm.php' );
require_once( '/home/myhybrid/www/forums/includes/class_dm_threadpost.php' );
$postman =& datamanager_init( 'Post', &$vbulletin, ERRTYPE_ARRAY, 'threadpost' );
$forumid = 36;
$threadid = (int) $_POST['threadid'];
$vb_username = $vbulletin->userinfo['username'];
$vb_userid = $vbulletin->userinfo['userid'];
$title = '';
$body = mysql_real_escape_string( $_POST['body'] );
global $botpermissons, $vbphrase;
$userinfo = fetch_userinfo( $vb_userid );
$threadinfo = fetch_threadinfo( $threadid );
$foruminfo = fetch_foruminfo( $forumid );
$postman->set_info( 'thread', $threadinfo );
$postman->set_info( 'forum', $foruminfo );
$postman->set_info( 'user', $userinfo );
$postman->set( 'threadid', $threadid );
$postman->set( 'userid', $vb_userid );
$postman->set( 'title', $title );
$postman->set( 'pagetext', $body );
$postman->set_info( 'skip_floodcheck', true );
$postman->set_info( 'visible', true );
$postman->set( 'allowsmilie', true );
$postman->pre_save();
$postman = $postman->save();
unset($postman);
--------------- Added [DATE]1238537442[/DATE] at [TIME]1238537442[/TIME] ---------------
Got it! For posterity:
PHP Code:
error_reporting( E_ALL & ~E_NOTICE );
require_once( '/home/myhybrid/www/forums/includes/functions_misc.php' );
require_once( '/home/myhybrid/www/forums/includes/class_dm.php' );
require_once( '/home/myhybrid/www/forums/includes/class_dm_threadpost.php' );
$postman =& datamanager_init( 'Post', &$vbulletin, ERRTYPE_ARRAY, 'threadpost' );
global $botpermissons, $vbphrase;
$vb_username = $vbulletin->userinfo['username'];
$forumid = 36;
// user
$vb_userid = $vbulletin->userinfo['userid'];
$userinfo = fetch_userinfo( $vb_userid );
$postman->set( 'userid', $vb_userid );
$postman->set_info( 'user', $userinfo );
// forum
$foruminfo = fetch_foruminfo( $forumid );
$postman->set_info( 'forum', $foruminfo );
// thread
$threadid = (int) $_POST['threadid'];
$threadinfo = fetch_threadinfo( $threadid );
$postman->set( 'threadid', $threadid );
$postman->set_info( 'thread', $threadinfo );
// post
$postman->set( 'title', '' );
$body = mysql_real_escape_string( $_POST['body'] );
$postman->set( 'pagetext', $body );
$postman->set( 'visible', true );
$postman->set( 'allowsmilie', true );
// save
$postman->pre_save();
$postman = $postman->save();
The problem was set() v. set_info()