2012-05-25, 08:24 AM
I'd like MyBB to automatically fill-in the subject and message given a URL like
I think this is easy to do with a few lines of code in newthread.php, but I'm not familiar with PHP array syntax and am having a hard time trying to figure it out. Something along the lines of
if ($_GET['subject']) {
MyBB variable = urldecode($_GET['subject']);
MyBB variable = urldecode($_GET['message']);
}
Would someone be so kind as to help me with the correct variables and syntax?
I think I figured it out. In newthread.php at approximately Line 621
http://foobar.com/forum/newthread.php?fid=116&subject=A+new+topic&message=blah+blah
I think this is easy to do with a few lines of code in newthread.php, but I'm not familiar with PHP array syntax and am having a hard time trying to figure it out. Something along the lines of
if ($_GET['subject']) {
MyBB variable = urldecode($_GET['subject']);
MyBB variable = urldecode($_GET['message']);
}
Would someone be so kind as to help me with the correct variables and syntax?
I think I figured it out. In newthread.php at approximately Line 621
// Otherwise, this is our initial visit to this page.
else
{
if($mybb->user['signature'] != '')
{
$postoptionschecked['signature'] = " checked=\"checked\"";
}
if($mybb->user['subscriptionmethod'] == 1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($mybb->user['subscriptionmethod'] == 2)
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
$numpolloptions = "2";
// START OF NEW CODE
$subject = urldecode($_GET['subject']);
$message = urldecode($_GET['message']);
// END OF NEW CODE
}