MyBB Hacks

Full Version: insert New replypost to thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I'm sorry for My English Type Smile

I use xthreads to create New thread by this code:

PHP Code:
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 Smile

I don't understand how this relates to XThreads.
Creating posts is pretty much the same as creating threads.  See newreply.php for details.
i See newreply.php But I don't understand how to use this file Frown
I don't Xthreads Function , For sample run_hooks Or array Of replypost Or posthandler !
Frown help me
You're not really making any sense to me.
Try posting your question on the MyBB Community forum.  We don't provide general support here.
Reference URL's