PDA

View Full Version : Updating Post Counters For External Post Script...


MattFord
10-07-2008, 11:30 PM
Hi there. I'm using code similar to this to post replies to threads from outside of VBulletin:

$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);
$timenow = TIMENOW ;
$threadinfo = fetch_threadinfo($_POST["threadid"]); // set to thread-id
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $_POST["threadid"]);
$postdm->set('title', 'a little reply');
$postdm->set('userid', $_POST["userid"]);
$postdm->set('pagetext', $content);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', $timenow);
$postdm->save();
unset($postdm);


The problem with it is that the posts generated do not update the users post count. How can I assure my users are getting credit for their comments?