Ejemplo n.º 1
0
        /// <summary>
        /// 获取版主是否有权限管理的主题列表中的主题
        /// </summary>
        /// <param name="moderatorUserName">版主名称</param>
        /// <param name="tidList">主题列表</param>
        /// <returns></returns>
        public static bool GetModTopicCountByTidList(string moderatorUserName, string tidList)
        {
            string fidList = Moderators.GetFidListByModerator(moderatorUserName);

            if (fidList == "")
            {
                return(false);
            }
            return(tidList.Split(',').Length == Data.Topics.GetModTopicCountByTidList(fidList.TrimEnd(','), tidList));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取指定用户组和版信息下主题的DisplayOrder
 /// </summary>
 /// <param name="usergroupinfo">用户组信息</param>
 /// <param name="useradminid">管理组ID</param>
 /// <param name="forum">当前版块</param>
 /// <param name="topicInfo">当前主题信息</param>
 /// <param name="message">帖子内容</param>
 /// <param name="disablepost">是否受灌水限制 1,不受限制;0,受限制</param>
 /// <returns>0:正常显示;-2:待审核</returns>
 public static int GetTitleDisplayOrder(UserGroupInfo usergroupinfo, int useradminid, ForumInfo forum, TopicInfo topicInfo, string message, int disablepost)
 {
     if (useradminid == 1 || Moderators.IsModer(useradminid, topicInfo.Posterid, forum.Fid))
     {
         return(topicInfo.Displayorder);
     }
     if (forum.Modnewtopics == 1 || usergroupinfo.ModNewTopics == 1 || Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods) && disablepost != 1 || ForumUtils.HasAuditWord(topicInfo.Title) || ForumUtils.HasAuditWord(message))
     {
         return(-2);
     }
     return(topicInfo.Displayorder);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 发主题是否需要审核
 /// </summary>
 /// <param name="forum">主题所在的版块</param>
 /// <param name="useradminid">用户的管理组ID</param>
 /// <param name="userid">用户ID</param>
 /// <param name="userGroup">当前用户的用户组</param>
 /// <returns>true需要审核;false不需要审核</returns>
 public static bool NeedAudit(ForumInfo forum, int useradminid, int userid, UserGroupInfo userGroup)
 {
     if (useradminid == 1 || Moderators.IsModer(useradminid, userid, forum.Fid))
     {
         return(false);
     }
     if (Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods) || forum.Modnewtopics == 1 || userGroup.ModNewTopics == 1)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取主题帖是否可见信息
        /// </summary>
        /// <param name="forum">版块信息</param>
        /// <param name="useradminid">当前用户adminid</param>
        /// <param name="uid">当前用户id</param>
        /// <param name="userGroup">当前用户组信息</param>
        /// <param name="postinfo">帖子信息</param>
        /// <returns>0显示;1隐藏</returns>
        public static int GetTopicPostInvisible(ForumInfo forum, int useradminid, int uid, UserGroupInfo userGroup, PostInfo postinfo)
        {
            if (useradminid == 1 || Moderators.IsModer(useradminid, uid, forum.Fid))
            {
                return(0);
            }

            if (!ForumUtils.HasAuditWord(postinfo.Message) && forum.Modnewtopics == 0 && userGroup.ModNewTopics == 0 && !Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods))
            {
                return(0);
            }

            return(1);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 发回复是否需要审核
        /// </summary>
        /// <param name="forum">主题所在的版块</param>
        /// <param name="useradminid">用户的管理组ID</param>
        ///<param name="topicInfo">所回复的主题信息</param>
        /// <param name="userid">用户ID</param>
        /// <param name="disablepost">是否受灌水限制</param>
        /// <returns>true需要审核;false不需要审核</returns>
        public static bool NeedAudit(ForumInfo forum, int useradminid, TopicInfo topicInfo, int userid, int disablepost, UserGroupInfo userGroup)
        {
            if (useradminid == 1 || Moderators.IsModer(useradminid, userid, forum.Fid))
            {
                return(false);
            }
            if (Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods))
            {
                return(true);
            }
            if (forum.Modnewposts == 1 || userGroup.ModNewPosts == 1)
            {
                return(true);
            }
            else if (topicInfo.Displayorder == -2)
            {
                return(true);
            }
            return(false);

            //bool needaudit = false; //是否需要审核
            //if (Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods))
            //{
            //    needaudit = true;
            //}
            //else
            //{
            //    if (forum.Modnewposts == 1 && useradminid != 1)
            //    {
            //        if (useradminid > 1)
            //        {
            //            if (disablepost == 1 && topicInfo.Displayorder != -2)
            //            {
            //                if (useradminid == 3 && !Moderators.IsModer(useradminid, userid, forum.Fid))
            //                    needaudit = true;
            //            }
            //            else
            //                needaudit = true;
            //        }
            //        else
            //            needaudit = true;
            //    }
            //    else if (userGroup.ModNewPosts == 1 && !Moderators.IsModer(useradminid, userid, forum.Fid) && useradminid != 1)
            //        needaudit = true;
            //    else if (useradminid != 1 && topicInfo.Displayorder == -2)
            //        needaudit = true;
            //}
            //return needaudit;
        }