PDA

View Full Version : Moderate Posts from Data Manager


VAG
10-22-2010, 09:46 PM
I asked the question on vbulletin.com but they forwarded met to vbulletin.org.

http://www.vbulletin.com/forum/showthread.php?365180-Moderate-Posts-from-Data-Manager


Hello,

When I try to add a post (Without being logged on) to a specific thread via the Data Manager, this post is not placed in the moderation queue. Eventhough I've set all the settings to moderate posts from Guest/Unregistered users correctly.

If I add a new post, directly into the thread without using the datamanager, the post succesfully goes to the moderation queue.

How can I change the settings so that when I post via the Data Manager the post gets in the moderation queue first when I'm not logged in to the forum?

Or is there anything else I need to add to my code which that places the post in the moderation queue?

to be more specific

I read about the datamanager here: http://www.vbulletin.com/docs/html/d...er_programming and here: http://www.vbulletin.com/docs/html/data_manager_example
I succesfully implemented this code outside vBulletin, but the posts when no user is logged in (thus Guest Posts) are not being placed in the moderation queue and directly are inserted in the thread.

Any thoughts about this one?
Thanks for your quick reply

Lynne
10-22-2010, 09:56 PM
Post your code otherwise there is no way to see what might be wrong.

VAG
10-22-2010, 09:59 PM
$tdm =& datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$tdm->set('threadid', $_POST['threadid']);
$tdm->set('pagetext', $_POST['message']);
$tdm->set('allowsmilie', 1);

if ($vbulletin->userinfo['userid'] <1) {
if(($_POST['check']) == $_SESSION['check']) {
$tdm->set('username', $_POST['name']);
}else{
echo 'Input Wrong';
return;
}
}
else{
$tdm->set('userid', '1');
}

$tdm->set('visible', 1);
$tdm->set('dateline', time());
$tdm->save();

build_thread_counters($_POST['threadid']);


The if-statement is for unregistered users. They have to enter a captcha code.

Lynne
10-22-2010, 10:10 PM
setting visible to 1 means it's visible and not in moderation. If you want it in moderation, set it to 0

VAG
10-22-2010, 11:01 PM
Pff, now that is what I call stupidity on my side.
Such an easy way - Thank Lynne - Very Very much.