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


PHP CSocNetUserRelations::__SpeedFileCheckMessages方法代码示例

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


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

示例1: DeleteRelation

 function DeleteRelation($senderUserID, $targetUserID)
 {
     global $APPLICATION;
     $senderUserID = IntVal($senderUserID);
     if ($senderUserID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_SENDER_USER_ID"), "ERROR_SENDER_USER_ID");
         return false;
     }
     $targetUserID = IntVal($targetUserID);
     if ($targetUserID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_TARGET_USER_ID"), "ERROR_TARGET_USER_ID");
         return false;
     }
     $arRelation = CSocNetUserRelations::GetByUserID($senderUserID, $targetUserID);
     if (!$arRelation) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_RELATION_NOT_FOUND"), "ERROR_RELATION_NOT_FOUND");
         return false;
     }
     if (CSocNetUserRelations::Delete($arRelation["ID"])) {
         if (CModule::IncludeModule("im")) {
             $rsUser = CUser::GetByID($senderUserID);
             if ($arUser = $rsUser->Fetch()) {
                 switch ($arUser["PERSONAL_GENDER"]) {
                     case "M":
                         $gender_suffix = "_M";
                         break;
                     case "F":
                         $gender_suffix = "_F";
                         break;
                     default:
                         $gender_suffix = "";
                 }
             }
             $arMessageFields = array("MESSAGE_TYPE" => IM_MESSAGE_SYSTEM, "FROM_USER_ID" => $senderUserID, "TO_USER_ID" => $targetUserID, "NOTIFY_TYPE" => IM_NOTIFY_FROM, "NOTIFY_MODULE" => "socialnetwork", "NOTIFY_EVENT" => "inout_user", "NOTIFY_TAG" => "SOCNET|FRIENDS|" . intval($arRelation["ID"]), "NOTIFY_MESSAGE" => GetMessage("SONET_UR_IM_UNFRIEND" . $gender_suffix));
             CIMNotify::Add($arMessageFields);
         }
         if ($arRelation["RELATION"] == SONET_RELATIONS_FRIEND) {
             $GLOBALS["DB"]->Query("DELETE FROM b_sonet_event_user_view WHERE\n\t\t\t\t\tENTITY_TYPE = '" . SONET_ENTITY_USER . "'\n\t\t\t\t\tAND (\n\t\t\t\t\t\t(USER_ID = " . $arRelation["FIRST_USER_ID"] . " AND ENTITY_ID = " . $arRelation["SECOND_USER_ID"] . ")\n\t\t\t\t\t\tOR (USER_ID = " . $arRelation["SECOND_USER_ID"] . " AND ENTITY_ID = " . $arRelation["FIRST_USER_ID"] . ")\n\t\t\t\t\t\tOR (ENTITY_ID = " . $arRelation["FIRST_USER_ID"] . " AND USER_IM_ID = " . $arRelation["SECOND_USER_ID"] . ")\n\t\t\t\t\t\tOR (ENTITY_ID = " . $arRelation["SECOND_USER_ID"] . " AND USER_IM_ID = " . $arRelation["FIRST_USER_ID"] . ")\n\t\t\t\t\t\tOR (USER_ID = " . $arRelation["FIRST_USER_ID"] . " AND USER_IM_ID = " . $arRelation["SECOND_USER_ID"] . ")\n\t\t\t\t\t\tOR (USER_ID = " . $arRelation["SECOND_USER_ID"] . " AND USER_IM_ID = " . $arRelation["FIRST_USER_ID"] . ")\n\t\t\t\t\t)", true);
         }
     } 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;
     }
     CSocNetUserRelations::__SpeedFileCheckMessages($senderUserID);
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:53,代码来源:user_relations.php

示例2: DeleteRelation


