本文整理汇总了PHP中CForumNew::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew::Update方法的具体用法?PHP CForumNew::Update怎么用?PHP CForumNew::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumNew
的用法示例。
在下文中一共展示了CForumNew::Update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(GetMessage("FA_DELETE_ERROR"), $ID);
}
}
$DB->Commit();
break;
case "activate":
case "deactivate":
if (!CForumNew::CanUserUpdateForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) {
$lAdmin->AddUpdateError(GetMessage("FA_NO_PERMS2UPDATE") . " " . $ID . "", $ID);
continue;
}
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!CForumNew::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(GetMessage("FA_ERROR_UPDATE") . " " . $ID . "", $ID);
}
}
break;
case "clear_html":
$DB->StartTransaction();
if (!CForumNew::ClearHTML($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("FA_ERROR_UPDATE") . " " . $ID . "", $ID);
}
$DB->Commit();
break;
示例2: __checkForum
function __checkForum($forumID)
{
if (!($settingsForumID = COption::GetOptionString("tasks", "task_forum_id"))) {
if ((int) $forumID > 0) {
COption::SetOptionString("tasks", "task_forum_id", intval($forumID));
}
}
if (IsModuleInstalled('extranet')) {
if (-1 === COption::GetOptionString('tasks', 'task_extranet_forum_id', -1, $siteId = '')) {
try {
$extranetForumID = CTasksTools::GetForumIdForExtranet();
COption::SetOptionString('tasks', 'task_extranet_forum_id', $extranetForumID, '', $siteId = '');
} catch (TasksException $e) {
COption::SetOptionString('tasks', 'task_extranet_forum_id', (int) $forumID, '', $siteId = '');
}
}
}
if (CModule::IncludeModule("forum") && $forumID && COption::GetOptionString("tasks", "forum_checked", false)) {
$arGroups = array();
$rs = CGroup::GetList($order = 'id', $by = 'asc', array());
while ($ar = $rs->Fetch()) {
$arGroups[$ar['ID']] = 'A';
}
CForumNew::Update($forumID, array("GROUP_ID" => $arGroups, "INDEXATION" => "Y"));
COption::RemoveOption("tasks", "forum_checked");
}
}
示例3: SetCommentPath
/**
* Sets right search path for comments, likes etc.
* http://jabber.bx/view.php?id=25340
* @param int $forumID - forum's ID were comments saving (for example $arParams['FORUM_ID'])
* @param str $rightPath - wich path must leads to the comment ( for example: "/comment/#MESSAGE_ID#/" )
* @param str $urlRewriterPath - wich path leads to curent module (complex component) ( for example: "/services/wiki.php" )
* @return bool true|false
*/
static function SetCommentPath($forumID, $rightPath, $urlRewriterPath)
{
if (!$forumID || !CModule::IncludeModule('forum') || !$rightPath || !$urlRewriterPath) {
return false;
}
$arRewriter = CUrlRewriter::GetList(array("PATH" => $urlRewriterPath));
//http://jabber.bx/view.php?id=25340
if (!is_array($arRewriter) || empty($arRewriter)) {
return false;
}
$rewriteCondition = str_replace(array("#", "^"), "", $arRewriter[0]["CONDITION"]);
$rightCommentsPath = $rewriteCondition . $rightPath;
$arActualCommentsPath = CWikiUtils::GetCommentPath($forumID);
if (!is_array($arActualCommentsPath)) {
return false;
}
$arUpdateForum = array();
foreach ($arActualCommentsPath as $site => $path) {
if ($path != $rightCommentsPath) {
$arUpdateForum["SITES"][$site] = $rightCommentsPath;
}
}
if (!empty($arUpdateForum)) {
CForumNew::Update($forumID, $arUpdateForum);
}
return true;
}
示例4: while
while ($res = $db_res->Fetch()) {
if ($_REQUEST["SITE"][$res["LID"]] == "Y") {
$arFields["SITES"][$res["LID"]] = $_REQUEST["SITE_PATH"][$res["LID"]];
}
}
if (CModule::IncludeModule("statistic")) {
$arFields["EVENT1"] = $_REQUEST["EVENT1"];
$arFields["EVENT2"] = $_REQUEST["EVENT2"];
$arFields["EVENT3"] = $_REQUEST["EVENT3"];
}
if (!IsModuleInstalled("search")) {
unset($arFields["INDEXATION"]);
}
$res = false;
if ($ID > 0) {
$res = CForumNew::Update($ID, $arFields, false);
} else {
$ID = CForumNew::Add($arFields);
}
}
// Clear cache.
$nameSpace = "bitrix";
$arComponentPath = array($nameSpace . ":forum.index", $nameSpace . ":forum.rss", $nameSpace . ":forum.search", $nameSpace . ":forum.statistic", $nameSpace . ":forum.topic.active", $nameSpace . ":forum.topic.move", $nameSpace . ":forum.topic.reviews", $nameSpace . ":forum.topic.search", $nameSpace . ":forum.user.list", $nameSpace . ":forum.user.post");
foreach ($arComponentPath as $path) {
$componentRelativePath = CComponentEngine::MakeComponentPath($path);
$arComponentDescription = CComponentUtil::GetComponentDescr($path);
if (strLen($componentRelativePath) <= 0 || !is_array($arComponentDescription)) {
continue;
} elseif (!array_key_exists("CACHE_PATH", $arComponentDescription)) {
continue;
}
示例5: ForumAddMessage
function ForumAddMessage($MESSAGE_TYPE, $FID, $TID, $MID, $arFieldsG, &$strErrorMessage, &$strOKMessage, $iFileSize = false, $captcha_word = "", $captcha_sid = 0, $captcha_code = "")
{
global $USER, $DB, $APPLICATION;
$APPLICATION->ResetException();
$aMsg = array();
$bUpdateTopic = False;
$bAddEditNote = $MESSAGE_TYPE == "EDIT";
$arParams = array("PERMISSION" => false);
$arUserGroups = $USER->GetUserGroupArray();
// ************ External Permission *********************************
if (!empty($arFieldsG["PERMISSION_EXTERNAL"])) {
$arParams["PERMISSION"] = CForumNew::GetUserPermission($FID, $arUserGroups);
$arParams["PERMISSION"] = $arParams["PERMISSION"] < "Q" ? $arFieldsG["PERMISSION_EXTERNAL"] : $arParams["PERMISSION"];
unset($arFieldsG["PERMISSION_EXTERNAL"]);
} elseif (!empty($arFieldsG["SONET_PERMS"])) {
$arParams["PERMISSION"] = CForumNew::GetUserPermission($FID, $arUserGroups);
if ($arParams["PERMISSION"] < "Q") {
if ($arFieldsG["SONET_PERMS"]["bCanFull"] === true) {
$arParams["PERMISSION"] = "Y";
} elseif ($arFieldsG["SONET_PERMS"]["bCanNew"] === true) {
$arParams["PERMISSION"] = "M";
} elseif ($arFieldsG["SONET_PERMS"]["bCanWrite"] === true) {
$arParams["PERMISSION"] = "I";
} else {
$arParams["PERMISSION"] = "A";
}
}
unset($arFieldsG["SONET_PERMS"]);
}
$DB->StartTransaction();
if (!in_array($MESSAGE_TYPE, array("NEW", "EDIT", "REPLY"))) {
$aMsg[] = array("id" => "MESSAGE_TYPE", "text" => GetMessage("ADDMES_NO_TYPE") . ".");
}
$MID = intval($MID);
$TID = intval($TID);
$FID = intval($FID);
$arFieldsG["EDIT_ADD_REASON"] = $arFieldsG["EDIT_ADD_REASON"] == "Y" ? "Y" : "N";
if ($MID > 0) {
$arMessage = CForumMessage::GetByID($MID, array("FILTER" => "N"));
if ($arMessage) {
$TID = IntVal($arMessage["TOPIC_ID"]);
$FID = IntVal($arMessage["FORUM_ID"]);
}
}
$arTopic = array();
if ($TID > 0) {
$arTopic = CForumTopic::GetByID($TID);
if ($arTopic) {
$FID = IntVal($arTopic["FORUM_ID"]);
}
}
$arForum = CForumNew::GetByID($FID);
//************************* Input params **************************************************************************
if ($MESSAGE_TYPE == "NEW" && !CForumTopic::CanUserAddTopic($FID, $arUserGroups, $USER->GetID(), $arForum, $arParams["PERMISSION"])) {
$aMsg[] = array("id" => "PERMISSION", "text" => GetMessage("ADDMESS_NO_PERMS2NEW") . ".");
} elseif ($MESSAGE_TYPE == "EDIT" && !CForumMessage::CanUserUpdateMessage($MID, $arUserGroups, $USER->GetID(), $arParams["PERMISSION"])) {
$aMsg[] = array("id" => "PERMISSION", "text" => GetMessage("ADDMESS_NO_PERMS2EDIT") . ".");
} elseif ($MESSAGE_TYPE == "REPLY" && !CForumMessage::CanUserAddMessage($TID, $arUserGroups, $USER->GetID(), $arParams["PERMISSION"])) {
$aMsg[] = array("id" => "PERMISSION", "text" => GetMessage("ADDMESS_NO_PERMS2REPLY") . ".");
}
if ($MESSAGE_TYPE == "NEW" || $MESSAGE_TYPE == "EDIT" && array_intersect_key($arFieldsG, array("TITLE" => "", "DESCRIPTION" => "", "ICON" => "", "TAGS" => "", "OWNER_ID" => "", "SOCNET_GROUP_ID" => "")) && CForumTopic::CanUserUpdateTopic($TID, $arUserGroups, $USER->GetID(), $arParams["PERMISSION"])) {
$bUpdateTopic = True;
}
if ($MESSAGE_TYPE == "EDIT" && (ForumCurrUserPermissions($FID, $arParams) > "Q" && $arFieldsG["EDIT_ADD_REASON"] == "N")) {
$bAddEditNote = false;
}
//*************************!CAPTCHA********************************************************************************
if (!$USER->IsAuthorized() && $arForum["USE_CAPTCHA"] == "Y") {
include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/captcha.php";
$cpt = new CCaptcha();
if (strlen($captcha_code) > 0) {
$captchaPass = COption::GetOptionString("main", "captcha_password", "");
if (!$cpt->CheckCodeCrypt($captcha_word, $captcha_code, $captchaPass)) {
$aMsg[] = array("id" => "CAPTCHA", "text" => GetMessage("FORUM_POSTM_CAPTCHA") . ".");
}
} else {
if (!$cpt->CheckCode($captcha_word, $captcha_sid)) {
$aMsg[] = array("id" => "CAPTCHA", "text" => GetMessage("FORUM_POSTM_CAPTCHA") . ".");
}
}
}
//*************************!CAPTCHA********************************************************************************
$arFieldsG["POST_MESSAGE"] = trim($arFieldsG["POST_MESSAGE"]);
if (empty($arFieldsG["POST_MESSAGE"])) {
$aMsg[] = array("id" => "POST_MESSAGE", "text" => GetMessage("ADDMESS_INPUT_MESSAGE") . ".");
}
if ($bUpdateTopic && is_set($arFieldsG, "TITLE")) {
$arFieldsG["TITLE"] = trim($arFieldsG["TITLE"]);
if (empty($arFieldsG["TITLE"])) {
$aMsg[] = array("id" => "TITLE", "text" => GetMessage("ADDMESS_INPUT_TITLE") . ".");
}
}
//*************************!QUOTA**********************************************************************************
/* if (empty($aMsg))
{
$quota = new CDiskQuota();
if ($MESSAGE_TYPE=="EDIT")
{
if (!$quota->checkDiskQuota(strLen($arFieldsG["POST_MESSAGE"]) - strLen($arMessage["POST_MESSAGE"])))
{
//.........这里部分代码省略.........
示例6: _check_iblock_prop
function _check_iblock_prop($arProperty = false)
{
static $dataType = 'IblockProperties';
$checked = $this->_dataCache($dataType);
if (!$checked) {
$arProps = $this->GetProperties();
foreach ($arProps as $code => &$arIBProp) {
if (!isset($arProperty[$code])) {
continue;
}
if ($arIBProp['PROPERTY_TYPE'] != $arProperty[$code]['type'] || $arIBProp['USER_TYPE'] != null) {
continue;
}
unset($arProperty[$code]);
}
$prp = new CIBlockProperty();
foreach ($arProperty as $sPropertyCode => $arPropertyParams) {
$properties = array("IBLOCK_ID" => $this->IBLOCK_ID, "ACTIVE" => "Y", "CODE" => $sPropertyCode, "MULTIPLE" => "N", "PROPERTY_TYPE" => $arPropertyParams["type"], "NAME" => $arPropertyParams["name"]);
if (isset($arPropertyParams["properties"])) {
$properties += $arPropertyParams["properties"];
}
$res = $prp->Add($properties);
}
if ($this->FORUM_ID !== null && empty($this->arRootSection) && CModule::IncludeModule('forum')) {
$arForum = CForumNew::GetByID($this->FORUM_ID);
if ($arForum['ACTIVE'] == 'Y') {
$arSites = CForumNew::GetSites($this->FORUM_ID);
foreach ($arSites as $siteID => $forumUrl) {
if (strpos($forumUrl, '/community/forum/') === 0) {
$arSites[$siteID] = str_replace(array('///', '//'), '/', $this->base_url . "/element/comment/#TOPIC_ID#/#MESSAGE_ID#/");
}
}
$arUpForum = array();
$arUpForum["SITES"] = $arSites;
CForumNew::Update($this->FORUM_ID, $arUpForum);
}
}
$this->_dataCache($dataType, true);
}
}
示例7: array_shift
$arUser2 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST2"));
$arUser3 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST3"));
$arUser4 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST4"));
$arUser5 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST5"));
$arUser6 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST6"));
$arForums = array(array("XML_ID" => "COMMUNITY_PHOTO_COMMENTS", "NAME" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_NAME"), "DESCRIPTION" => "", "SORT" => 3, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "INDEXATION" => "Y", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", "1" => "Y")), array("XML_ID" => "COMMUNITY_USERS_AND_GROUPS", "NAME" => GetMessage("USERS_AND_GROUPS_FORUM_NAME"), "DESCRIPTION" => GetMessage("USERS_AND_GROUPS_FORUM_DESCRIPTION"), "SORT" => 4, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "INDEXATION" => "Y", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("1" => "Y")));
foreach ($arForums as $arForum) {
$dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"]));
if ($resForum = $dbForum->Fetch()) {
if (WIZARD_INSTALL_DEMO_DATA) {
CForumNew::Delete($resForum["ID"]);
} else {
$res = CForumNew::GetSites($resForum["ID"]);
if (!array_key_exists(WIZARD_SITE_ID, $res)) {
$res[WIZARD_SITE_ID] = WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#";
CForumNew::Update($resForum["ID"], array("SITES" => $res));
}
continue;
}
}
$forumID = CForumNew::Add($arForum);
if ($forumID < 1 || !isset($arForum["TOPICS"]) || !is_array($arForum["TOPICS"])) {
continue;
}
foreach ($arForum["TOPICS"] as $arTopic) {
$arTopic["FORUM_ID"] = $forumID;
$topicID = CForumTopic::Add($arTopic);
if ($topicID < 1 || !isset($arTopic["MESSAGES"]) || !is_array($arTopic["MESSAGES"])) {
continue;
}
foreach ($arTopic["MESSAGES"] as $arMessage) {
示例8: array
$arGroupID[$xmlID] = CForumGroup::Add($arNewGroup);
}
$arForums = array(array("XML_ID" => "USERS_AND_GROUPS", "NAME" => GetMessage("USERS_AND_GROUPS_EXTRANET_FORUM_NAME"), "DESCRIPTION" => GetMessage("USERS_AND_GROUPS_EXTRANET_FORUM_DESCRIPTION"), "SORT" => 101, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array(WIZARD_EXTRANET_ADMIN_GROUP => "Y")), array("XML_ID" => "GROUPS_AND_USERS_FILES_COMMENTS", "NAME" => GetMessage("GROUPS_AND_USERS_FILES_COMMENTS_EXTRANET_NAME"), "DESCRIPTION" => GetMessage("GROUPS_AND_USERS_FILES_COMMENTS_EXTRANET_DECRIPTION"), "SORT" => 106, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["COMMENTS"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array(WIZARD_EXTRANET_GROUP => "M", WIZARD_EXTRANET_ADMIN_GROUP => "Y")), array("XML_ID" => "PHOTOGALLERY_COMMENTS", "NAME" => GetMessage("GROUPS_AND_USERS_PHOTOGALLERY_COMMENTS_EXTRANET_NAME"), "DESCRIPTION" => GetMessage("GROUPS_AND_USERS_PHOTOGALLERY_COMMENTS_EXTRANET_DECRIPTION"), "SORT" => 106, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["COMMENTS"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array(WIZARD_EXTRANET_GROUP => "M", WIZARD_EXTRANET_ADMIN_GROUP => "Y")));
$default_site_id = CSite::GetDefSite();
if (strlen($default_site_id) > 0) {
foreach ($arForums as $arForum) {
$dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"]));
if ($arForumTmp = $dbForum->Fetch()) {
continue;
} else {
$dbForumDefault = CForumNew::GetList(array(), array("SITE_ID" => $default_site_id, "XML_ID" => $arForum["XML_ID"]));
if ($arForumDefault = $dbForumDefault->Fetch()) {
$arSites = CForumNew::GetSites($arForumDefault["ID"]);
$arSites[WIZARD_SITE_ID] = WIZARD_SITE_DIR;
$arForumFields = array("ACTIVE" => $arForumDefault["ACTIVE"], "SITES" => $arSites);
CForumNew::Update($arForumDefault["ID"], $arForumFields);
} else {
$forumID = CForumNew::Add($arForum);
}
}
}
}
$UsersAndGroupsForumID = 0;
$dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "USERS_AND_GROUPS"));
if ($arRes = $dbRes->Fetch()) {
$UsersAndGroupsForumID = $arRes["ID"];
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index.php", array("FORUM_ID" => $UsersAndGroupsForumID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", array("FORUM_ID" => $UsersAndGroupsForumID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/contacts/personal.php", array("FORUM_ID" => $UsersAndGroupsForumID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", array("FORUM_ID" => $UsersAndGroupsForumID));