Does anyone know if there is any kind of script/plugin available that will allow a user to click a 'link' which then sends them to a form and then once they fill out the form, the form then creates a new thread in a certain sub-forum/category?
For example;
If I fill out a 'Ban Request' form, the details and headings from this ban request automatically creates a new thread under the 'Ban Requests' forum.
Cheers.
So you want the actual page created too, not just the code to post the thread?
I'm capable of creating the page/form, it's just the coding of how to send that form into a new thread that is the confusing part
![Smile Smile](https://community.mybb.com/images/smilies/smile.gif)
Something like this would work, obviously you will need to change the variables to the FORM data.
require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("insert");
$posthandler->action = "thread";
$fid = 1;
$subject = "Title";
$uid = $mybb->user['uid']; // user ID
$username = $mybb->user['username'];
$message = "Message body";
$ip = $_SERVER['REMOTE_ADDR'];
$new_thread = array (
"fid" => $fid,
"subject" => $subject,
"uid" => $uid,
"username" => $username,
"message" => $message,
"ipaddr" => $ip
);
$posthandler->set_data($new_thread);
$valid_thread = $posthandler->validate_thread();
if (!$valid_thread) {
die(var_dump($posthandler->get_friendly_errors()));
}
$thread_info = $posthandler->insert_thread();