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


PHP CSocNetUserRelations::GetList方法代码示例

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


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

示例1: OnSearchCheckPermissions

 function OnSearchCheckPermissions($FIELD)
 {
     global $DB, $USER;
     $user_id = intval($USER->GetID());
     $arResult = array();
     if ($user_id > 0) {
         $arResult[] = "SU" . $user_id . "_Z";
         $rsFriends = CSocNetUserRelations::GetList(array(), array("USER_ID" => $user_id, "RELATION" => SONET_RELATIONS_FRIEND), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID", "DATE_CREATE", "DATE_UPDATE", "INITIATED_BY"));
         while ($arFriend = $rsFriends->Fetch()) {
             if ($arFriend["FIRST_USER_ID"] != $user_id) {
                 $arResult[] = "SU" . $arFriend["FIRST_USER_ID"] . "_M";
             }
             if ($arFriend["SECOND_USER_ID"] != $user_id) {
                 $arResult[] = "SU" . $arFriend["SECOND_USER_ID"] . "_M";
             }
         }
     }
     $rsGroups = CSocNetUserToGroup::GetList(array(), array("USER_ID" => $user_id), false, false, array("GROUP_ID", "ROLE"));
     while ($arGroup = $rsGroups->Fetch()) {
         $arResult[] = "SG" . $arGroup["GROUP_ID"] . "_" . $arGroup["ROLE"];
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:23,代码来源:search.php

示例2: array

     }
     if (count($arResult["UserPropertiesContact"]["DATA"]) > 0) {
         $arResult["UserPropertiesContact"]["SHOW"] = "Y";
     }
     if (count($arResult["UserPropertiesPersonal"]["DATA"]) > 0) {
         $arResult["UserPropertiesPersonal"]["SHOW"] = "Y";
     }
 }
 if (!$arParams["SHORT_FORM"]) {
     // USER FRIENDS
     $arResult["Friends"] = false;
     if (CSocNetUser::IsFriendsAllowed() && $arResult["CurrentUserPerms"]["Operations"]["viewfriends"]) {
         $dbFriends = CSocNetUserRelations::GetRelatedUsers($arResult["User"]["ID"], SONET_RELATIONS_FRIEND, array("nTopCount" => $arParams["ITEMS_COUNT"]));
         if ($dbFriends) {
             $arResult["Friends"] = array();
             $arResult["Friends"]["Count"] = CSocNetUserRelations::GetList(array(), array("USER_ID" => $arResult["User"]["ID"], "RELATION" => SONET_RELATIONS_FRIEND), array());
             $arResult["Friends"]["List"] = false;
             while ($arFriends = $dbFriends->GetNext()) {
                 if ($arResult["Friends"]["List"] == false) {
                     $arResult["Friends"]["List"] = array();
                 }
                 $pref = IntVal($arResult["User"]["ID"]) == $arFriends["FIRST_USER_ID"] ? "SECOND" : "FIRST";
                 $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arFriends[$pref . "_USER_ID"]));
                 $canViewProfile = CSocNetUserPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $arFriends[$pref . "_USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
                 if (intval($arParams["THUMBNAIL_LIST_SIZE"]) > 0) {
                     if (intval($arFriends[$pref . "_USER_PERSONAL_PHOTO"]) <= 0) {
                         switch ($arFriends[$pref . "_USER_PERSONAL_GENDER"]) {
                             case "M":
                                 $suffix = "male";
                                 break;
                             case "F":
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例3: AddUser

 public function AddUser($chatId, $userId)
 {
     global $DB;
     $chatId = intval($chatId);
     if ($chatId <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_CHAT_ID"), "EMPTY_CHAT_ID");
         return false;
     }
     $arUserId = array();
     if (is_array($userId)) {
         $arUserId = \CIMContactList::PrepareUserIds($userId);
     } else {
         if (intval($userId) > 0) {
             $arUserId[intval($userId)] = intval($userId);
         }
     }
     if ($this->user_id > 0) {
         $arUserId[$this->user_id] = $this->user_id;
     }
     if (count($arUserId) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_USER_ID"), "EMPTY_USER_ID");
         return false;
     }
     if ($this->user_id > 0 && !IsModuleInstalled('intranet') && CModule::IncludeModule('socialnetwork') && CSocNetUser::IsFriendsAllowed()) {
         $arFriendUsers = array();
         $dbFriends = CSocNetUserRelations::GetList(array(), array("USER_ID" => $this->user_id, "RELATION" => SONET_RELATIONS_FRIEND), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID", "DATE_CREATE", "DATE_UPDATE", "INITIATED_BY"));
         while ($arFriends = $dbFriends->Fetch()) {
             $friendId = $this->user_id == $arFriends["FIRST_USER_ID"] ? $arFriends["SECOND_USER_ID"] : $arFriends["FIRST_USER_ID"];
             $arFriendUsers[$friendId] = $friendId;
         }
         foreach ($arUserId as $id => $userId) {
             if ($userId == $this->user_id) {
                 continue;
             }
             if (!isset($arFriendUsers[$userId]) && CIMSettings::GetPrivacy(CIMSettings::PRIVACY_CHAT, $userId) == CIMSettings::PRIVACY_RESULT_CONTACT) {
                 unset($arUserId[$id]);
             }
         }
         if (count($arUserId) <= 0) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_USER_ID_BY_PRIVACY"), "EMPTY_USER_ID_BY_PRIVACY");
             return false;
         }
     }
     $strSql = "\n\t\t\tSELECT\n\t\t\t\tR.CHAT_ID, C.TITLE CHAT_TITLE, C.AUTHOR_ID CHAT_AUTHOR_ID, C.EXTRANET CHAT_EXTRANET, C.TYPE CHAT_TYPE\n\t\t\tFROM b_im_relation R\n\t\t\tLEFT JOIN b_im_chat C ON R.CHAT_ID = C.ID\n\t\t\tWHERE\n\t\t\t\t" . ($this->user_id > 0 ? "R.USER_ID = " . $this->user_id . " AND " : "") . "\n\t\t\t\tR.MESSAGE_TYPE IN ('" . IM_MESSAGE_OPEN . "','" . IM_MESSAGE_CHAT . "')\n\t\t\t\tAND R.CHAT_ID = " . $chatId . "\n\t\t";
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($arRes = $dbRes->Fetch()) {
         $extranetFlag = $arRes["CHAT_EXTRANET"] == "" ? "" : ($arRes["CHAT_EXTRANET"] == "Y" ? true : false);
         $chatTitle = $arRes['CHAT_TITLE'];
         $chatAuthorId = intval($arRes['CHAT_AUTHOR_ID']);
         $chatType = intval($arRes['CHAT_TYPE']);
         $arRelation = self::GetRelationById($chatId);
         $arExistUser = array();
         foreach ($arRelation as $relation) {
             $arExistUser[] = $relation['USER_ID'];
         }
         if (count($arRelation) + count($arUserId) > 500) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_MAX_USER", array('#COUNT#' => 500)), "MAX_USER");
             return false;
         }
         $arUserId = array_diff($arUserId, $arExistUser);
         if (empty($arUserId)) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_NOTHING_TO_ADD"), "NOTHING_TO_ADD");
             return false;
         }
         $arUserSelect = $arUserId;
         if ($this->user_id > 0) {
             $arUserSelect[] = $this->user_id;
         }
         $arUsers = CIMContactList::GetUserData(array('ID' => array_values($arUserSelect), 'DEPARTMENT' => 'N', 'USE_CACHE' => 'N'));
         $arUsers = $arUsers['users'];
         if ($extranetFlag !== true) {
             $isExtranet = false;
             foreach ($arUsers as $userData) {
                 if ($userData['extranet']) {
                     $isExtranet = true;
                     break;
                 }
             }
             if ($isExtranet || $extranetFlag === "") {
                 IM\ChatTable::update($chatId, array('EXTRANET' => $isExtranet ? "Y" : "N"));
             }
             $extranetFlag = $isExtranet;
         }
         $arUsersName = array();
         foreach ($arUserId as $userId) {
             $arUsersName[] = htmlspecialcharsback($arUsers[$userId]['name']);
         }
         if ($this->user_id > 0) {
             $message = GetMessage("IM_CHAT_JOIN_" . $arUsers[$this->user_id]['gender'], array('#USER_1_NAME#' => htmlspecialcharsback($arUsers[$this->user_id]['name']), '#USER_2_NAME#' => implode(', ', $arUsersName)));
         } else {
             if (count($arUsersName) > 1) {
                 $message = GetMessage("IM_CHAT_SELF_JOIN", array('#USERS_NAME#' => implode(', ', $arUsersName)));
             } else {
                 $arUserList = array_values($arUserId);
                 $message = GetMessage("IM_CHAT_SELF_JOIN_" . $arUsers[$arUserList[0]]['gender'], array('#USER_NAME#' => implode(', ', $arUsersName)));
             }
         }
         $fileMaxId = CIMDisk::GetMaxFileId($chatId);
         $maxId = 0;
         $strSql = "SELECT MAX(ID) ID FROM b_im_message WHERE CHAT_ID = " . $chatId . " GROUP BY CHAT_ID";
//.........这里部分代码省略.........
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:101,代码来源:im_chat.php

示例4: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$arResult["ITEMS_TOTAL"] = 0;
$arResult["ITEMS_MESSAGES"] = 0;
$arResult["ITEMS_REQUESTS_USER"] = 0;
$arResult["ITEMS_REQUESTS_GROUP"] = 0;
/* friends requests */
$arFilter = array("SECOND_USER_ID" => $GLOBALS["USER"]->GetID(), "RELATION" => SONET_RELATIONS_REQUEST);
$dbUserRequests = CSocNetUserRelations::GetList(array(), $arFilter, array("SECOND_USER_ID"), false, array("COUNT" => "ID"));
if ($arUserRequests = $dbUserRequests->Fetch()) {
    $arResult["ITEMS_TOTAL"] += intval($arUserRequests["CNT"]);
    $arResult["ITEMS_REQUESTS_USER"] += intval($arUserRequests["CNT"]);
}
/* group requests */
$arFilter = array("USER_ID" => $GLOBALS["USER"]->GetID(), "ROLE" => SONET_ROLES_REQUEST, "INITIATED_BY_TYPE" => SONET_INITIATED_BY_GROUP);
$dbUserRequests = CSocNetUserToGroup::GetList(array(), $arFilter, array("USER_ID"), false, array("COUNT" => "ID"));
if ($arUserRequests = $dbUserRequests->Fetch()) {
    $arResult["ITEMS_TOTAL"] += intval($arUserRequests["CNT"]);
    $arResult["ITEMS_REQUESTS_GROUP"] += intval($arUserRequests["CNT"]);
}
/* messages */
$arFilter = array("TO_USER_ID" => $GLOBALS["USER"]->GetID(), "DATE_VIEW" => "", "TO_DELETED" => "N", "IS_LOG_ALL" => "Y");
$dbUserRequests = CSocNetMessages::GetList(array(), $arFilter, array("TO_USER_ID"), false, array("COUNT" => "ID"));
if ($arUserRequests = $dbUserRequests->Fetch()) {
    $arResult["ITEMS_TOTAL"] += intval($arUserRequests["CNT"]);
    $arResult["ITEMS_MESSAGES"] += intval($arUserRequests["CNT"]);
}
开发者ID:webgksupport,项目名称:alpina,代码行数:30,代码来源:result_modifier.php

示例5: GetStatus

	public static function GetStatus($arParams = Array())
	{
		if (!is_array($arParams))
			$arParams = Array();

		$arID = Array();
		if (isset($arParams['ID']) && is_array($arParams['ID']) && !empty($arParams['ID']))
		{
			foreach ($arParams['ID'] as $key => $value)
				$arID[] = intval($value);
		}
		else if (isset($arParams['ID']) && intval($arParams['ID']) > 0)
		{
			$arID[] = intval($arParams['ID']);
		}

		global $USER;
		if(!isset($arParams['ID']) && !IsModuleInstalled('intranet') && is_object($USER))
		{
			$arID[] = $USER->GetID();
			if (CModule::IncludeModule('socialnetwork') && CSocNetUser::IsFriendsAllowed())
			{
				$dbFriends = CSocNetUserRelations::GetList(array(),array("USER_ID" => $USER->GetID(), "RELATION" => SONET_RELATIONS_FRIEND), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID"));
				if ($dbFriends)
				{
					while ($arFriends = $dbFriends->GetNext(true, false))
					{
						$friendId = $pref = (IntVal($USER->GetID()) == $arFriends["FIRST_USER_ID"]) ? $arFriends["SECOND_USER_ID"] : $arFriends["FIRST_USER_ID"];
						$arID[] = $friendId;
					}
				}
			}
		}

		$arUsers = Array();
		$dbUsers = CUser::GetList(($sort_by = 'ID'), ($sort_dir = 'asc'), array('LAST_ACTIVITY' => '180'), array('FIELDS' => array("ID")));
		while ($arUser = $dbUsers->GetNext(false, false))
		{
			if (!empty($arID) && !in_array($arUser["ID"], $arID))
				continue;

			$arUsers[$arUser["ID"]] = Array(
				'id' => $arUser["ID"],
				'status' => 'online',
			);
		}

		return Array('users' => $arUsers);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:49,代码来源:im_contact_list.php

示例6: RejectRequestToBeFriend

	function RejectRequestToBeFriend($senderUserID, $relationID)
	{
		global $APPLICATION;

		$senderUserID = IntVal($senderUserID);
		if ($senderUserID <= 0)
		{
			$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_SENDER_USER_ID"), "ERROR_SENDER_USER_ID");
			return false;
		}

		$relationID = IntVal($relationID);
		if ($relationID <= 0)
		{
			$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_TARGET_USER_ID"), "ERROR_RELATION_ID");
			return false;
		}

		$dbResult = CSocNetUserRelations::GetList(
			array(),
			array(
				"ID" => $relationID,
				"SECOND_USER_ID" => $senderUserID,
				"RELATION" => SONET_RELATIONS_REQUEST
			),
			false,
			false,
			array("ID", "FIRST_USER_ID")
		);

		if ($arResult = $dbResult->Fetch())
		{
			if (CSocNetUserRelations::Delete($arResult["ID"]))
			{
				if (CModule::IncludeModule("im"))
				{
					CIMNotify::DeleteByTag("SOCNET|INVITE_USER|".intval($senderUserID)."|".intval($arResult["ID"]));
					$arMessageFields = array(
						"MESSAGE_TYPE" => IM_MESSAGE_SYSTEM,
						"TO_USER_ID" => $arResult["FIRST_USER_ID"],
						"FROM_USER_ID" => $senderUserID,
						"NOTIFY_TYPE" => IM_NOTIFY_FROM,
						"NOTIFY_MODULE" => "socialnetwork",
						"NOTIFY_EVENT" => "invite_user",
						"NOTIFY_TAG" => "SOCNET|INVITE_USER_REJECT",
						"NOTIFY_MESSAGE" => GetMessage("SONET_UR_REJECT_FRIEND_MESSAGE"),
					);
					CIMNotify::Add($arMessageFields);
				}
				else
				{
					$arMessageFields = array(
						"FROM_USER_ID" => $senderUserID,
						"TO_USER_ID" => $arResult["FIRST_USER_ID"],
						"MESSAGE" => GetMessage("SONET_UR_REJECT_FRIEND_MESSAGE"),
						"=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(),
						"MESSAGE_TYPE" => SONET_MESSAGE_SYSTEM
					);
					CSocNetMessages::Add($arMessageFields);
				}
			}
			else
			{
				$errorMessage = "";
				if ($e = $APPLICATION->GetException())
					$errorMessage = $e->GetString();
				if (StrLen($errorMessage) <= 0)
					$errorMessage = GetMessage("SONET_UR_RELATION_DELETE_ERROR");

				$GLOBALS["APPLICATION"]->ThrowException($errorMessage, "ERROR_DELETE_RELATION");
				return false;
			}
		}
		else
		{
			$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_NO_FRIEND_REQUEST"), "ERROR_NO_FRIEND_REQUEST");
			return false;
		}

		CSocNetUserRelations::__SpeedFileCheckMessages($senderUserID);

		return true;
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:83,代码来源:user_relations.php

示例7: AddUser

 public function AddUser($chatId, $userId)
 {
     global $DB;
     $chatId = intval($chatId);
     if ($chatId <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_CHAT_ID"), "EMPTY_CHAT_ID");
         return false;
     }
     $arUserId = array();
     if (is_array($userId)) {
         foreach ($userId as $value) {
             $arUserId[] = intval($value);
         }
     } else {
         $arUserId[] = intval($userId);
     }
     if (count($arUserId) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_USER_ID"), "EMPTY_USER_ID");
         return false;
     }
     if (!IsModuleInstalled('intranet') && CModule::IncludeModule('socialnetwork') && CSocNetUser::IsFriendsAllowed()) {
         global $USER;
         $arFriendUsers = array();
         $dbFriends = CSocNetUserRelations::GetList(array(), array("USER_ID" => $USER->GetID(), "RELATION" => SONET_RELATIONS_FRIEND), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID", "DATE_CREATE", "DATE_UPDATE", "INITIATED_BY"));
         while ($arFriends = $dbFriends->Fetch()) {
             $friendId = $USER->GetID() == $arFriends["FIRST_USER_ID"] ? $arFriends["SECOND_USER_ID"] : $arFriends["FIRST_USER_ID"];
             $arFriendUsers[$friendId] = $friendId;
         }
         foreach ($arUserId as $id => $userId) {
             if ($userId == $USER->GetID()) {
                 continue;
             }
             if (!isset($arFriendUsers[$userId]) && CIMSettings::GetPrivacy(CIMSettings::PRIVACY_CHAT, $userId) == CIMSettings::PRIVACY_RESULT_CONTACT) {
                 unset($arUserId[$id]);
             }
         }
         if (count($arUserId) <= 0) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_USER_ID_BY_PRIVACY"), "EMPTY_USER_ID_BY_PRIVACY");
             return false;
         }
     }
     $strSql = "\n\t\t\tSELECT R.CHAT_ID, C.TITLE CHAT_TITLE, C.AUTHOR_ID CHAT_AUTHOR_ID\n\t\t\tFROM b_im_relation R LEFT JOIN b_im_chat C ON R.CHAT_ID = C.ID\n\t\t\tWHERE R.USER_ID = " . $this->user_id . " AND R.MESSAGE_TYPE = '" . IM_MESSAGE_GROUP . "' AND R.CHAT_ID = " . $chatId;
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($arRes = $dbRes->Fetch()) {
         $chatTitle = $arRes['CHAT_TITLE'];
         $chatAuthorId = intval($arRes['CHAT_AUTHOR_ID']);
         $arRelation = self::GetRelationById($chatId);
         $arExistUser = array();
         foreach ($arRelation as $relation) {
             $arExistUser[] = $relation['USER_ID'];
         }
         if (count($arRelation) + count($arUserId) > 100) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_MAX_USER", array('#COUNT#' => 100)), "MAX_USER");
             return false;
         }
         $arUserId = array_diff($arUserId, $arExistUser);
         if (empty($arUserId)) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_NOTHING_TO_ADD"), "NOTHING_TO_ADD");
             return false;
         }
         $arUserSelect = $arUserId;
         $arUserSelect[] = $this->user_id;
         $arUsers = CIMContactList::GetUserData(array('ID' => array_values($arUserSelect), 'DEPARTMENT' => 'N', 'USE_CACHE' => 'N'));
         $arUsers = $arUsers['users'];
         $maxId = 0;
         $strSql = "SELECT MAX(ID) ID FROM b_im_message WHERE CHAT_ID = " . $chatId . " GROUP BY CHAT_ID";
         $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         if ($arRes = $dbRes->Fetch()) {
             $maxId = $arRes['ID'];
         }
         $fileMaxId = CIMDisk::GetMaxFileId($chatId);
         $arUsersName = array();
         foreach ($arUserId as $userId) {
             $arUsersName[] = htmlspecialcharsback($arUsers[$userId]['name']);
             CIMContactList::SetRecent($chatId, $maxId, true, $userId);
             $strSql = "INSERT INTO b_im_relation (CHAT_ID, MESSAGE_TYPE, USER_ID, START_ID, LAST_ID, LAST_SEND_ID, LAST_FILE_ID) VALUES (" . $chatId . ",'" . IM_MESSAGE_GROUP . "'," . $userId . "," . ($maxId + 1) . "," . $maxId . "," . $maxId . ", " . $fileMaxId . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
             CIMContactList::CleanChatCache($userId);
         }
         CIMDisk::ChangeFolderMembers($chatId, $arUserId);
         $message = GetMessage("IM_CHAT_JOIN_" . $arUsers[$this->user_id]['gender'], array('#USER_1_NAME#' => htmlspecialcharsback($arUsers[$this->user_id]['name']), '#USER_2_NAME#' => implode(', ', $arUsersName)));
         if (CModule::IncludeModule("pull")) {
             foreach ($arRelation as $ar) {
                 CPullStack::AddByUser($ar['USER_ID'], array('module_id' => 'im', 'command' => 'chatUserAdd', 'params' => array('chatId' => $chatId, 'chatTitle' => $chatTitle, 'chatOwner' => $chatAuthorId, 'users' => $arUsers, 'newUsers' => $arUserId)));
             }
         }
         self::AddMessage(array("TO_CHAT_ID" => $chatId, "MESSAGE" => $message, "FROM_USER_ID" => $this->user_id, "SYSTEM" => 'Y'));
         return true;
     }
     $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_AUTHORIZE_ERROR"), "AUTHORIZE_ERROR");
     return false;
 }
开发者ID:vim84,项目名称:b-markt,代码行数:92,代码来源:im_chat.php

示例8: GetList

 public static function GetList($arParams = array())
 {
     if (!is_array($arParams)) {
         $arParams = array();
     }
     $arID = array();
     if (isset($arParams['ID']) && is_array($arParams['ID']) && !empty($arParams['ID'])) {
         foreach ($arParams['ID'] as $key => $value) {
             $arID[] = intval($value);
         }
     } else {
         if (isset($arParams['ID']) && intval($arParams['ID']) > 0) {
             $arID[] = intval($arParams['ID']);
         }
     }
     global $USER;
     if (!isset($arParams['ID']) && !IsModuleInstalled('intranet') && is_object($USER)) {
         $arID[] = $USER->GetID();
         if (CModule::IncludeModule('socialnetwork') && CSocNetUser::IsFriendsAllowed()) {
             $dbFriends = CSocNetUserRelations::GetList(array(), array("USER_ID" => $USER->GetID(), "RELATION" => SONET_RELATIONS_FRIEND), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID"));
             if ($dbFriends) {
                 while ($arFriends = $dbFriends->GetNext(true, false)) {
                     $friendId = $pref = IntVal($USER->GetID()) == $arFriends["FIRST_USER_ID"] ? $arFriends["SECOND_USER_ID"] : $arFriends["FIRST_USER_ID"];
                     $arID[] = $friendId;
                 }
             }
         }
     }
     $enable = self::Enable();
     $arUsers = array();
     $query = new \Bitrix\Main\Entity\Query(\Bitrix\Main\UserTable::getEntity());
     if ($enable) {
         $query->registerRuntimeField('', new \Bitrix\Main\Entity\ReferenceField('ref', 'Bitrix\\Im\\StatusTable', array('=this.ID' => 'ref.USER_ID')));
     }
     $query->addSelect('ID');
     if ($enable) {
         $query->addSelect('ref.STATUS', 'STATUS')->addSelect('ref.IDLE', 'IDLE');
     }
     $query->addFilter('>LAST_ACTIVITY_DATE', new \Bitrix\Main\DB\SqlExpression(Bitrix\Main\Application::getConnection()->getSqlHelper()->addSecondsToDateTime('-180')));
     $result = $query->exec();
     while ($arUser = $result->fetch()) {
         if (!empty($arID) && !in_array($arUser["ID"], $arID)) {
             continue;
         }
         $arUsers[$arUser["ID"]] = array('id' => $arUser["ID"], 'status' => $enable && in_array($arUser['STATUS'], self::$AVAILABLE_STATUSES) ? $arUser['STATUS'] : 'online', 'idle' => $enable && is_object($arUser['IDLE']) ? $arUser['IDLE']->getTimestamp() : 0);
     }
     return array('users' => $arUsers);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:48,代码来源:im_status.php

示例9: GetList

 public static function GetList($arParams = array())
 {
     global $USER, $CACHE_MANAGER;
     $bLoadUsers = isset($arParams['LOAD_USERS']) && $arParams['LOAD_USERS'] == 'N' ? false : true;
     $bLoadChats = isset($arParams['LOAD_CHATS']) && $arParams['LOAD_CHATS'] == 'N' ? false : true;
     $arGroups = array();
     if (defined("BX_COMP_MANAGED_CACHE")) {
         $ttl = 2592000;
     } else {
         $ttl = 600;
     }
     $bVoximplantEnable = IsModuleInstalled('voximplant');
     $bBusShowAll = !IsModuleInstalled('intranet') && COption::GetOptionInt('im', 'contact_list_show_all_bus');
     $bIntranetEnable = false;
     $arGroupStatus = CUserOptions::GetOption('IM', 'groupStatus');
     if (CModule::IncludeModule('intranet') && CModule::IncludeModule('iblock')) {
         $bIntranetEnable = true;
         if (!(CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser())) {
             if (($iblock_id = COption::GetOptionInt('intranet', 'iblock_structure', 0)) > 0) {
                 $cache_id = 'im_structure_' . $iblock_id;
                 $obIMCache = new CPHPCache();
                 $cache_dir = '/bx/imc/structure';
                 if ($obIMCache->InitCache($ttl, $cache_id, $cache_dir)) {
                     $tmpVal = $obIMCache->GetVars();
                     $arStructureName = $tmpVal['STRUCTURE_NAME'];
                     unset($tmpVal);
                 } else {
                     if (defined("BX_COMP_MANAGED_CACHE")) {
                         $CACHE_MANAGER->StartTagCache($cache_dir);
                     }
                     $arResult["Structure"] = array();
                     $sec = CIBlockSection::GetList(array("left_margin" => "asc", "SORT" => "ASC"), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblock_id), false, array('ID', 'NAME', 'DEPTH_LEVEL', 'IBLOCK_SECTION_ID'));
                     $arStructureName = array();
                     while ($ar = $sec->GetNext(true, false)) {
                         if ($ar['DEPTH_LEVEL'] > 1) {
                             $ar['NAME'] .= ' / ' . $arStructureName[$ar['IBLOCK_SECTION_ID']];
                         }
                         $arStructureName[$ar['ID']] = $ar['NAME'];
                     }
                     if (defined("BX_COMP_MANAGED_CACHE")) {
                         $CACHE_MANAGER->RegisterTag('iblock_id_' . $iblock_id);
                         $CACHE_MANAGER->EndTagCache();
                     }
                     if ($obIMCache->StartDataCache()) {
                         $obIMCache->EndDataCache(array('STRUCTURE_NAME' => $arStructureName));
                     }
                 }
                 unset($obIMCache);
                 foreach ($arStructureName as $key => $value) {
                     if (strlen($value) > 0) {
                         $arGroups[$key] = array('id' => $key, 'status' => isset($arGroupStatus[$key]) && $arGroupStatus[$key] == 'open' ? 'open' : 'close', 'name' => $value);
                     }
                 }
             }
         }
     } else {
         if ($bBusShowAll) {
             $arGroups['all'] = array('id' => 'all', 'status' => isset($arGroupStatus['all']) && $arGroupStatus['all'] == 'close' ? 'close' : 'open', 'name' => GetMessage('IM_CL_GROUP_ALL'));
         }
     }
     $arGroups['chat'] = array('id' => 'chat', 'status' => isset($arGroupStatus['chat']) && $arGroupStatus['chat'] == 'open' ? 'open' : 'close', 'name' => GetMessage('IM_CL_GROUP_CHATS'));
     $arGroups['other'] = array('id' => 'other', 'status' => isset($arGroupStatus['other']) && $arGroupStatus['other'] == 'open' ? 'open' : 'close', 'name' => GetMessage('IM_CL_GROUP_OTHER_2'));
     $arGroups['search'] = array('id' => 'search', 'status' => isset($arGroupStatus['search']) && $arGroupStatus['search'] == 'open' ? 'open' : 'close', 'name' => GetMessage('IM_CL_GROUP_SEARCH'));
     $arWoGroups = array('all' => array('id' => 'all', 'status' => isset($arGroupStatus['all']) && $arGroupStatus['all'] == 'close' ? 'close' : 'open', 'name' => GetMessage('IM_CL_GROUP_ALL')), 'chat' => array('id' => 'chat', 'status' => isset($arGroupStatus['chat']) && $arGroupStatus['chat'] == 'open' ? 'open' : 'close', 'name' => GetMessage('IM_CL_GROUP_CHATS')), 'other' => array('id' => 'other', 'status' => isset($arGroupStatus['other']) && $arGroupStatus['other'] == 'open' ? 'open' : 'close', 'name' => $bIntranetEnable ? GetMessage('IM_CL_GROUP_OTHER') : GetMessage('IM_CL_GROUP_OTHER_2')), 'search' => array('id' => 'search', 'status' => isset($arGroupStatus['search']) && $arGroupStatus['search'] == 'open' ? 'open' : 'close', 'name' => GetMessage('IM_CL_GROUP_SEARCH')));
     $arUserSG = array();
     $arUsers = array();
     $arUserInGroup = array();
     $arWoUserInGroup = array();
     $arExtranetUsers = array();
     if (CModule::IncludeModule('extranet') && CModule::IncludeModule("socialnetwork")) {
         $cache_id = 'im_user_sg_' . $USER->GetID();
         $obSGCache = new CPHPCache();
         $cache_dir = '/bx/imc/sonet';
         if ($obSGCache->InitCache($ttl, $cache_id, $cache_dir)) {
             $tmpVal = $obSGCache->GetVars();
             $arUserSG = $tmpVal['USER_SG'];
             $arExtranetUsers = $tmpVal['EXTRANET_USERS'];
             $arUserInGroup = $tmpVal['USER_IN_GROUP'];
             $arWoUserInGroup = $tmpVal['WO_USER_IN_GROUP'];
             unset($tmpVal);
         } else {
             if (defined("BX_COMP_MANAGED_CACHE")) {
                 $CACHE_MANAGER->StartTagCache($cache_dir);
             }
             $dbUsersInGroup = CSocNetUserToGroup::GetList(array(), array("USER_ID" => $USER->GetID(), "<=ROLE" => SONET_ROLES_USER, "GROUP_SITE_ID" => CExtranet::GetExtranetSiteID(), "GROUP_ACTIVE" => "Y", "GROUP_CLOSED" => "N"), false, false, array("ID", "GROUP_ID", "GROUP_NAME"));
             $arUserSocNetGroups = array();
             while ($ar = $dbUsersInGroup->GetNext(true, false)) {
                 $arUserSocNetGroups[] = $ar["GROUP_ID"];
                 $arUserSG['SG' . $ar['GROUP_ID']] = array('id' => 'SG' . $ar['GROUP_ID'], 'status' => isset($arGroupStatus['SG' . $ar['GROUP_ID']]) && $arGroupStatus['SG' . $ar['GROUP_ID']] == 'open' ? 'open' : 'close', 'name' => GetMessage('IM_CL_GROUP_SG') . $ar['GROUP_NAME']);
                 if (defined("BX_COMP_MANAGED_CACHE")) {
                     $CACHE_MANAGER->RegisterTag('sonet_group_' . $ar['GROUP_ID']);
                     $CACHE_MANAGER->RegisterTag('sonet_user2group_G' . $ar['GROUP_ID']);
                 }
             }
             if (count($arUserSocNetGroups) > 0) {
                 $dbUsersInGroup = CSocNetUserToGroup::GetList(array(), array("GROUP_ID" => $arUserSocNetGroups, "<=ROLE" => SONET_ROLES_USER, "USER_ACTIVE" => "Y", "USER_CONFIRM_CODE" => false), false, false, array("ID", "USER_ID", "GROUP_ID"));
                 while ($ar = $dbUsersInGroup->GetNext(true, false)) {
                     if ($ar["USER_ID"] == $USER->GetID()) {
                         continue;
                     }
//.........这里部分代码省略.........
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:101,代码来源:im_contact_list.php

示例10: array

         }
     }
     if (!$bGet) {
         $arFilter = array("TO_USER_ID" => $GLOBALS["USER"]->GetID(), "DATE_VIEW" => "", "TO_DELETED" => "N", ">DATE_CREATE" => ConvertTimeStamp($last_message_ts, "FULL", $site));
         if ($log == "Y") {
             $arFilter["IS_LOG_ALL"] = "Y";
         }
         $dbUserRequests = CSocNetMessages::GetList(array(), $arFilter, false, array("nTopCount" => 1), array("ID"));
         if ($arUserRequests = $dbUserRequests->Fetch()) {
             $bGet = true;
         }
     }
 }
 if ($bGet) {
     $arFilter = array("SECOND_USER_ID" => $GLOBALS["USER"]->GetID(), "RELATION" => SONET_RELATIONS_REQUEST);
     $dbUserRequests = CSocNetUserRelations::GetList(array("DATE_UPDATE" => "ASC"), $arFilter, false, array("nTopCount" => 50), array("ID", "FIRST_USER_ID", "MESSAGE", "FIRST_USER_NAME", "DATE_CREATE", "DATE_UPDATE", "FIRST_USER_LAST_NAME", "FIRST_USER_SECOND_NAME", "FIRST_USER_LOGIN", "FIRST_USER_PERSONAL_PHOTO", "FIRST_USER_PERSONAL_GENDER", "FIRST_USER_IS_ONLINE"));
     while ($arUserRequests = $dbUserRequests->GetNext()) {
         $arTmpData = array();
         $arTmpData["TYPE"] = "FR";
         $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUserRequests["FIRST_USER_ID"]));
         $canViewProfile = CSocNetUserPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $arUserRequests["FIRST_USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin($site));
         $arTmpData["IMAGE_USER"] = "/bitrix/images/1.gif";
         if (intval($arUserRequests["FIRST_USER_PERSONAL_PHOTO"]) <= 0) {
             switch ($arUserRequests["FIRST_USER_PERSONAL_GENDER"]) {
                 case "M":
                     $suffix = "male";
                     break;
                 case "F":
                     $suffix = "female";
                     break;
                 default:
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:get_message_2.php

示例11: array

         }
         $arEventTmp = array("EVENT_TYPE" => "INVITE_GROUP", "ID" => $arRequest["ID"], "USER_ID" => $arRequest["USER_ID"], "GROUP_ID" => $arRequest["GROUP_ID"], "GROUP_URL" => $gu, "GROUP_NAME" => $arGroup["NAME"], "GROUP_IMG" => $arImage, "DATE_CREATE" => $arRequest["DATE_CREATE"], "MESSAGE" => $parser->convert($arRequest["~MESSAGE"], false, array(), array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LIST" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "SMILES" => "Y", "UPLOAD" => "N", "NL2BR" => "N")));
         $arTmpResult["RequestsIn"][] = $arEventTmp;
     }
 }
 $rsRequestsIn = new CDBResult();
 $rsRequestsIn->InitFromArray($arTmpResult["RequestsIn"]);
 $rsRequestsIn->NavStart();
 while ($arRecord = $rsRequestsIn->GetNext()) {
     $arResult["RequestsIn"]["List"][] = $arRecord;
 }
 $arResult["RequestsIn"]["NAV_STRING"] = $rsRequestsIn->GetPageNavStringEx($navComponentObject, GetMessage("SONET_URE_NAV"), "", false);
 /*********************  Outogoing Requests  ***********************/
 /* Friends Outgoing */
 $arResult["RequestsOut"] = array();
 $dbUserRequests = CSocNetUserRelations::GetList(array("DATE_UPDATE" => "ASC"), array("FIRST_USER_ID" => $arParams["USER_ID"], "RELATION" => SONET_RELATIONS_REQUEST), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID", "MESSAGE", "SECOND_USER_NAME", "DATE_UPDATE", "SECOND_USER_LAST_NAME", "SECOND_USER_SECOND_NAME", "SECOND_USER_LOGIN", "SECOND_USER_PERSONAL_PHOTO", "SECOND_USER_PERSONAL_GENDER", "SECOND_USER_IS_ONLINE"));
 while ($arUserRequest = $dbUserRequests->GetNext()) {
     $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUserRequest["SECOND_USER_ID"]));
     $canViewProfile = CSocNetUserPerms::CanPerformOperation($arParams["USER_ID"], $arUserRequest["SECOND_USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
     if (intval($arParams["THUMBNAIL_LIST_SIZE"]) > 0) {
         if (intval($arUserRequest["SECOND_USER_PERSONAL_PHOTO"]) <= 0) {
             switch ($arUserRequest["SECOND_USER_PERSONAL_GENDER"]) {
                 case "M":
                     $suffix = "male";
                     break;
                 case "F":
                     $suffix = "female";
                     break;
                 default:
                     $suffix = "unknown";
             }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例12: GetList

 public static function GetList($arParams = array())
 {
     if (!is_array($arParams)) {
         $arParams = array();
     }
     $arID = array();
     if (isset($arParams['ID']) && is_array($arParams['ID']) && !empty($arParams['ID'])) {
         foreach ($arParams['ID'] as $key => $value) {
             $arID[] = intval($value);
         }
     } else {
         if (isset($arParams['ID']) && intval($arParams['ID']) > 0) {
             $arID[] = intval($arParams['ID']);
         }
     }
     $arParams['GET_OFFLINE'] = !empty($arID) && isset($arParams['GET_OFFLINE']) && $arParams['GET_OFFLINE'] == 'Y' ? 'Y' : 'N';
     global $USER;
     $userId = is_object($USER) ? intval($USER->GetID()) : 0;
     $bBusShowAll = !IsModuleInstalled('intranet') && COption::GetOptionInt('im', 'contact_list_show_all_bus');
     if (!$bBusShowAll && !isset($arParams['ID']) && $userId > 0 && !isset($arParams['SKIP_CHECK'])) {
         if (isset(self::$FRIENDS_USERS[$userId])) {
             $arID = self::$FRIENDS_USERS[$userId];
         } else {
             if (CModule::IncludeModule('socialnetwork') && CSocNetUser::IsFriendsAllowed()) {
                 $arID = array($userId);
                 $dbFriends = CSocNetUserRelations::GetList(array(), array("USER_ID" => $userId, "RELATION" => SONET_RELATIONS_FRIEND), false, false, array("ID", "FIRST_USER_ID", "SECOND_USER_ID"));
                 if ($dbFriends) {
                     while ($arFriends = $dbFriends->Fetch()) {
                         $arID[] = $userId == $arFriends["FIRST_USER_ID"] ? $arFriends["SECOND_USER_ID"] : $arFriends["FIRST_USER_ID"];
                     }
                 }
                 self::$FRIENDS_USERS[$userId] = $arID;
             }
         }
     }
     $arUsers = array();
     if (self::$ONLINE_USERS && $arParams['GET_OFFLINE'] == 'N') {
         $arUsers = self::$ONLINE_USERS;
     } else {
         if (!self::$ONLINE_USERS || $arParams['GET_OFFLINE'] == 'Y') {
             $enable = self::Enable();
             $arUsers = array();
             $query = new \Bitrix\Main\Entity\Query(\Bitrix\Main\UserTable::getEntity());
             $query->registerRuntimeField('', new \Bitrix\Main\Entity\ReferenceField('ref', 'Bitrix\\Im\\StatusTable', array('=this.ID' => 'ref.USER_ID')));
             $query->addSelect('ID')->addSelect('ref.COLOR', 'COLOR')->addSelect('PERSONAL_GENDER');
             if ($enable) {
                 $query->addSelect('ref.STATUS', 'STATUS')->addSelect('ref.IDLE', 'IDLE')->addSelect('ref.MOBILE_LAST_DATE', 'MOBILE_LAST_DATE');
             }
             if ($arParams['GET_OFFLINE'] == 'N') {
                 $query->addFilter('>LAST_ACTIVITY_DATE', new \Bitrix\Main\DB\SqlExpression(Bitrix\Main\Application::getConnection()->getSqlHelper()->addSecondsToDateTime('-180')));
             } else {
                 $sago = Bitrix\Main\Application::getConnection()->getSqlHelper()->addSecondsToDateTime('-180');
                 $query->registerRuntimeField('', new \Bitrix\Main\Entity\ExpressionField('IS_ONLINE_CUSTOM', 'CASE WHEN LAST_ACTIVITY_DATE > ' . $sago . ' THEN \'Y\' ELSE \'N\' END'));
                 $query->addSelect('IS_ONLINE_CUSTOM');
                 $query->addFilter('=ID', $arID);
             }
             $result = $query->exec();
             while ($arUser = $result->fetch()) {
                 $color = null;
                 if (isset($arUser['COLOR']) && strlen($arUser['COLOR']) > 0) {
                     $color = IM\Color::getColor($arUser['COLOR']);
                 }
                 if (!$color) {
                     $color = \CIMContactList::GetUserColor($arUser["ID"], $arUser['PERSONAL_GENDER'] == 'M' ? 'M' : 'F');
                 }
                 $arUsers[$arUser["ID"]] = array('id' => $arUser["ID"], 'status' => $enable && in_array($arUser['STATUS'], self::$AVAILABLE_STATUSES) ? $arUser['STATUS'] : 'online', 'color' => $color, 'idle' => $enable && is_object($arUser['IDLE']) ? $arUser['IDLE']->getTimestamp() : 0, 'mobileLastDate' => $enable && is_object($arUser['MOBILE_LAST_DATE']) ? $arUser['MOBILE_LAST_DATE']->getTimestamp() : 0);
                 if ($arParams['GET_OFFLINE'] == 'Y' && $arUser['IS_ONLINE_CUSTOM'] == 'N') {
                     $arUsers[$arUser["ID"]]['status'] = 'offline';
                     $arUsers[$arUser["ID"]]['idle'] = 0;
                     $arUsers[$arUser["ID"]]['mobileLastDate'] = 0;
                 }
             }
             if ($arParams['GET_OFFLINE'] == 'N') {
                 self::$ONLINE_USERS = $arUsers;
             }
         }
     }
     $arResult = array();
     if (empty($arID)) {
         $arResult = $arUsers;
     } else {
         foreach ($arID as $userId) {
             if (isset($arUsers[$userId])) {
                 $arResult[$userId] = $arUsers[$userId];
             }
         }
     }
     return array('users' => $arResult);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:89,代码来源:im_status.php

示例13: GetList

	function GetList($arParams = Array())
	{
		global $USER, $CACHE_MANAGER;

		$bLoadUsers = isset($arParams['LOAD_USERS']) && $arParams['LOAD_USERS'] == 'N'? false: true;

		$arGroups = array();
		if(defined("BX_COMP_MANAGED_CACHE"))
			$ttl = 2592000;
		else
			$ttl = 600;

		$bIntranetEnable = false;
		if(IsModuleInstalled('intranet') && CModule::IncludeModule('intranet') && CModule::IncludeModule('iblock'))
		{
			$bIntranetEnable = true;
			if (!(CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser()))
			{
				$arGroupStatus = CUserOptions::GetOption('IM', 'groupStatus');
				if(($iblock_id = COption::GetOptionInt('intranet', 'iblock_structure', 0)) > 0)
				{
					$cache_id = 'im_structure_'.$iblock_id;
					$obIMCache = new CPHPCache;
					$cache_dir = '/bx/imc/structure';

					if($obIMCache->InitCache($ttl, $cache_id, $cache_dir))
					{
						$tmpVal = $obIMCache->GetVars();
						$arStructureName = $tmpVal['STRUCTURE_NAME'];
						unset($tmpVal);
					}
					else
					{
						if(defined("BX_COMP_MANAGED_CACHE"))
							$CACHE_MANAGER->StartTagCache($cache_dir);

						$arResult["Structure"] = array();
						$sec = CIBlockSection::GetList(
							Array("left_margin"=>"asc","SORT"=>"ASC"),
							Array("ACTIVE"=>"Y","IBLOCK_ID"=>$iblock_id),
							false,
							Array('ID', 'NAME', 'DEPTH_LEVEL', 'IBLOCK_SECTION_ID')
						);
						$arStructureName = Array();
						while($ar = $sec->GetNext(true, false))
						{
							if ($ar['DEPTH_LEVEL'] > 1)
								$ar['NAME'] .= ' / '.$arStructureName[$ar['IBLOCK_SECTION_ID']];
							$arStructureName[$ar['ID']] = $ar['NAME'];
						}

						if(defined("BX_COMP_MANAGED_CACHE"))
						{
							$CACHE_MANAGER->RegisterTag('iblock_id_'.$iblock_id);
							$CACHE_MANAGER->EndTagCache();
						}

						if($obIMCache->StartDataCache())
						{
							$obIMCache->EndDataCache(array(
								'STRUCTURE_NAME' => $arStructureName
							));
						}
					}

					unset($obIMCache);

					foreach ($arStructureName as $key => $value)
					{
						$arGroups[$key] = Array('id' => $key, 'status' => (isset($arGroupStatus[$key]) && $arGroupStatus[$key] == 'open'? 'open': 'close'), 'name' => $value);
					}
				}
				$arGroups['other'] = Array('id' => 'other', 'status' => (isset($arGroupStatus['other']) && $arGroupStatus['other'] == 'open'? 'open': 'close'), 'name' => GetMessage('IM_CL_GROUP_OTHER'));
			}
		}
		else
		{
			$arGroups['other'] = Array('id' => 'other', 'status' => (isset($arGroupStatus['other']) && $arGroupStatus['other'] == 'open'? 'open': 'close'), 'name' => GetMessage('IM_CL_GROUP_OTHER_2'));
		}

		$arWoGroups = array(
			'all' => array(
				'id' => 'all',
				'status' => (isset($arGroupStatus['all']) && $arGroupStatus['all'] == 'close'? 'close': 'open'),
				'name' => GetMessage('IM_CL_GROUP_ALL')
			),
			'other' => array(
				'id' => 'other',
				'status' => (isset($arGroupStatus['other']) && $arGroupStatus['other'] == 'open'? 'open': 'close'),
				'name' => $bIntranetEnable? GetMessage('IM_CL_GROUP_OTHER'): GetMessage('IM_CL_GROUP_OTHER_2')
			)
		);

		$arUserSG = array();
		$arUsers = array();
		$arUserInGroup = array();
		$arWoUserInGroup = array();
		$arExtranetUsers = array();

		if (CModule::IncludeModule('extranet') && CModule::IncludeModule("socialnetwork"))
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:101,代码来源:im_contact_list.php

示例14: CSocNetTextParser

     if ($_REQUEST["action"] == "ban") {
         if (!CSocNetUserRelations::BanUser($GLOBALS["USER"]->GetID(), IntVal($_REQUEST["userID"]))) {
             if ($e = $APPLICATION->GetException()) {
                 $errorMessage .= $e->GetString();
             }
         }
     }
     if (strlen($errorMessage) > 0) {
         $arResult["ErrorMessage"] = $errorMessage;
     }
 }
 /*********************  END ACTIONS  *****************************/
 $parser = new CSocNetTextParser(LANGUAGE_ID, $arParams["PATH_TO_SMILE"]);
 $bFound = false;
 if (!$bFound) {
     $dbUserRequests = CSocNetUserRelations::GetList(array("DATE_UPDATE" => "ASC"), array("SECOND_USER_ID" => $GLOBALS["USER"]->GetID(), "RELATION" => SONET_RELATIONS_REQUEST), false, array("nTopCount" => 1), array("ID", "FIRST_USER_ID", "MESSAGE", "FIRST_USER_NAME", "DATE_UPDATE", "FIRST_USER_LAST_NAME", "FIRST_USER_SECOND_NAME", "FIRST_USER_LOGIN", "FIRST_USER_PERSONAL_PHOTO", "FIRST_USER_PERSONAL_GENDER", "FIRST_USER_IS_ONLINE"));
     if ($arUserRequests = $dbUserRequests->GetNext()) {
         $bFound = true;
         $arResult["EventType"] = "FriendRequest";
         $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUserRequests["FIRST_USER_ID"]));
         $canViewProfile = CSocNetUserPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $arUserRequests["FIRST_USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
         if (intval($arUserRequests["FIRST_USER_PERSONAL_PHOTO"]) <= 0) {
             switch ($arUserRequests["FIRST_USER_PERSONAL_GENDER"]) {
                 case "M":
                     $suffix = "male";
                     break;
                 case "F":
                     $suffix = "female";
                     break;
                 default:
                     $suffix = "unknown";
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


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