Пример #1
0
        //public static bool NeedAudit(Int32 fid, Int32 modnewposts, int useradminid, int userid, UserGroup userGroup, Topic topicInfo = null)
        //{
        //    //return useradminid != 1 && !Moderators.IsModer(useradminid, userid, fid) && (Scoresets.BetweenTime(GeneralConfigInfo.Current.Postmodperiods) || modnewposts == 1 || userGroup != null && userGroup.ModNewPosts == 1 || topicInfo != null && topicInfo.Displayorder == -2);

        //    if (useradminid == 1) return false;
        //    if (Moderators.IsModer(useradminid, userid, fid)) return false;

        //    if (Scoresets.BetweenTime(GeneralConfigInfo.Current.Postmodperiods)) return true;
        //    if (modnewposts == 1) return true;
        //    if (userGroup != null && userGroup.ModNewPosts == 1) return true;
        //    if (topicInfo != null && topicInfo.DisplayOrder == -2) return true;

        //    return false;
        //}

        public static bool NeedAudit(Int32 fid, Int32 modnewposts, int useradminid, int userid, UserGroup userGroup, Topic topicInfo = null)
        {
            //return useradminid != 1 && !Moderators.IsModer(useradminid, userid, fid) && (Scoresets.BetweenTime(GeneralConfigInfo.Current.Postmodperiods) || modnewposts == 1 || userGroup != null && userGroup.ModNewPosts == 1 || topicInfo != null && topicInfo.Displayorder == -2);

            if (useradminid == 1)
            {
                return(false);
            }
            if (Moderators.IsModer(useradminid, userid, fid))
            {
                return(false);
            }

            if (Scoresets.BetweenTime(GeneralConfigInfo.Current.Postmodperiods))
            {
                return(true);
            }
            if (modnewposts == 1)
            {
                return(true);
            }
            if (userGroup != null && userGroup.ModNewPosts == 1)
            {
                return(true);
            }
            if (topicInfo != null && topicInfo.DisplayOrder == -2)
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
 public static int GetTopicPostInvisible(IXForum forum, int useradminid, int uid, UserGroup userGroup, Post 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(GeneralConfigInfo.Current.Postmodperiods))
     {
         return(0);
     }
     return(1);
 }
Пример #3
0
        //public static string GetTopicCountCondition(out string type, string gettype, Int32 getnewtopic)
        //{
        //    return BBX.Data.Topics.GetTopicCountCondition(out type, gettype, getnewtopic);
        //}

        //public static Int32 GetTopicListCount(string postName, Int32 forumId, string posterList, string keyList, string startDate, string endDate)
        //{
        //    return BBX.Data.Topics.GetTopicListCount(postName, forumId, posterList, keyList, startDate, endDate);
        //}

        //public static Int32 GetHotTopicsCount(Int32 fid, Int32 timeBetween)
        //{
        //    return BBX.Data.Topics.GetHotTopicsCount(fid, timeBetween);
        //}

        //public static DataTable GetTopicList(string postName, Int32 forumId, string posterList, string keyList, string startDate, string endDate, Int32 pageSize, Int32 currentPage)
        //{
        //    return BBX.Data.Topics.GetTopicList(postName, forumId, posterList, keyList, startDate, endDate, pageSize, currentPage);
        //}

        //public static DataTable GetHotTopicsList(Int32 pageSize, Int32 pageIndex, Int32 fid, string showType, Int32 timeBetween)
        //{
        //    return BBX.Data.Topics.GetHotTopicsList(pageSize, pageIndex, fid, showType, timeBetween);
        //}

        //public static void PassAuditNewTopic(string tidList)
        //{
        //    string[] array = tidList.Split(',');
        //    for (Int32 i = 0; i < array.Length; i++)
        //    {
        //        string s = array[i];
        //        TopicInfo topicInfo = Topics.GetTopicInfo(Int32.Parse(s));
        //        CreditsFacade.PostTopic(topicInfo.Posterid, Forums.GetForumInfo(topicInfo.Fid));
        //    }
        //    BBX.Data.Topics.PassAuditNewTopic(TableList.GetPostTableId(), tidList);
        //}

        //public static void UpdateMyTopic()
        //{
        //    BBX.Data.Topics.UpdateMyTopic();
        //}

        //public static Int32 GetTitleDisplayOrder(UserGroup usergroupinfo, Int32 useradminid, IXForum forum, TopicInfo tp, string message, Boolean disablepost)
        //{
        //    if (useradminid == 1 || Moderators.IsModer(useradminid, tp.Posterid, forum.Fid))
        //    {
        //        return tp.Displayorder;
        //    }
        //    if (forum.Modnewtopics == 1 || usergroupinfo.ModNewTopics == 1 || (Scoresets.BetweenTime(GeneralConfigInfo.Current.Postmodperiods) && !disablepost) || ForumUtils.HasAuditWord(tp.Title) || ForumUtils.HasAuditWord(message))
        //    {
        //        return -2;
        //    }
        //    return tp.Displayorder;
        //}

        public static Int32 GetTitleDisplayOrder(UserGroup usergroupinfo, Int32 useradminid, IXForum forum, Topic tp, string message, Boolean disablepost)
        {
            if (useradminid == 1 || Moderators.IsModer(useradminid, tp.PosterID, forum.Fid))
            {
                return(tp.DisplayOrder);
            }
            if (forum.Modnewtopics == 1 || usergroupinfo.ModNewTopics == 1 || (Scoresets.BetweenTime(GeneralConfigInfo.Current.Postmodperiods) && !disablepost) || ForumUtils.HasAuditWord(tp.Title) || ForumUtils.HasAuditWord(message))
            {
                return(-2);
            }
            return(tp.DisplayOrder);
        }
Пример #4
0
        public static bool GetModTopicCountByTidList(string moderatorUserName, string tidList)
        {
            var fids = Moderators.GetFidListByModerator(moderatorUserName).SplitAsInt();

            if (fids.Length <= 0 || fids[0] == 0)
            {
                return(false);
            }

            //return !(String.IsNullOrEmpty(fids)) && tidList.Split(',').Length == BBX.Data.Topics.GetModTopicCountByTidList(fids.TrimEnd(','), tidList);
            var list  = Topic.FindAllByIDs(tidList);
            var count = list.ToList().Count(e => fids.Contains(e.Fid));

            return(list.Count == count);
        }
Пример #5
0
 public static bool GetModPostCountByPidList(string moderatorUserName, string pidList)
 {
     string mods = Moderators.GetFidListByModerator(moderatorUserName);
     return !(String.IsNullOrEmpty(mods)) && pidList.Split(',').Length == Post.GetModPostCountByPidList(mods, pidList);
 }