Hiya
So far: (relevant part)
PHP Code:
<?php
session_start();
$formErr = "";
$username = $when = $where = "";
if (isset($_GET['submit'])) {
if (empty($_GET["username"]) || empty($_GET["when"]) || empty($_GET["where"])) {
$formErr = "<br>You have not completed the entire form - everything must be completed! (*)";
} else {
$username = $_GET["username"];
$when = $_GET["when"];
$where = $_GET["where"];
//after variables retrieved for inputs:
sendReport();
}
}
function sendReport() {
$maxchars = $vbulletin->options['postmaxchars'];
$vbulletin->options['postmaxchars'] = 0;
$mthread =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$reportforuminfo = fetch_foruminfo($mforumid);
$reportthreadinfo = array();
$mpostip = "";
$mallowsmilie = '1';
$mvisible = 1;
$showsig = 1;
$mthread->set_info('forum', $reportforuminfo);
$mthread->set_info('thread', $reportthreadinfo);
$mthread->set_info('skip_floodcheck', true);
$mthread->setr('forumid', 33);
$mthread->setr('userid', $muserid );
$mthread->setr('pagetext', $report);
if ($vbulletin->options['markfl_report_prefixes_enabled'])
{
$mthread->set('prefixid', 'reportthread_unsolved');
}
$mthread->setr('title', $title);
$mthread->set('allowsmilie', $mallowsmilie);
$mthread->set('visible', $mvisible);
$mthread->set('ipaddress', $mpostip);
$mthread->set('showsignature', $showsig);
$mthread->pre_save();
if (count($mthread->errors) < 1)
{
$threadid = $mthread->save();
unset($mthread);
build_thread_counters($mthread);
}
else
{
print "Error making new thread! " . $mthread->errors[0] . $mthread->errors[1] . $mthread->errors[2] ;
}
build_forum_counters($forumid);
//Restore setting for maximum characters allowed in posts.
$vbulletin->options['postmaxchars'] = $maxchars;
} ?>