I try to use build_new_post function but nothing has happen with this code below. The main code I get from Staff Application System. Can anyone help me to know why it doesn't work?
Thanks a lot!
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// Build Messages
$message2 = "This is a test only.";
// Make a new thread
require_once(DIR . '/includes/functions_newpost.php');
$forumid = 1;
$user_id = 56;
$username = 'TOEFL';
$target_foruminfo = fetch_foruminfo($forumid);
$newpost = array(
'userid' => $user_id,
'username' => $username,
'message' => $message2,
'title' => 'This is a test only',
'poststarttime' => time(),
'emailupdate' => 0
);
build_new_post('thread', $target_foruminfo, array(), array(), $newpost, $errors);
// Fix forums counters
require_once('./includes/functions_databuild.php');
build_forum_counters($forumid);
?>
--------------- Added [DATE]1251067771[/DATE] at [TIME]1251067771[/TIME] ---------------
When I run it again, VBB display a duplicate post and maybe the post has been create, but why it doesn't display?