I set my forum up to auto generate a thread for our new users after they confirm the email address. The code works, but not all the time. I'm guessing that I have it in the wrong area in the register.php script. Can someone here point me to where it should go?
I suck at PHP coding, so thanks for your help.
Here is the code I'm using:
PHP Code:
// ########## START THREAD CREATION ##########
$forumid = $pmoptions['regforum'];
$foruminfo = fetch_foruminfo($forumid);
$post[title] = $pmoptions['regpmtitle'];
$post[message] = $pmoptions['regpmtext'];
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post['emailupdate'] = 9999;
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);
// ########## END THREAD CREATION ##########
and I put it after this line in register.php:
PHP Code:
// delete activationid
//$DB_site->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid=$userinfo[userid] AND type=0");