foxlye
Проверенные
- Сообщения
- 33
- Реакции
- -3
- Баллы
- 705
PHP:
<?php
$newusername = "New_User";
$newpassword = "123456";
$newemail = "[email protected]";
$fileDir = "/home/host1561194/site.ru/htdocs/forum";
require($fileDir .'/library/config.php');
require($fileDir.'/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
$startTime = microtime(true);
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
XenForo_Application::disablePhpErrorHandler();
// create new user
$writer = XenForo_DataWriter::create('XenForo_DataWriter_User');
// set all the values
$writer->set('username', $newusername);
$writer->set('email', $newemail);
$writer->setPassword($newpassword, $newpassword);
$writer->set('user_group_id', XenForo_Model_User::$defaultRegisteredGroupId);
//$writer->set('adcredit_shop_postbit_icons', NULL);
// save user
$writer->save();
?>
А как сделать так же во второй версии ?