Hi, thanks for the reply
Current script looks like this (used in vB3.8):
PHP Code:
if (!($foruminfo = verify_id('forum', 100, false, true)))
return 0;
$dataman =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dataman->set('userid', $vbulletin->userinfo['userid']);
$dataman->set('forumid', 100);
$dataman->set('prefixid', 'PREFIXED');
$dataman->set('title', 'thread title');
$dataman->set('pagetext', 'thread content');
$dataman->set('allowsmilie', 1);
$dataman->set('visible', 1);
$dataman->set_info('forum', $foruminfo);
$dataman->set_info('is_automated', true);
$dataman->pre_save();
if ($dataman->errors)
return 0;
$threadid = $dataman->save();
I did check this earlier, I want to achieve something like it but excluded putting user password and base it on the global $vbulletin->userinfo as user is already logged in and the data is available
https://vborg.vbsupport.ru/showthread.php?t=326890
In regards of the questions:
1. The current logged in user, which can be accessed by the global variable
2. The forum has its own folder and the script is accessed through another subfolder on the same level. Etc /www/forums and /www/scripts/script.php
3. Is vbCMS available in 5.5.0?
Edit;
I got it working using the following code:
PHP Code:
define('CSRF_PROTECTION', false);
vB5_Autoloader::register('../');
vB5_Frontend_Application::init('config.php');
$api = Api_InterfaceAbstract::instance();
$user = $api->callApi('user', 'fetchUserinfo', array());
$data = array(
'hvinput' => '',
'title' => 'title',
'rawtext' => 'text',
'prefixid' => 'prefixid',
'parentid' => 100,
'channelid' => 100,
'userid' => $user['userid'],
'authorname' => $user['username'],
'nl2br' => false,
'htmlstate' => 'off',
'disable_bbcode' => false
);
$options = array(
'skipDupCheck' => true
);
$nodeId = $api->callApi('content_text', 'add', array($data, $options));