I was wondering if someone could tell me what is wrong with my script. All I am trying to do is post a new message in an existing thread. When I put this script in a php page and hit it from my browser, I don't get any error, but I also don't get a message posted. I don't even see the "save returned" message in my browser. If I change some things (like the path to class_dm_threadpost), I get an error, so I know it is running something.
As for the echo not working, it seems like as soon as I put those require_once at the top of my file, I can't echo any messages anymore. But I only have those echos in there because the message isn't being posted to my thread.
PHP Code:
<?php
require_once('global.php');
require_once('./includes/class_dm_threadpost.php');
$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);
$threadid=1565;
$forumid=5;
$symid='asdf';
$userid=2;
$message="Testing.Testing.Testing.Testing.Testing.";
$timenow = TIMENOW;
$threadinfo = fetch_threadinfo($threadid);
$foruminfo = fetch_foruminfo($forumid);
$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $threadid);
$postdm->set('title', $symid);
$postdm->set('userid', $userid);
$postdm->set('pagetext', $message);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', $timenow);
$xxx = $postdm->save();
unset($postdm);
echo "save returned:";
echo $xxx;
?>