Hi,
I'm sorry for My English Type
I use xthreads to create New thread by this code:
PHP Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
define('IN_MYBB', true);
define('THIS_SCRIPT', "mehr.php");
global $current_page, $fid, $forum, $plugins, $cache, $_FILES, $mybb;
$fid = 6;
$current_page = "mehr.php";
$mybb->request_method = "post";
include '../global.php';
require_once MYBB_ROOT."inc/functions.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/functions_indicators.php";
require_once MYBB_ROOT."inc/datahandlers/post.php";
$forum = get_forum($fid);
xthreads_gettfcache($fid);
$new_thread = array(
"fid" => $fid,
"action" => "do_newthread",
"subject" => $title,
"icon" => -1,
"uid" => $uid,
"username" => $user,
"message" => $text,
"ipaddress" => get_ip(),
"posthash" => md5("878".random_str()),
'savedraft' => 0
);
$mybb->input = &$new_thread;
$plugins->run_hooks("newthread_do_newthread_start");
$posthandler = new PostDataHandler("insert");
$posthandler->action = "thread";
$posthandler->set_data($new_thread);
if($posthandler->validate_thread()) { $posthandler->insert_thread(); } else {var_dump($posthandler->get_errors());}
$plugins->run_hooks("newthread_do_newthread_end");
|
I need a code (Similar above Code) to Create replypost (under a thread),
Please help Me