PDA

View Full Version : Build_new_post only works if you are logged in?


x3sphere
07-30-2007, 05:05 AM
This is the code I have:

$rforuminfo = fetch_foruminfo($forumid);
$newpost = array(
'userid' => $userid,
'username' => $comment_username,
'message' => $comment_text,
'thread' => $threadid
);
$threadinfo['threadid'] = $threadid;
build_new_post('Post', $rforuminfo, $threadinfo, array(), $newpost, $errors);
if (sizeof($errors) > 0)
{
$error_text = construct_errors($errors);
echo $error_text;
}
build_forum_counters($forumid);

Works great, but only if you are logged into the forum. When I'm not logged in, it spits out this:

That username is already in use. If you are x3sphere and you have forgotten your password, click here.
The string you entered for the image verification did not match what was displayed.

Any ideas on to get this working while you are logged out?

nico_swd
07-30-2007, 05:29 PM
Admin CP -> Forums and moderation -> Forum permissions -> Select forum -> Edit "Unregistered / Not Logged In" -> Can Post Threads: Yes.

x3sphere
08-04-2007, 05:35 PM
Admin CP -> Forums and moderation -> Forum permissions -> Select forum -> Edit "Unregistered / Not Logged In" -> Can Post Threads: Yes.

Thx :) Although I still wanted member only posting on the forum. Using the data manager directly worked fine, instead of going through the build_new_post function.

toucan42
09-25-2007, 06:35 PM
Thx :) Although I still wanted member only posting on the forum. Using the data manager directly worked fine, instead of going through the build_new_post function.

How did you address the datamanager work to avoid this error? This is exactly the problem I am facing.