Thread Creator - Get new Thread's ID

I'm using the following code in a php script to generate a forum thread:

Code:

Код:
$dir = WEBSITE_PATH.'/forums';
require($dir . '/src/XF.php');
XF::start($dir);

$forumId = '20';  //Forum ID of where to post thread
$userId = '2';  //User ID # of account to post thread as
$title = "Testing";
$message = '[b]Name:[/b] Test';

$forum = \XF::em()->find('XF:Forum', $forumId);
$user = \XF::em()->find('XF:User', $userId);
\XF::asVisitor($user, function() use ($forum, $title, $message)
{
    $creator =...

Read more

Читать далее...
 
Активность
Пока что здесь никого нет
Назад
Верх Низ