PDA

View Full Version : post a reply using build_new_post function


lowspeed
01-16-2005, 11:54 PM
I have a thread lets say # 1091

How do i submit a reply to that thread using build_new_post ?


I tried doing something like this ...


chdir('../vb');
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array();

// pre-cache templates used by specific actions
$actiontemplates = array();

require_once('global.php');
require_once('includes/functions_newpost.php');
$post = array();

$userid = 1; // i picked this
$forumid = 8; // i picked this

$foruminfo = fetch_foruminfo($forumid);
$bbuserinfo = fetch_userinfo($userid);

//$post[title] = ''; // dont want new title for reply
$post[message] = 'The reply body';
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);

build_new_post('reply', $foruminfo, array(), 1091, $post, $errors); // theard 1091 which i picked

echo ("<br>*********************** ".$post['threadid']);

chdir('../outside');


But it doesn't work :( can someone please help ?

Thanks a bunch !

lowspeed
01-17-2005, 05:18 PM
Ok i found how to do it

You need these added:

$threadid=1091; // the thread you want to reply to
$threadinfo = fetch_threadinfo($threadid);

build_new_post('reply', $foruminfo, $threadinfo, $_POST['postid'], $post, $errors);

Cibox.de
02-04-2005, 12:24 AM
Hi,
I tried your code including your corrections, but it didn't work.
Could it be, that I forgot something?
It would be great, if you could post the whole working code.

Thanks in advance

Commander-X
01-19-2010, 11:00 AM
Hello are you submitting a reply outside vb pages?