MoMan
03-28-2010, 03:44 AM
I have a contact form on my forum that's powered by a simple script; when submitted, it creates a thread in one of my forums.
Below is the relevant portion of the script:
$foruminfo = verify_id('forum', $formforumid, 0, 1);
$forumperms = fetch_permissions($foruminfo[forumid]);
$newpost['username'] =& $vbulletin->userinfo['username'];
$newpost['message'] =& $formsend;
$newpost['title'] =& $posttitle;
$newpost['signature'] = '0';
$newpost['parseurl'] = '1';
$newpost['poststarttime'] = $poststarttime;
$newpost['posthash'] = $posthash;
// make sure it doesn't enter the moderation queue
$foruminfo['moderatenewthread'] = 0;
build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);
My problem is this: whenever someone submits the form, he is automatically subscribed to the thread. Is there some foruminfo or newpost parameter I can set to get around this, or is it being triggered by some forum setting? Thanks for any help.
---
BTW- for anyone having problems with a similar script, your thread may also end up being moderated if you don't either set moderatenewthread to 0 (see this thread (https://vborg.vbsupport.ru/showthread.php?t=99174)) or use threadman to set visible to 1.
--------------- Added 1269752666 at 1269752666 ---------------
EDIT: Found what was missing. Simply add this: $newpost['emailupdate'] = 9999;
Below is the relevant portion of the script:
$foruminfo = verify_id('forum', $formforumid, 0, 1);
$forumperms = fetch_permissions($foruminfo[forumid]);
$newpost['username'] =& $vbulletin->userinfo['username'];
$newpost['message'] =& $formsend;
$newpost['title'] =& $posttitle;
$newpost['signature'] = '0';
$newpost['parseurl'] = '1';
$newpost['poststarttime'] = $poststarttime;
$newpost['posthash'] = $posthash;
// make sure it doesn't enter the moderation queue
$foruminfo['moderatenewthread'] = 0;
build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);
My problem is this: whenever someone submits the form, he is automatically subscribed to the thread. Is there some foruminfo or newpost parameter I can set to get around this, or is it being triggered by some forum setting? Thanks for any help.
---
BTW- for anyone having problems with a similar script, your thread may also end up being moderated if you don't either set moderatenewthread to 0 (see this thread (https://vborg.vbsupport.ru/showthread.php?t=99174)) or use threadman to set visible to 1.
--------------- Added 1269752666 at 1269752666 ---------------
EDIT: Found what was missing. Simply add this: $newpost['emailupdate'] = 9999;