示例#1
0
	function __SpeedFileCheckMessages($userID)
	{
		$userID = IntVal($userID);
		if ($userID <= 0)
			return;

		$cnt = 0;
		$dbResult = $GLOBALS["DB"]->Query(
			"SELECT COUNT(ID) as CNT ".
			"FROM b_sonet_user_relations ".
			"WHERE SECOND_USER_ID = ".$userID." ".
			"	AND RELATION = '".$GLOBALS["DB"]->ForSql(SONET_RELATIONS_REQUEST, 1)."' "
		);
		if ($arResult = $dbResult->Fetch())
			$cnt = IntVal($arResult["CNT"]);

		if ($cnt > 0)
			CSocNetUserRelations::__SpeedFileCreate($userID);
		else
			CSocNetUserRelations::__SpeedFileDelete($userID);
	}