PHP Code:
$forumid = 26;
$foruminfo = fetch_foruminfo(forumid);
$newpost = array(
'emailupdate' => 9999,
'userid' => 8,
'username' => 'Botty',
'title' => 'Application from : ' . $vbulletin->GPC['username']
);
eval('$newpost[message] = "' . fetch_template('APPLY_post') . '";');
require_once(DIR . '/includes/functions_newpost.php');
build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);
That script, when logged in, posts it using my username, not the specified bots name. Why is this happening?
EDIT:
PHP Code:
// make post
$forumid = 26;
$foruminfo = fetch_foruminfo($forumid);
$newpost = array(
'emailupdate' => 9999,
'userid' => 8,
'username' => 'VouchBot',
'title' => 'Application from : ' . $vbulletin->GPC['username']
);
eval('$newpost[message] = "' . fetch_template('APPLY_post') . '";');
require_once(DIR . '/includes/functions_newpost.php');
$olduserid = $vbulletin->userinfo['userid'];
$vbulletin->userinfo['userid'] = 8;
build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);
$vbulletin->userinfo['userid'] = $olduserid;
This fixes the problem within the postbit, but the lastposter info is incorrect.