$res["LAST_POSTER_NAME"] = $parser->wrap_long_words($res["LAST_POSTER_NAME"]); $res["LAST_POST_DATE"] = CForumFormat::DateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($res["LAST_POST_DATE"], CSite::GetDateFormat())); $res["START_DATE"] = CForumFormat::DateFormat($arParams["DATE_FORMAT"], MakeTimeStamp($res["START_DATE"], CSite::GetDateFormat())); /*******************************************************************/ $res["URL"] = array("TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_TOPIC"], array("TID" => $res["ID"], "MID" => "s", "UID" => $arParams["USER_ID"], "GID" => $arParams["SOCNET_GROUP_ID"])), "READ" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_TOPIC"], array("TID" => $res["ID"], "MID" => "s", "UID" => $arParams["USER_ID"], "GID" => $arParams["SOCNET_GROUP_ID"])), "LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("TID" => $res["ID"], "MID" => $res["LAST_MESSAGE_ID"], "UID" => $arParams["USER_ID"], "GID" => $arParams["SOCNET_GROUP_ID"])), "UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_TOPIC"], array("TID" => $res["ID"], "MID" => "unread_mid", "UID" => $arParams["USER_ID"], "GID" => $arParams["SOCNET_GROUP_ID"])), "MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_TOPIC"], array("TID" => $res["ID"], "MID" => "unread_mid", "UID" => $arParams["USER_ID"], "GID" => $arParams["SOCNET_GROUP_ID"])), "USER_START" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"], "GID" => $arParams["SOCNET_GROUP_ID"])), "LAST_POSTER" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["LAST_POSTER_ID"], "GID" => $arParams["SOCNET_GROUP_ID"]))); foreach ($res["URL"] as $key => $val) { $res["URL"]["~" . $key] = $val; $res["URL"][$key] = htmlspecialcharsbx($val); } /*******************************************************************/ $arResult["TOPICS"][] = $res; } if ($arParams["SOCNET_GROUP_ID"] > 0 && $USER->IsAuthorized() && CModule::IncludeModule("mail")) { $arResult["EMAIL_INTEGRATION"] = CForumEMail::GetForumFilters($arParams["FID"], $arParams["SOCNET_GROUP_ID"]); if ($arResult["EMAIL_INTEGRATION"]) { $dbMBF = CMailFilter::GetById($arResult["EMAIL_INTEGRATION"]["MAIL_FILTER_ID"]); $arResult["EMAIL_INTEGRATION"]["MAIL_FILTER"] = $dbMBF->Fetch(); $arFields = array("USER_ID" => $USER->GetID(), "FORUM_ID" => $arParams["FID"], "TOPIC_ID" => 0, "SITE_ID" => SITE_ID, "SOCNET_GROUP_ID" => $arParams["SOCNET_GROUP_ID"]); $db_res = CForumSubscribe::GetList(array(), $arFields); if ($db_res && ($res = $db_res->Fetch())) { $arResult["USER"]["SUBSCRIBE"] = "Y"; } } // если пользователь имеет право на модуль почты: if ($arParams["PERMISSION"] >= "Y" && $APPLICATION->GetGroupRight("mail") > "R") { $arResult["MAILBOXES"] = array(); $dbrMailF = CMailFilter::GetList(array(), array("SERVER_TYPE" => "smtp", "EMPTY" => "Y")); while ($arMailF = $dbrMailF->GetNext()) { $arResult["MAILBOXES"][] = $arMailF; } $dbrMailF = CMailFilter::GetList(array(), array("SERVER_TYPE" => "pop3", "ACTION_TYPE" => "forumsocnet"));
if (isset($arRegexpData['DEAL'])) { $arCurrentMailBox['REGEXP_DEAL'] = $arSettings['REGEXP_DEAL'] = $arRegexpData['DEAL']; } } // Allow creation of new pop3 mail box only if it is not found if (!$pop3MailBoxExist) { if (count($arResult['MAILBOXES_LIST']) == 1) { // Remove 'Select mail box' item if there are no mail boxes unset($arResult['MAILBOXES_LIST']['-1']); } $arResult['MAILBOXES_LIST']['0'] = GetMessage('CRM_EMAIL_MAILBOX_NEW'); } // Mail filter ID $mailFilterID = intval(COption::GetOptionString('crm', 'mail_filter', 0)); if ($mailFilterID > 0) { $rsMailFilter = CMailFilter::GetById($mailFilterID); $arMailFilter = $rsMailFilter->Fetch(); if (is_array($arMailFilter)) { $mailBoxID = $arMailFilter['MAILBOX_ID']; // Putting saved filter settings in associated mail box if (isset($arSettings['MAILBOXES'][$mailBoxID])) { $mailBox =& $arSettings['MAILBOXES'][$mailBoxID]; $arActions = explode('&', $arMailFilter['ACTION_VARS']); for ($i = count($arActions) - 1; $i >= 0; $i--) { $arExp = explode('=', $arActions[$i]); if (!isset($arExp[1])) { continue; } $expName = ''; if ($i == 0) { $expName = 'REGEXP_LEAD';