45 $this->_user_id = intval($user_id);
46 $this->_group_id = intval($group_id);
58 if(!array_key_exists(
"BX_SOCNET_REINDEX_SESS_ID", $_SESSION))
59 $_SESSION[
"BX_SOCNET_REINDEX_SESS_ID"] =
array();
61 $key = md5(uniqid(
""));
62 foreach($arType as
$type)
63 $_SESSION[
"BX_SOCNET_REINDEX_SESS_ID"][
$type] =
$key;
65 $_SESSION[
"BX_SOCNET_REINDEX_SESS_ID"][
"KEY"] =
$key;
72 if(!CModule::IncludeModule(
'forum'))
75 $rsForumMessages =
$DB->Query(
"
76 SELECT ft.ID TOPIC_ID, ft.SOCNET_GROUP_ID, ft.OWNER_ID, fm.ID
79 INNER JOIN b_forum_message fm ON fm.TOPIC_ID = ft.ID
81 fm.ID > ".intval($last_id).
"
82 ".($entity_type ==
"G"?
83 "AND ft.SOCNET_GROUP_ID IS NOT NULL AND ft.SOCNET_GROUP_ID > 0":
84 "AND (ft.SOCNET_GROUP_ID IS NULL OR ft.SOCNET_GROUP_ID = 0) AND ft.OWNER_ID IS NOT NULL"
88 while($arMessage = $rsForumMessages->Fetch())
99 $arMessage[
"OWNER_ID"],
100 $arMessage[
"SOCNET_GROUP_ID"],
101 $arMessage[
"TOPIC_ID"],
110 ), $arMessage[
"ID"]);
114 $entity_type==
"G"? $arMessage[
"SOCNET_GROUP_ID"]: $arMessage[
"OWNER_ID"],
121 $entity_type==
"G"? $arMessage[
"SOCNET_GROUP_ID"]: $arMessage[
"OWNER_ID"],
131 if($this->_end_time && $this->_end_time <= time())
132 return $arMessage[
"ID"];
140 if(!is_array($this->_blog_cache))
141 $this->_blog_cache =
array();
142 if(!array_key_exists(
$ID, $this->_blog_cache))
145 $rsBlog =
$DB->Query(
"
146 SELECT ID, OWNER_ID, SOCNET_GROUP_ID
148 WHERE ID = ".intval(
$ID).
"
150 AND GROUP_ID = ".intval($this->_params[
"BLOG_GROUP_ID"]).
"
152 $this->_blog_cache[
$ID] = $rsBlog->Fetch();
154 return $this->_blog_cache[
$ID];
166 switch(mb_substr(
$ID, 0, 1))
172 && intval($blog[
"SOCNET_GROUP_ID"]) <= 0
173 && intval($blog[
"OWNER_ID"]) > 0
174 && $this->_params[
"PATH_TO_USER_BLOG_POST"] <>
''
179 intval($blog[
"OWNER_ID"]),
202 $blog[
"SOCNET_GROUP_ID"],
205 $this->_params[
"PATH_TO_USER_BLOG_POST"]
218 && intval($blog[
"SOCNET_GROUP_ID"]) <= 0
219 && intval($blog[
"OWNER_ID"]) > 0
220 && $this->_params[
"PATH_TO_USER_BLOG_COMMENT"] <>
''
225 intval($blog[
"OWNER_ID"]),
249 $blog[
"SOCNET_GROUP_ID"],
253 $this->_params[
"PATH_TO_USER_BLOG_COMMENT"]
264 if($this->_end_time && $this->_end_time <= time())
272 if($this->_end_time && $this->_end_time <= time())
282 if(!CModule::IncludeModule(
'blog'))
285 if(mb_substr($last_id, 0, 1) ==
"0")
288 if($entity_type==
"G")
294 ), $this,
"IndexBlogItemUser");
302 if(!CModule::IncludeModule(
"forum"))
305 $topic_id = intval($topic_id);
307 $rsForumTopic =
$DB->Query(
"SELECT FORUM_ID FROM b_forum_topic WHERE ID = ".$topic_id);
308 $arForumTopic = $rsForumTopic->Fetch();
321 $rsForumMessages =
$DB->Query(
"
324 WHERE TOPIC_ID = ".intval($topic_id).
"
326 while($arMessage = $rsForumMessages->Fetch())
344 ), $arMessage[
"ID"]);
359 function ReindexIBlock($iblock_id, $entity_type, $feature, $operation, $path_template, $arFieldList, $last_id)
363 if(!CModule::IncludeModule(
"iblock"))
368 $rsElements = CIBlockElement::GetList(
371 "IBLOCK_ID" => $iblock_id,
372 ">ID" => intval($last_id),
373 "CHECK_PERMISSIONS" =>
"N",
377 array(
"ID",
"IBLOCK_ID",
"IBLOCK_TYPE_ID",
"NAME",
"TAGS",
"TIMESTAMP_X",
"IBLOCK_SECTION_ID"),
385 $rsPath = CIBlockSection::GetNavChain(
$arFields[
"IBLOCK_ID"],
$arFields[
"IBLOCK_SECTION_ID"]);
386 $arSection = $rsPath->Fetch();
387 if($entity_type ==
"G")
409 ($entity_type ==
"G"?
"group_":
"user_").$entity_id,
419 if($feature ==
"wiki")
421 foreach($arFieldList as $field)
425 if($field ==
"PREVIEW_TEXT" || $field ==
"DETAIL_TEXT")
427 if(isset($CWikiParser))
434 elseif($field == $this->_file_property)
436 $arFile = CIBlockElement::__GetFileContent(
$arFields[$this->_file_property.
"_VALUE"]);
437 if(is_array($arFile))
439 $text = $arFile[
"CONTENT"];
440 $arFields[
"TAGS"] .=
",".$arFile[
"PROPERTIES"][COption::GetOptionString(
"search",
"page_tag_property")];
443 elseif($field ==
"PROPERTY_FORUM_TOPIC_ID")
445 $topic_id = intval(
$arFields[
"PROPERTY_FORUM_TOPIC_ID_VALUE"]);
447 $this->
UpdateForumTopicIndex($topic_id, $entity_type, $entity_id, $feature, $operation, $this->
Url(
$url,
array(
"MID" =>
"#message_id#"),
"message#message_id#"));
450 $body .=
$text.
"\n\r";
453 if(isset($CWikiParser))
465 if (CIBlock::GetArrayByID(
$arFields[
"IBLOCK_ID"],
"RIGHTS_MODE") ==
"E")
468 $arPermissions = $obElementRights->GetGroups(
array(
"element_read"));
472 "LAST_MODIFIED" =>
$arFields[
"TIMESTAMP_X"],
478 "PARAM3" => $entity_id,
480 "PERMISSIONS" => $arPermissions,
487 "REINDEX_FLAG" =>
true,
488 ),
true, $this->_sess_id);
493 if($this->_end_time && $this->_end_time <= time())
503 "MODULE" =>
"socialnetwork",
504 ), $this,
"IndexItem");
525 function StepIndex($arSteps, $current_step, $last_id, $timeout=0)
529 if(!CModule::IncludeModule(
'search'))
532 foreach ($_SESSION[
"BX_SOCNET_REINDEX_SESS_ID"] as
$key => $value)
533 $_SESSION[
"BX_SOCNET_REINDEX_SESS_ID"][
$key] =
$DB->ForSQL($value);
536 $this->_end_time = time()+$timeout;
538 $this->_end_time = 0;
542 $this->_sess_id = $_SESSION[
"BX_SOCNET_REINDEX_SESS_ID"][
"KEY"];
546 $next_step = array_shift($arSteps);
547 }
while ($next_step != $current_step);
549 if(
count($arSteps) <= 0)
552 $next_step = array_shift($arSteps);
554 switch($current_step)
566 $blog_group = intval($this->_params[
"BLOG_GROUP_ID"]);
572 $blog_group = intval($this->_params[
"BLOG_GROUP_ID"]);
578 $path_template = trim($this->_params[
"PATH_TO_GROUP_FORUM_MESSAGE"]);
579 if($path_template <>
'')
581 $last_id = $this->
ReindexForum(
"G", $last_id, $path_template);
586 $path_template = trim($this->_params[
"PATH_TO_USER_FORUM_MESSAGE"]);
587 if($path_template <>
'')
589 $last_id = $this->
ReindexForum(
"U", $last_id, $path_template);
594 $path_template = trim($this->_params[
"PATH_TO_GROUP_PHOTO_ELEMENT"]);
595 $iblock = intval($this->_params[
"PHOTO_GROUP_IBLOCK_ID"]);
597 if(mb_strlen($path_template) &&
$iblock)
598 $last_id = $this->
ReindexIBlock(
$iblock,
"G",
"photo",
"view", $path_template,
array(
"PREVIEW_TEXT",
"PROPERTY_FORUM_TOPIC_ID"), $last_id);
604 $path_template = trim($this->_params[
"PATH_TO_USER_PHOTO_ELEMENT"]);
605 $iblock = intval($this->_params[
"PHOTO_USER_IBLOCK_ID"]);
607 if(mb_strlen($path_template) &&
$iblock)
608 $last_id = $this->
ReindexIBlock(
$iblock,
"U",
"photo",
"view", $path_template,
array(
"PREVIEW_TEXT",
"PROPERTY_FORUM_TOPIC_ID"), $last_id);
613 case "group_calendars":
614 $path_template = trim($this->_params[
"PATH_TO_GROUP_CALENDAR_ELEMENT"]);
615 $iblock = intval($this->_params[
"CALENDAR_GROUP_IBLOCK_ID"]);
617 if(mb_strlen($path_template) &&
$iblock)
624 $path_template = trim($this->_params[
"PATH_TO_GROUP_FILES_ELEMENT"]);
625 $iblock = intval($this->_params[
"FILES_GROUP_IBLOCK_ID"]);
627 $property = mb_strtoupper(trim($this->_params[
"FILES_PROPERTY_CODE"]));
630 $this->_file_property =
"PROPERTY_".$property;
632 if(mb_strlen($path_template) &&
$iblock)
633 $last_id = $this->
ReindexIBlock(
$iblock,
"G",
"files",
"view", $path_template,
array($this->_file_property,
"PROPERTY_FORUM_TOPIC_ID"), $last_id);
639 if(CModule::IncludeModule(
"wiki"))
641 $path_template = trim($this->_params[
"PATH_TO_GROUP"]).
"wiki/#name#/";
642 $iblock = intval(COption::GetOptionInt(
"wiki",
"socnet_iblock_id"));
644 if(mb_strlen($path_template) &&
$iblock)
652 $path_template = trim($this->_params[
"PATH_TO_USER_FILES_ELEMENT"]);
653 $iblock = intval($this->_params[
"FILES_USER_IBLOCK_ID"]);
655 $property = mb_strtoupper(trim($this->_params[
"FILES_PROPERTY_CODE"]));
658 $this->_file_property =
"PROPERTY_".$property;
660 if(mb_strlen($path_template) &&
$iblock)
661 $last_id = $this->
ReindexIBlock(
$iblock,
"U",
"files",
"view", $path_template,
array($this->_file_property,
"PROPERTY_FORUM_TOPIC_ID"), $last_id);
676 if($last_id > 0 || preg_match(
'/^.\d/', $last_id))
677 return array(
"step" => $current_step,
"last_id" => $last_id);
679 return array(
"step" => $next_step,
"last_id" => 0);
static ChangeIndex($MODULE_ID, $arFields, $ITEM_ID=false, $PARAM1=false, $PARAM2=false, $SITE_ID=false)
static ChangePermission($MODULE_ID, $arGroups, $ITEM_ID=false, $PARAM1=false, $PARAM2=false, $SITE_ID=false, $PARAMS=false)
static DeleteOld($SESS_ID, $MODULE_ID='', $SITE_ID='')
static ChangeSite($MODULE_ID, $arSite, $ITEM_ID=false, $PARAM1=false, $PARAM2=false, $SITE_ID=false)
static Index($MODULE_ID, $ITEM_ID, $arFields, $bOverWrite=false, $SEARCH_SESS_ID='')
static OnSearchReindex($NS=Array(), $oCallback=NULL, $callback_method="")
static OnSearchReindex($NS=Array(), $oCallback=NULL, $callback_method="")
static GetSearchGroups($entity_type, $entity_id, $feature, $operation)
Url($url, $params, $ancor)
static GetSearchParams($entity_type, $entity_id, $feature, $operation)
__construct($user_id=0, $group_id=0, $arParams=array())
IndexBlogItemGroup($arFields)
static OnBeforeIndexDelete($strWhere)
IndexBlogItemUser($arFields)
StepIndex($arSteps, $current_step, $last_id, $timeout=0)
ReindexBlog($entity_type, $last_id)
ReindexForum($entity_type, $last_id, $path_template)
ReindexIBlock($iblock_id, $entity_type, $feature, $operation, $path_template, $arFieldList, $last_id)
UpdateForumTopicIndex($topic_id, $entity_type, $entity_id, $feature, $operation, $path_template)
static OnBeforeFullReindexClear()
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(! $catalogEdit->isSuccess()) $iblock
HTMLToTxt($str, $strSiteUrl="", $aDelete=[], $maxlen=70)
GetMessage($name, $aReplace=null)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"