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'); $threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost'); $forumid=36; $vb_username=$vbulletin->userinfo['username']; $body="Comments for $vb_username\'s $year $make $model, <a href=\'/fueleconomy/view_car.php?cid=$cid\'>\"$name\"</a>."; global $vbulletin, $botpermissons, $vbphrase; $userinfo=fetch_userinfo($vb_uid); $threadinfo=array(); $foruminfo=fetch_foruminfo($forumid); $threaddm=new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD); $threaddm->set_info('forum', $foruminfo); $threaddm->set('forumid', $forumid); $threaddm->set('userid', 1); $threaddm->set('title', $name); $threaddm->set('pagetext', $body); $threaddm->set('open', 1); $threaddm->set('allowsmilie', 1); $threaddm->set('visible', 1); $threaddm->pre_save(); $threadid = $threaddm->save(); unset($threaddm);