Back to vBulletin 3 Articles

Create Posts
by fly 07 Dec 2005

PHP Code:
require_once('./global.php');
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');

$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

$postthreadid '4473';
$postusername 'admin';
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postuserid = '1';
$postpagetext 'Hi mom!';

$threadinfo fetch_threadinfo($postthreadid);
$foruminfo fetch_foruminfo($threadinfo['forumid']);

$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); 

vblts.ru supports vBulletin®, 2022-2024