/* "C" - Course, "H" - cHapter, "L" - Lesson, */ $affectedRows = 0; $dbSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y")); while ($arSite = $dbSites->Fetch()) { //BXClearCache(True, "/".$arSite["LID"]."/blog/"); foreach ($arType as $type) { if (IntVal($arPaths[$arSite["LID"]][$type]) > 0) { if (strlen(${"SITE_PATH_" . $arSite["LID"] . "_" . $type}) > 0) { if ($arPaths[$arSite["LID"]][$type]["PATH"] != ${"SITE_PATH_" . $arSite["LID"] . "_" . $type}) { $affectedRows++; } CSitePath::Update($arPaths[$arSite["LID"]][$type]["ID"], array("PATH" => ${"SITE_PATH_" . $arSite["LID"] . "_" . $type}, "TYPE" => $type)); } else { CSitePath::Delete($arPaths[$arSite["LID"]][$type]["ID"]); $affectedRows++; } } else { CSitePath::Add(array("SITE_ID" => $arSite["LID"], "PATH" => ${"SITE_PATH_" . $arSite["LID"] . "_" . $type}, "TYPE" => $type)); $affectedRows++; } } unset($arPaths[$arSite["LID"]]); } if ($affectedRows && IsModuleInstalled('search') && CModule::IncludeModule("search")) { CSearch::ReindexModule("learning"); } foreach ($arPaths as $key) {