PDA

View Full Version : build_new_post function


swellinfo
09-25-2007, 01:48 PM
I am trying to build a new thread/post outside of the vbull files.

It looks like what I need to use is the build_new_post function from includes/functions_newpost.php.

Below is what I see in newthread.php. I'm assuming that if I assign the $newpost variables, and call build_new_post, then this will accomplish my task. Can someone help me understand what values I need to assign for the following $newpost variables.

$newpost['title'] =& $vbulletin->GPC['subject'];
$newpost['iconid'] =& $vbulletin->GPC['iconid'];
$newpost['parseurl'] = ($foruminfo['allowbbcode'] AND $vbulletin->GPC['parseurl']);
$newpost['signature'] =& $vbulletin->GPC['signature'];
$newpost['preview'] =& $vbulletin->GPC['preview'];
$newpost['disablesmilies'] =& $vbulletin->GPC['disablesmilies'];
$newpost['rating'] =& $vbulletin->GPC['rating'];
$newpost['username'] =& $vbulletin->GPC['username'];
$newpost['postpoll'] =& $vbulletin->GPC['postpoll'];
$newpost['polloptions'] =& $vbulletin->GPC['polloptions'];
$newpost['folderid'] =& $vbulletin->GPC['folderid'];
$newpost['emailupdate'] =& $vbulletin->GPC['emailupdate'];
$newpost['poststarttime'] = $poststarttime;
$newpost['posthash'] = $posthash;
// moderation options
$newpost['stickunstick'] =& $vbulletin->GPC['stickunstick'];
$newpost['openclose'] =& $vbulletin->GPC['openclose'];

build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);


I should also include for other users who want to use this task that you assign $foruminfo like
$foruminfo = fetch_foruminfo(#) where # is the forum id integer.