AddEventHandler("main", "OnBeforeUserRegister", "OnBeforeUserRegisterHandler");
function OnBeforeUserRegisterHandler($arFields)
{
if ($arFields["USER_ID"]>0 && CModule::IncludeModule("blog") && CModule::IncludeModule("socialnetwork"))
{
$arFields = array(
"NAME" => 'Блог'.$arFields["LOGIN"],
"DESCRIPTION" => 'Стена пользователя'.$arFields["LOGIN"],
"GROUP_ID" => '9',
"ENABLE_IMG_VERIF" => 'Y',
"EMAIL_NOTIFY" => 'N',
"ENABLE_RSS" => "Y",
"URL" => "wall-".$USER->GetID(),
"ACTIVE" => "Y",
"OWNER_ID" => $USER->GetID());
}
$newID = CBlog::Add($arFields);
} |