$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);
$postthreadid = '4473';
$postusername = 'admin';
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postuserid = '1';
$postpagetext = 'Hi mom!';
$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $postthreadid);
$postdm->set('username', $postusername);
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postdm->set('userid', $postuserid);
$postdm->set('pagetext', $postpagetext);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', TIMENOW);
$postdm->save();
unset($postdm);
is there a setting i need to configure in admincp? I'm trying to add a forum thread useing the datamanger_init, and save is returning a new id, but when i try to visit the thread i get a permissions error. it's on 3.7.2
is there a setting i need to configure in admincp? I'm trying to add a forum thread useing the datamanger_init, and save is returning a new id, but when i try to visit the thread i get a permissions error. it's on 3.7.2
I think there is another thread on how to create threads. It may be more ontopic there. Otherwise, I think we'd need to see your code...
how can i attach file when i want to create a thread with data manager?
i think that i must use class_dm_attachment.php but how?
can anyone help me?
(i am new to vb programming!)
I was wondering if someone could tell me what is wrong with my script. All I am trying to do is post a new message in an existing thread. When I put this script in a php page and hit it from my browser, I don't get any error, but I also don't get a message posted. I don't even see the "save returned" message in my browser. If I change some things (like the path to class_dm_threadpost), I get an error, so I know it is running something.
As for the echo not working, it seems like as soon as I put those require_once at the top of my file, I can't echo any messages anymore. But I only have those echos in there because the message isn't being posted to my thread.
If I start with an empty php file and just put an echo statement, I see the message when I hit the page. Anything I echo before the line that includes class_dm_threadpost.php I see output, but anything after I don't. For example:
I am using godaddy, so I don't know how I can access the php error file. I tried using an set_error_handler as described on this page: http://us3.php.net/set-error-handler , to catch any errors, but still I got no output. It is bizarre. It is like including that class_dm_threadpost is killing everything. I have not modified any of my vbulletin files, so it should be whatever came with 3.7.4.
var_export() behaves the same way as echo. Before that require_once line it works, after it, I see nothing.
--------------- Added [DATE]1251815891[/DATE] at [TIME]1251815891[/TIME] ---------------
Doh. I figured it out. I have to include another file as well (class_dm.php). It seems like without it, something in the class_dm_threadpost was unhappy.
I have a slight problem.... My code is inserting the post perfectly and everything is working in that respect. The problem is that the last post field is not being updated. I know this has something to do with the timestamp, but I'm not sure why the issue is happening. I'm importing a chat transcript and putting each chat post as a forum post. The import script runs every 5 minutes and uses the chat post's timestamp as the forum post time stamp. The forum posts appear just as they were posted within the chat and the time is dead on... Even with the above code included at the end, it only updates the forum counters, it doesn't update the last post index. Now if I swap the timestamp from the actual chat post time to TIMENOW
it's updated. Anyone have any ideas on how I can resolve this.