//.........这里部分代码省略.........
			$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_RELATION_NOT_FOUND"), "ERROR_RELATION_NOT_FOUND");
			return false;
		}

		if (CSocNetUserRelations::Delete($arRelation["ID"]))
		{
			$logID = CSocNetLog::Add(
				array(
					"ENTITY_TYPE" => SONET_ENTITY_USER,
					"ENTITY_ID" => $senderUserID,
					"EVENT_ID" => "system_friends",
					"=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(),
					"TITLE_TEMPLATE" => false,
					"TITLE" => "unfriend",
					"MESSAGE" => $targetUserID,
					"URL" => false,
					"MODULE_ID" => false,
					"CALLBACK_FUNC" => false,
					"USER_ID" => $targetUserID,
				),
				false
			);
			if (intval($logID) > 0)
			{
				CSocNetLog::Update($logID, array("TMP_ID" => $logID));

				$perm = CSocNetUserPerms::GetOperationPerms($senderUserID, "viewfriends");
				if (in_array($perm, array(SONET_RELATIONS_TYPE_FRIENDS2, SONET_RELATIONS_TYPE_FRIENDS)))
					CSocNetLogRights::Add($logID, array("SA", "U".$senderUserID, "S".SONET_ENTITY_USER.$senderUserID."_".$perm));
				elseif ($perm == SONET_RELATIONS_TYPE_NONE)
					CSocNetLogRights::Add($logID, array("SA", "U".$senderUserID));
				elseif ($perm == SONET_RELATIONS_TYPE_AUTHORIZED)
					CSocNetLogRights::Add($logID, array("SA", "AU"));
				elseif ($perm == SONET_RELATIONS_TYPE_ALL)
					CSocNetLogRights::Add($logID, array("SA", "G2"));

				$tmpID = $logID;
			}

			$logID2 = CSocNetLog::Add(
				array(
					"ENTITY_TYPE" => SONET_ENTITY_USER,
					"ENTITY_ID" => $targetUserID,
					"EVENT_ID" => "system_friends",
					"=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(),
					"TITLE_TEMPLATE" => false,
					"TITLE" => "unfriend",
					"MESSAGE" => $senderUserID,
					"URL" => false,
					"MODULE_ID" => false,
					"CALLBACK_FUNC" => false,
					"USER_ID" => $senderUserID,
					"TMP_ID" => (intval($tmpID) > 0 ? $tmpID : false),
				),
				false
			);

			if (intval($logID2) > 0)
			{
				$perm = CSocNetUserPerms::GetOperationPerms($targetUserID, "viewfriends");
				if (in_array($perm, array(SONET_RELATIONS_TYPE_FRIENDS2, SONET_RELATIONS_TYPE_FRIENDS)))
					CSocNetLogRights::Add($logID2, array("SA", "U".$targetUserID, "S".SONET_ENTITY_USER.$targetUserID."_".$perm));
				elseif ($perm == SONET_RELATIONS_TYPE_NONE)
					CSocNetLogRights::Add($logID2, array("SA", "U".$targetUserID));
				elseif ($perm == SONET_RELATIONS_TYPE_AUTHORIZED)
					CSocNetLogRights::Add($logID2, array("SA", "AU"));
				elseif ($perm == SONET_RELATIONS_TYPE_ALL)
					CSocNetLogRights::Add($logID2, array("SA", "G2"));
			}

			CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $tmpID);			

			if ($arRelation["RELATION"] == SONET_RELATIONS_FRIEND)
				$GLOBALS["DB"]->Query("DELETE FROM b_sonet_event_user_view WHERE
					ENTITY_TYPE = '".SONET_ENTITY_USER."'
					AND (
						(USER_ID = ".$arRelation["FIRST_USER_ID"]." AND ENTITY_ID = ".$arRelation["SECOND_USER_ID"].")
						OR (USER_ID = ".$arRelation["SECOND_USER_ID"]." AND ENTITY_ID = ".$arRelation["FIRST_USER_ID"].")
						OR (ENTITY_ID = ".$arRelation["FIRST_USER_ID"]." AND USER_IM_ID = ".$arRelation["SECOND_USER_ID"].")
						OR (ENTITY_ID = ".$arRelation["SECOND_USER_ID"]." AND USER_IM_ID = ".$arRelation["FIRST_USER_ID"].")
						OR (USER_ID = ".$arRelation["FIRST_USER_ID"]." AND USER_IM_ID = ".$arRelation["SECOND_USER_ID"].")
						OR (USER_ID = ".$arRelation["SECOND_USER_ID"]." AND USER_IM_ID = ".$arRelation["FIRST_USER_ID"].")
					)", true);
		}
		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;
		}

		CSocNetUserRelations::__SpeedFileCheckMessages($senderUserID);

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

示例3: array

             $arTmpData["URL_BAN"] = "EventType=Message&userID=" . $arUserRequests["FROM_USER_ID"] . "&action=ban";
             $arTmpData["CAN_ANSWER"] = $arUserRequests["MESSAGE_TYPE"] == SONET_MESSAGE_PRIVATE && $canAnsver ? "Y" : "N";
             $arTmpData["CAN_BAN"] = !CSocNetUser::IsUserModuleAdmin($arUserRequests["FROM_USER_ID"], $site) && $arUserRequests["MESSAGE_TYPE"] == SONET_MESSAGE_PRIVATE ? "Y" : "N";
             if ($arTmpData["CAN_ANSWER"] == "Y") {
                 $arTmpData["BUTTONS"] = array(array("NAME" => GetMessage("SONET_C2_ANSWER"), "ID" => "reply", "ONCLICK" => "function () \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\twindow.open('" . $arTmpData["URL_MESSAGE"] . "', '', 'location=yes,status=no,scrollbars=yes,resizable=yes,width=700,height=550,top='+Math.floor((screen.height - 550)/2-14)+',left='+Math.floor((screen.width - 700)/2-5));\n\t\t\t\t\t\t\t\t\t\t_this.Next();\n\t\t\t\t\t\t\t\t\t\t_this.oData.splice(_this.oCurrentMessagePointer-1, 1);\n\t\t\t\t\t\t\t\t\t\tif (_this.oCurrentMessagePointer > 0)\n\t\t\t\t\t\t\t\t\t\t\t_this.oCurrentMessagePointer--;\n\t\t\t\t\t\t\t\t\t\t_this.adjustPaging();\n\t\t\t\t\t\t\t\t\t\t_this.ShowContent(_this.oCurrentMessagePointer);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}"));
             }
             $arData[] = $arTmpData;
         }
         // while
     }
     // if bGet
 }
 if (count($arData) <= 0 || $arData[0] != "*") {
     CSocNetMessages::__SpeedFileCheckMessages($GLOBALS["USER"]->GetID());
     CSocNetUserToGroup::__SpeedFileCheckMessages($GLOBALS["USER"]->GetID());
     CSocNetUserRelations::__SpeedFileCheckMessages($GLOBALS["USER"]->GetID());
 }
 global $tmpSite;
 $tmpSite = $site;
 function date_cmp($a, $b)
 {
     global $tmpSite, $DB;
     $ts_a = $DB->CharToDateFunction($a["DATE"], "FULL", $tmpSite);
     $ts_b = $DB->CharToDateFunction($b["DATE"], "FULL", $tmpSite);
     if ($ts_a == $ts_b) {
         return 0;
     }
     return $ts_a < $ts_b ? -1 : 1;
 }
 usort($arData, "date_cmp");
 usort($arData, "date_cmp");
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:get_message_2.php


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