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


PHP CSocNetLogTools::GetSiteData方法代码示例

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


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

示例1: BeforeIndexForum

 function BeforeIndexForum($arFields, $entity_type, $entity_id, $feature, $operation, $path_template)
 {
     global $USER;
     static $arSiteData;
     $SECTION_ID = "";
     $ELEMENT_ID = intval($_REQUEST["photo_element_id"]);
     if (empty($ELEMENT_ID)) {
         $ELEMENT_ID = intval($_REQUEST["ELEMENT_ID"]);
     }
     if ($ELEMENT_ID > 0 && CModule::IncludeModule('iblock')) {
         $rsSections = CIBlockElement::GetElementGroups($ELEMENT_ID, true);
         $arSection = $rsSections->Fetch();
         if ($arSection) {
             $SECTION_ID = $arSection["ID"];
         }
     }
     if (count($arFields["LID"]) > 1 && ($entity_type == SONET_ENTITY_GROUP && CModule::IncludeModule("extranet") || $entity_type == SONET_ENTITY_USER)) {
         if (!$arSiteData) {
             $arSiteData = CSocNetLogTools::GetSiteData();
         }
         foreach ($arSiteData as $siteId => $arUrl) {
             if ($entity_type == SONET_ENTITY_GROUP && strpos($path_template, $arUrl["GROUPS_PATH"]) === 0) {
                 $path_template = str_replace($arUrl["GROUPS_PATH"], "#GROUP_PATH#", $path_template);
                 break;
             } elseif ($entity_type == SONET_ENTITY_USER && strpos($path_template, $arUrl["USER_PATH"]) === 0) {
                 $path_template = str_replace($arUrl["USER_PATH"], "#USER_PATH#", $path_template);
                 break;
             }
         }
     }
     foreach ($arFields["LID"] as $site_id => $url) {
         $arFields["URL"] = $arFields["LID"][$site_id] = str_replace(array("#user_id#", "#group_id#", "#topic_id#", "#message_id#", "#action#", "#user_alias#", "#section_id#", "#element_id#", "#task_id#", "#GROUP_PATH#", "#USER_PATH#"), array($this->_user_id > 0 ? $this->_user_id : $USER->GetID(), $this->_group_id, $arFields["PARAM2"], $arFields["ITEM_ID"], "view", ($entity_type == "G" ? "group_" : "user_") . $entity_id, $SECTION_ID, $ELEMENT_ID, $ELEMENT_ID, $arSiteData ? $arSiteData[$site_id]["GROUPS_PATH"] : "", $arSiteData ? $arSiteData[$site_id]["USER_PATH"] : ""), $path_template);
     }
     if ($feature == 'tasks' && COption::GetOptionString("intranet", "use_tasks_2_0", "N") == 'Y' && $arFields["PARAM1"] == COption::GetOptionString("tasks", "task_forum_id", 0) && CModule::IncludeModule('tasks')) {
         if (!preg_match('/^EVENT_[0-9]+/', $arFields["TITLE"], $match)) {
             $rsTask = CTasks::GetList(array(), array("FORUM_TOPIC_ID" => $arFields['PARAM2']));
             if ($arTask = $rsTask->Fetch()) {
                 $arFields['PERMISSIONS'] = CTasks::__GetSearchPermissions($arTask);
             }
         }
     } else {
         $arFields["PERMISSIONS"] = $this->GetSearchGroups($entity_type, $entity_id, $feature, $operation);
         $paramsTmp = $this->GetSearchParams($entity_type, $entity_id, $feature, $operation);
         $arFields["PARAMS"] = !empty($arFields["PARAMS"]) ? array_merge($paramsTmp, $arFields["PARAMS"]) : $paramsTmp;
     }
     return $arFields;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:47,代码来源:search.php

示例2: GetMessageRatingEntityURL

 private static function GetMessageRatingEntityURL($url, $user_id = false, $arSites = false, $intranet_site_id = false, $extranet_site_id = false)
 {
     static $arSiteData = false;
     if (!$arSiteData && IsModuleInstalled('intranet') && CModule::IncludeModule('socialnetwork')) {
         $arSiteData = CSocNetLogTools::GetSiteData();
     }
     if ($arSiteData && count($arSiteData) > 1) {
         foreach ($arSiteData as $siteId => $arUrl) {
             $url = str_replace($arUrl["USER_PATH"], "#USER_PATH#", $url);
         }
         $arTmp = CSocNetLogTools::ProcessPath(array("URL" => $url), $user_id);
         $url = $arTmp["URLS"]["URL"];
         $url = (strpos($url, "http://") === 0 || strpos($url, "https://") === 0 ? "" : (isset($arTmp["SERVER_NAME"]) && !empty($arTmp["SERVER_NAME"]) ? $arTmp["SERVER_NAME"] : "")) . $arTmp["URLS"]["URL"];
     } else {
         if (is_array($arSites) && intval($user_id) > 0 && strlen($extranet_site_id) > 0 && strlen($intranet_site_id) > 0) {
             $bExtranetUser = false;
             if ($arSites[$extranet_site_id]) {
                 $bExtranetUser = true;
                 $rsUser = CUser::GetByID(intval($user_id));
                 if ($arUser = $rsUser->Fetch()) {
                     if (intval($arUser["UF_DEPARTMENT"][0]) > 0) {
                         $bExtranetUser = false;
                     }
                 }
             }
             if ($bExtranetUser) {
                 $link = $url;
                 if (substr($link, 0, strlen($arSites[$extranet_site_id]['DIR'])) == $arSites[$extranet_site_id]['DIR']) {
                     $link = substr($link, strlen($arSites[$extranet_site_id]['DIR']));
                 }
                 $SiteServerName = $arSites[$extranet_site_id]['SERVER_NAME'] . $arSites[$extranet_site_id]['DIR'] . ltrim($link, "/");
             } else {
                 $link = $url;
                 if (substr($link, 0, strlen($arSites[$intranet_site_id]['DIR'])) == $arSites[$intranet_site_id]['DIR']) {
                     $link = substr($link, strlen($arSites[$intranet_site_id]['DIR']));
                 }
                 $SiteServerName = $arSites[$intranet_site_id]['SERVER_NAME'] . $arSites[$intranet_site_id]['DIR'] . ltrim($link, "/");
             }
             $url = (CMain::IsHTTPS() ? "https" : "http") . "://" . $SiteServerName;
         } else {
             $SiteServerName = defined('SITE_SERVER_NAME') && strlen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name", $_SERVER['SERVER_NAME']);
             if (strlen($SiteServerName) > 0) {
                 $url = (CMain::IsHTTPS() ? "https" : "http") . "://" . $SiteServerName . $url;
             }
         }
     }
     return $url;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:48,代码来源:im_event.php


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