当前位置: 首页>>代码示例>>PHP>>正文


PHP CSearch::ChangeSite方法代码示例

本文整理汇总了PHP中CSearch::ChangeSite方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::ChangeSite方法的具体用法?PHP CSearch::ChangeSite怎么用?PHP CSearch::ChangeSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSearch的用法示例。


在下文中一共展示了CSearch::ChangeSite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: UpdateForumTopicIndex

 function UpdateForumTopicIndex($topic_id, $entity_type, $entity_id, $feature, $operation, $path_template)
 {
     global $DB;
     if (!CModule::IncludeModule("forum")) {
         return;
     }
     $topic_id = intval($topic_id);
     $rsForumTopic = $DB->Query("SELECT FORUM_ID FROM b_forum_topic WHERE ID = " . $topic_id);
     $arForumTopic = $rsForumTopic->Fetch();
     if (!$arForumTopic) {
         return;
     }
     $arGroups = $this->GetSearchGroups($entity_type, $entity_id, $feature, $operation);
     CSearch::ChangePermission("forum", $arGroups, false, $arForumTopic["FORUM_ID"], $topic_id);
     $rsForumMessages = $DB->Query("\n\t\t\tSELECT ID\n\t\t\tFROM b_forum_message\n\t\t\tWHERE TOPIC_ID = " . intval($topic_id) . "\n\t\t");
     while ($arMessage = $rsForumMessages->Fetch()) {
         $url = str_replace(array("#topic_id#", "#message_id#", "#action#"), array($arTopic["ID"], $arMessage["ID"], ""), $path_template);
         CSearch::ChangeSite("forum", array(SITE_ID => $url), $arMessage["ID"]);
         $this->_counter++;
     }
     $arParams = $this->GetSearchParams($entity_type, $entity_id, $feature, $operation);
     CSearch::ChangeIndex("forum", array("UPD" => $this->_sess_id, "PARAMS" => $arParams), false, $arForumTopic["FORUM_ID"], $topic_id);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:23,代码来源:search_reindex.php

示例2: ChangeIndex

	function ChangeIndex($MODULE_ID, $arFields, $ITEM_ID=false, $PARAM1=false, $PARAM2=false, $SITE_ID=false)
	{
		$DB = CDatabase::GetModuleConnection('search');

		if(array_key_exists("TITLE", $arFields))
			$arFields["TITLE"] = Trim($arFields["TITLE"]);

		if(array_key_exists("BODY", $arFields))
			$arFields["BODY"] = Trim($arFields["BODY"]);

		if(array_key_exists("PERMISSIONS", $arFields) && is_array($arFields["PERMISSIONS"]))
			CSearch::ChangePermission($MODULE_ID, $arFields["PERMISSIONS"], $ITEM_ID, $PARAM1, $PARAM2, $SITE_ID);

		if(array_key_exists("SITE_ID", $arFields) && is_array($arFields["SITE_ID"]))
			CSearch::ChangeSite($MODULE_ID, $arFields["SITE_ID"], $ITEM_ID, $PARAM1, $PARAM2, $SITE_ID);

		$strUpdate = $DB->PrepareUpdate("b_search_content", $arFields);
		if(strlen($strUpdate) > 0)
		{
			$strSqlWhere = CSearch::__PrepareFilter(Array("MODULE_ID"=>$MODULE_ID, "ITEM_ID"=>$ITEM_ID, "PARAM1"=>$PARAM1, "PARAM2"=>$PARAM2, "SITE_ID"=>$SITE_ID), $bIncSites);
			$strSql = "
				SELECT sc.ID
				FROM b_search_content sc
				".($bIncSites? "INNER JOIN b_search_content_site scsite ON sc.ID=scsite.SEARCH_CONTENT_ID": "")."
				".(strlen($strSqlWhere)>0? "WHERE ".$strSqlWhere: "")."
			";
			$rs = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
			while($ar = $rs->Fetch())
			{
				$strSql = "UPDATE b_search_content SET ".$strUpdate." WHERE ID=".$ar["ID"];
				$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);

				if(array_key_exists("PARAMS", $arFields))
					CSearch::SetContentItemParams($ar["ID"], $arFields["PARAMS"]);
			}
		}
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:37,代码来源:search.php

示例3: UpdateForumTopicIndex

 function UpdateForumTopicIndex($topic_id, $entity_type, $entity_id, $feature, $operation, $path, $arPermissions, $siteID)
 {
     global $DB;
     if (!CModule::IncludeModule("forum")) {
         return;
     }
     $topic_id = intval($topic_id);
     $rsForumTopic = $DB->Query("SELECT FORUM_ID FROM b_forum_topic WHERE ID = " . $topic_id);
     $arForumTopic = $rsForumTopic->Fetch();
     if (!$arForumTopic) {
         return;
     }
     CSearch::ChangePermission("forum", $arPermissions, false, $arForumTopic["FORUM_ID"], $topic_id);
     $rsForumMessages = $DB->Query("\n\t\t\tSELECT ID\n\t\t\tFROM b_forum_message\n\t\t\tWHERE TOPIC_ID = " . $topic_id . "\n\t\t");
     while ($arMessage = $rsForumMessages->Fetch()) {
         CSearch::ChangeSite("forum", array($siteID => $path), $arMessage["ID"]);
     }
     $arParams = array("feature_id" => "S" . $entity_type . "_" . $entity_id . "_" . $feature . "_" . $operation, "socnet_user" => $entity_id);
     CSearch::ChangeIndex("forum", array("PARAMS" => $arParams), false, $arForumTopic["FORUM_ID"], $topic_id);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:20,代码来源:task.php


注:本文中的CSearch::ChangeSite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。