Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 insert New replypost to thread
Phptik Offline
Junior Member
**
Posts: 2
Joined: Oct 2013
Post: #1
insert New replypost to thread
Hi,
I'm sorry for My English Type Smile

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 Smile

10-06-2013 04:58 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: insert New replypost to thread
I don't understand how this relates to XThreads.
Creating posts is pretty much the same as creating threads.  See newreply.php for details.

My Blog
10-06-2013 09:14 PM
Find all posts by this user Quote this message in a reply
Phptik Offline
Junior Member
**
Posts: 2
Joined: Oct 2013
Post: #3
RE: insert New replypost to thread
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
10-06-2013 11:16 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: insert New replypost to thread
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.

My Blog
10-07-2013 12:46 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: