/// <summary> /// 取得某用户的所有被屏蔽的版块信息 /// </summary> /// <param name="userID"></param> /// <returns></returns> public static BannedUserCollection GetUserBannedForumInfo(int userID) { BannedUserCollection banned = new BannedUserCollection(); if (UserBannedForums.ContainsKey(userID)) { List <int> bannedForumids = UserBannedForums[userID]; foreach (int id in bannedForumids) { long key = GetKey(userID, id); BannedUser b = AllBannedUsers.GetValue(key); if (b != null) { banned.Add(b); } } } return(banned); }
/// <summary> /// 是否在某个版块被屏蔽 /// </summary> /// <param name="userID"></param> /// <returns></returns> public static bool IsForumBanned(int userID) { if (UserBannedForums.ContainsKey(userID)) { List <int> forumIds = UserBannedForums[userID]; foreach (int forumid in forumIds) { if (forumid == 0) { continue; } long key = GetKey(userID, forumid); if (ForumBannedUsers.ContainsKey(forumid) && ForumBannedUsers[forumid].Limited.ContainsKey(key)) { return(true); } } } return(false); }
/// <summary> /// 某用户是否被屏蔽 /// </summary> /// <param name="userID"></param> public static bool Contains(int userID) { return(UserBannedForums.ContainsKey(userID)); }