I'm attempting to update my external news posting script so that it works with vB 3.6.1 and am having some issues. Previously I simply manually performed all of the necessary SQL, and now I'm trying to use vB_DataManager_Thread_FirstPost(). However, my own script uses some of the same functions as vB does (iif, for example) so it runs into errors. Does anyone know how I can get this to work right?
PHP Code:
$cwd = getcwd();
chdir('/home/seriousc/www/forums');
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php');
$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
$threaddm->do_set('forumid', $newsforumid);
$threaddm->do_set('postuserid', $userid);
$threaddm->do_set('userid', $userid);
$threaddm->do_set('username', $postusername);
$threaddm->do_set('pagetext', $body);
$threaddm->do_set('title', $title);
$threaddm->do_set('allowsmilie', $allowsmilie);
$threaddm->do_set('visible', $visible);
$threadid = $threaddm->save();
chdir($cwd);
return $threadid;