Пример #1
0
        public static VerifyReg CreateVerifyRegisterInfo(string email, string inviteCode)
        {
            if (!Utils.IsValidEmail(email))
            {
                return(null);
            }

            var vi = new VerifyReg();

            vi.IP         = WebHelper.UserHost;
            vi.Email      = email;
            vi.CreateTime = DateTime.Now;
            vi.ExpireTime = DateTime.Now.AddDays(GeneralConfigInfo.Current.Verifyregisterexpired);
            vi.InviteCode = inviteCode;
            vi.VerifyCode = ForumUtils.CreateAuthStr(16);
            //if (BBX.Data.Users.CreateVerifyRegisterInfo(vi) <= 0)
            //{
            //    return null;
            //}
            return(vi);
        }
Пример #2
0
        private bool GetUserCachePage(string pagename)
        {
            var req    = HttpContext.Current.Request;
            var pcount = req.Form.Count + req.QueryString.Count;

            switch (pagename)
            {
            case "website.aspx":
                this.isguestcachepage = this.GetCachePage(pagename);
                break;

            case "forumindex.aspx":
                this.isguestcachepage = this.GetCachePage(pagename);
                break;

            case "showtopic.aspx":
            {
                int page    = DNTRequest.GetQueryInt("page", 1);
                int topicid = DNTRequest.GetQueryInt("topicid", 0);
                if ((pcount == 2 || pcount == 3) && topicid > 0 && ForumUtils.ResponseShowTopicCacheFile(topicid, page))
                {
                    Topic.UpdateViewCount(topicid, 1);
                    return(true);
                }
                break;
            }

            case "showforum.aspx":
            {
                int page    = DNTRequest.GetQueryInt("page", 1);
                int forumid = DNTRequest.GetQueryInt("forumid", 0);
                if ((pcount == 2 || pcount == 3) && forumid > 0 && ForumUtils.ResponseShowForumCacheFile(forumid, page))
                {
                    return(true);
                }
                break;
            }
            }
            return(false);
        }
Пример #3
0
        protected override void OnUnload(EventArgs e)
        {
            var pname  = this.pagename;
            var req    = HttpContext.Current.Request;
            var pcount = req.Form.Count + req.QueryString.Count;

            if (this.isguestcachepage == 1 && pname != null)
            {
                int page = DNTRequest.GetQueryInt("page", 1);
                switch (pname)
                {
                case "index.aspx":
                    var cacheService = XCache.Current;
                    if (!(cacheService.RetrieveObject("/Forum/GuestCachePage/" + this.pagename) is string) && this.templateBuilder.Length > 1 && this.templateid == this.config.Templateid)
                    {
                        this.templateBuilder.Append("\r\n\r\n<!-- " + Utils.ProductName + " CachedPage (Created: " + Utils.GetDateTime() + ") -->");
                        XCache.Add("/Forum/GuestCachePage/" + this.pagename, this.templateBuilder.ToString());
                    }
                    break;

                case "showtopic.aspx":
                    int topicid = DNTRequest.GetQueryInt("topicid", 0);
                    if ((pcount == 2 || pcount == 3) && topicid > 0 && this.templateid == this.config.Templateid)
                    {
                        ForumUtils.CreateShowTopicCacheFile(topicid, page, this.templateBuilder.ToString());
                    }
                    break;

                case "showforum.aspx":
                    int forumid = DNTRequest.GetQueryInt("forumid", 0);
                    if ((pcount == 2 || pcount == 3) && forumid > 0 && this.templateid == this.config.Templateid)
                    {
                        ForumUtils.CreateShowForumCacheFile(forumid, page, this.templateBuilder.ToString());
                    }
                    break;
                }
            }
            base.OnUnload(e);
        }
Пример #4
0
        public static EntityList<Post> GetPagedLastPost(PostpramsInfo ppi)
        {
            var list = Post.GetPagedLastPost(ppi);
            var random = new Random((int)DateTime.Now.Ticks);
            int inPostAdCount = Advertisement.GetInPostAdCount("", ppi.Fid);
            foreach (var pi in list)
            {
                ppi.Smileyoff = pi.SmileyOff;
                ppi.BBCode = pi.BBCodeOff < 1;
                ppi.Parseurloff = pi.ParseUrlOff;
                ppi.Allowhtml = pi.HtmlOn;
                ppi.Pid = pi.ID;

                var msg = pi.Message;
                ppi.Sdetail = msg;
                if (ppi.Price > 0 && pi.Layer == 0)
                {
                    var ue = Scoresets.GetScoreSet(Scoresets.GetTopicAttachCreditsTrans());
                    msg = string.Format("<div class=\"paystyle\">此帖为交易帖,要付 {0} <span class=\"bold\">{1}</span>{2} 才可查看</div>", ue.Name, ppi.Price, ue.Unit);
                }
                else
                {
                    if (!ppi.Ubbmode)
                        msg = UBB.UBBToHTML(ppi);
                    else
                        msg = Utils.HtmlEncode(msg);
                }
                pi.Adindex = random.Next(0, inPostAdCount);
                if (ppi.Jammer == 1) msg = ForumUtils.AddJammer(msg);
                pi.Html = msg;

                if (!pi["showemail"].ToBoolean())
                {
                    pi["email"] = "";
                }
            }
            return list;
        }
Пример #5
0
        //public static DataTable GetAuditTopicList(string condition)
        //{
        //    return BBX.Data.Topics.GetAuditTopicList(condition);
        //}

        //public static string GetSearchTopicsCondition(Int32 fid, string keyWord, string displayOrder, string digest, string attachment, string poster, bool lowerUpper, string viewsMin, string viewsMax, string repliesMax, string repliesMin, string rate, string lastPost, DateTime postDateTimeStart, DateTime postDateTimeEnd)
        //{
        //    return BBX.Data.Topics.GetSearchTopicsCondition(fid, keyWord, displayOrder, digest, attachment, poster, lowerUpper, viewsMin, viewsMax, repliesMax, repliesMin, rate, lastPost, postDateTimeStart, postDateTimeEnd);
        //}

        //public static DataTable GetTopicNumber(string tagname, Int32 from, Int32 end, Int32 type)
        //{
        //    return BBX.Data.Topics.GetTopicNumber(tagname, from, end, type);
        //}

        //public static void DeleteRecycleTopic(Int32 recycleDay)
        //{
        //    string text = "";
        //    DataTable tidForModeratorManageLogByPostDateTime = BBX.Data.Topics.GetTidForModeratorManageLogByPostDateTime(DateTime.Now.AddDays((double)(-(double)recycleDay)));
        //    if (tidForModeratorManageLogByPostDateTime.Rows.Count > 0)
        //    {
        //        foreach (DataRow dataRow in tidForModeratorManageLogByPostDateTime.Rows)
        //        {
        //            text = text + dataRow["tid"].ToString() + ",";
        //        }
        //        TopicAdmins.DeleteTopics(text.Trim(','), 0, false);
        //    }
        //}

        //public static DataTable GetTopicsByCondition(string condition)
        //{
        //    return BBX.Data.Topics.GetTopicsByCondition(condition);
        //}

        //public static string GetTopicFilterCondition(string filter)
        //{
        //    return DatabaseProvider.GetInstance().GetTopicFilterCondition(filter);
        //}

        //private static void LoadTopicForumName(TopicInfo topicInfo)
        //{
        //	var forumInfo = Forums.GetForumInfo(topicInfo.Fid);
        //	topicInfo.Forumname = ((forumInfo == null) ? "" : forumInfo.Name);
        //}

        //private static void LoadTopicFolder(Int32 autocloseTime, Int32 newMinutes, Int32 hotReplyNumber, TopicInfo topicInfo)
        //{
        //    if (topicInfo.Closed == 0)
        //    {
        //        string text = ForumUtils.GetCookie("oldtopic") + "D";
        //        if (newMinutes > 0 && text.IndexOf("D" + topicInfo.Tid.ToString() + "D") == -1 && DateTime.Now.AddMinutes((double)(-1 * newMinutes)) < TypeConverter.StrToDateTime(topicInfo.Lastpost))
        //        {
        //            topicInfo.Folder = "new";
        //        }
        //        else
        //        {
        //            topicInfo.Folder = "old";
        //        }
        //        if (hotReplyNumber > 0 && topicInfo.Replies >= hotReplyNumber)
        //        {
        //            topicInfo.Folder += "hot";
        //        }
        //        if (autocloseTime > 0 && Utils.StrDateDiffHours(topicInfo.Postdatetime, autocloseTime * 24) > 0)
        //        {
        //            topicInfo.Closed = 1;
        //            topicInfo.Folder = "closed";
        //            return;
        //        }
        //    }
        //    else
        //    {
        //        topicInfo.Folder = "closed";
        //        if (topicInfo.Closed > 1)
        //        {
        //            Int32 tid = topicInfo.Tid;
        //            topicInfo.Tid = topicInfo.Closed;
        //            topicInfo.Closed = tid;
        //            topicInfo.Folder = "move";
        //        }
        //    }
        //}

        private static void LoadTopicFolder(Int32 autocloseTime, Int32 newMinutes, Int32 hotReplyNumber, Topic tp)
        {
            if (tp.Closed == 0)
            {
                string text = ForumUtils.GetCookie("oldtopic") + "D";
                if (newMinutes > 0 && text.IndexOf("D" + tp.ID + "D") == -1 && DateTime.Now < tp.LastPost.AddMinutes(newMinutes))
                {
                    tp.Folder = "new";
                }
                else
                {
                    tp.Folder = "old";
                }
                if (hotReplyNumber > 0 && tp.Replies >= hotReplyNumber)
                {
                    tp.Folder += "hot";
                }
                if (autocloseTime > 0 && tp.PostDateTime.AddHours(autocloseTime * 24) < DateTime.Now)
                {
                    tp.Closed = 1;
                    tp.Folder = "closed";
                    return;
                }
            }
            else
            {
                tp.Folder = "closed";
                if (tp.Closed > 1)
                {
                    Int32 tid = tp.ID;
                    // 下面这一行没有搞明白,主键被修改是非常危险的事情
                    //tp.Tid = tp.Closed;
                    tp.Closed = tid;
                    tp.Folder = "move";
                }
            }
        }
Пример #6
0
        protected override void OnLoad(EventArgs e)
        {
            LoadTemplate();
            base.OnLoad(e);

            if (this.pagename != "forumlist.aspx" && this.pagename != "forumindex.aspx")
            {
                this.oluserinfo = Online.UpdateInfo();
            }
            else
            {
                try
                {
                    this.oluserinfo = Online.UpdateInfo();
                }
                catch
                {
                    Thread.Sleep(2000);
                    this.oluserinfo = Online.UpdateInfo();
                }
            }
            if (this.config.PostTimeStorageMedia == 1 && Utils.GetCookie("lastposttime") != "")
            {
                var lptime = DateTime.MinValue;
                if (DateTime.TryParse(Utils.GetCookie("lastposttime"), out lptime))
                {
                    this.oluserinfo.LastPostTime = lptime;
                }
            }
            if (userid > 0)
            {
                if (oluserinfo == null)
                {
                    XTrace.WriteLine("发现Cookie记录ID={0}已登录,但是未检测到登录对象", userid);
                }
                else if (userid != oluserinfo.UserID)
                {
                    XTrace.WriteLine("发现Cookie记录ID={0}已登录,实际登录对象ID={1}", userid, oluserinfo.UserID);
                }
            }
            this.userid      = this.oluserinfo.UserID;
            this.usergroupid = (int)this.oluserinfo.GroupID;
            this.username    = this.oluserinfo.UserName;
            this.password    = this.oluserinfo.Password;
            //2014-1-20 增加判断password是否为null,初次使用时使用QQ登陆,密码会为空
            this.userkey        = password != null ? (this.password.Length > 16) ? this.password.Substring(4, 8).Trim() : "" : "";
            this.lastposttime   = this.oluserinfo.LastPostTime;
            this.lastpostpmtime = this.oluserinfo.LastPostpmTime;
            this.lastsearchtime = this.oluserinfo.LastSearchTime;
            this.olid           = this.oluserinfo.ID;
            //this.isopenconnect = DiscuzCloud.GetCloudServiceEnableStatus("connect");
            if (this.userid > 0)
            {
                this.useravatar = Avatars.GetAvatarUrl(this.userid, AvatarSize.Small);
            }

            this.pmsound = ForumUtils.GetCookie("pmsound").ToInt(0);
            if (this.usergroupid == 4 || this.usergroupid == 5)
            {
                var user = BBX.Entity.User.FindByID(this.userid);
                //var user2 = user as IUser;
                if (user.GroupExpiry != 0 && user.GroupExpiry <= DateTime.Now.ToString("yyyyMMdd").ToInt(0))
                {
                    var creditsUserGroupId = CreditsFacade.GetCreditsUserGroupId((float)user.Credits);
                    this.usergroupid = ((creditsUserGroupId.ID != 0) ? creditsUserGroupId.ID : this.usergroupid);
                    //Users.UpdateUserGroup(this.userid, this.usergroupid);
                    user.GroupID = usergroupid;
                    user.Save();
                }
            }
            this.usergroupinfo = UserGroup.FindByID(this.usergroupid);
            this.useradminid   = this.usergroupinfo.RadminID;
            string userCreditsCookie = ForumUtils.GetUserCreditsCookie(this.userid, this.usergroupinfo.GroupTitle);

            if (userCreditsCookie != "")
            {
                string[] array = userCreditsCookie.Split(',');
                this.userinfotips = "<p><a class=\"drop\" onmouseover=\"showMenu(this.id);\" href=\"" + BaseConfigs.GetForumPath + "usercpcreditspay.aspx\" id=\"extcreditmenu\">" + array[0] + "</a> ";
                string text = this.userinfotips;
                this.userinfotips  = text + "<span class=\"pipe\">|</span>用户组: <a class=\"xi2\" id=\"g_upmine\" href=\"" + BaseConfigs.GetForumPath + "usercp.aspx\">" + array[1].Split(':')[1] + "</a></p>";
                this.userinfotips += "<ul id=\"extcreditmenu_menu\" class=\"p_pop\" style=\"display:none;\">";
                for (int i = 2; i < array.Length; i++)
                {
                    this.userinfotips += string.Format("<li><a> {0}</a></li>", array[i]);
                }
                this.userinfotips += "</ul>";
            }
            this.mainnavigation       = Nav.GetNavigationString(this.userid, this.useradminid);
            this.subnavigation        = Nav.GetSubNavigation();
            this.mainnavigationhassub = Nav.Root.Childs.GetItem <Int32>(Nav._.ID).ToArray();
            if (this.config.Closed == 1 && this.pagename != "login.aspx" && this.pagename != "logout.aspx" && this.pagename != "register.aspx" && this.useradminid != 1)
            {
                this.ShowMessage(1);
                return;
            }
            if (!Utils.InArray(this.pagename, "attachment.aspx"))
            {
                //this.onlineusercount = Online.Meta.Count;
                var st = Online.GetStat();
                this.onlineusercount = st.Total;
            }
            if (!this.ValidateUserPermission())
            {
                return;
            }

            if (this.userid != -1 && !Utils.InArray(this.pagename, "attachment.aspx"))
            {
                Online.UpdateOnlineTime(this.config.Oltimespan, this.userid);
            }
            var tmp = Template.FindByID(this.templateid);

            this.templatepath = tmp.Directory;
            if (!String.IsNullOrEmpty(tmp.Url) && tmp.Url.StartsWithIgnoreCase("http://"))
            {
                imagedir = tmp.Url.TrimEnd('/') + "/images";
                cssdir   = tmp.Url.TrimEnd('/');
            }
            else
            {
                imagedir = forumpath + "templates/" + tmp.Directory + "/images";
                cssdir   = forumpath + "templates/" + tmp.Directory;
            }
            if (!config.ImageServer.IsNullOrEmpty())
            {
                imagedir = config.ImageServer.TrimEnd("/") + imagedir;
            }
            if (!config.CssServer.IsNullOrEmpty())
            {
                cssdir = config.CssServer.TrimEnd("/") + cssdir;
            }

            this.topicidentifydir = this.forumpath + "images/identify";
            this.posticondir      = this.forumpath + "images/posticons";
            this.jsdir            = "javascript";
            if (!config.JsServer.IsNullOrEmpty())
            {
                jsdir = config.JsServer.EnsureEnd("/") + jsdir;
            }
            else
            {
                jsdir = this.rooturl + jsdir;
            }

            //this.nowdatetime = Utils.GetDateTime();
            //this.ispost = DNTRequest.IsPost();
            //this.isget = DNTRequest.IsGet();
            //this.link = "";
            //this.script = "";
            this.templatelistboxoptions = Caches.GetTemplateListBoxOptionsCache();
            string oldValue = string.Format("<li><a href=\"###\" onclick=\"window.location.href='{0}showtemplate.aspx?templateid={1}'\">", "", BaseConfigs.GetForumPath, this.templateid);
            string newValue = string.Format("<li class=\"current\"><a href=\"###\" onclick=\"window.location.href='{0}showtemplate.aspx?templateid={1}'\">", BaseConfigs.GetForumPath, this.templateid);

            this.templatelistboxoptions = this.templatelistboxoptions.Replace(oldValue, newValue);
            this.isLoginCode            = this.config.Seccodestatus.Contains("login.aspx");
            this.isseccode = (Utils.InArray(this.pagename, this.config.Seccodestatus) && this.usergroupinfo.IgnoresecCode == 0);
            this.headerad  = Advertisement.GetOneHeaderAd("", 0);
            this.footerad  = Advertisement.GetOneFooterAd("", 0);
            if (this.config.Allowchangewidth == 0)
            {
                Utils.WriteCookie("allowchangewidth", "");
            }

            if (this.pagename != "website.aspx" && (Utils.GetCookie("allowchangewidth") == "0" || (string.IsNullOrEmpty(Utils.GetCookie("allowchangewidth")) && this.config.Showwidthmode == 1)))
            {
                this.isnarrowpage = true;
            }
            if (this.isseccode && this.ispost && !this.ValidateVerifyCode())
            {
                return;
            }

            this.newtopicminute = this.config.Viewnewtopicminute;

            CanShow = true;

            this.ShowPage();
        }
Пример #7
0
 public static string GetPostMessage(UserGroup usergroupinfo, AdminGroup adminGroupInfo, string postmessage, bool ishtmlon)
 {
     string result;
     if (adminGroupInfo != null && adminGroupInfo.ID == 1)
     {
         if (!usergroupinfo.AllowHtml)
         {
             result = Utils.HtmlEncode(postmessage);
         }
         else
         {
             result = (ishtmlon ? postmessage : Utils.HtmlEncode(postmessage));
         }
     }
     else
     {
         if (!usergroupinfo.AllowHtml)
         {
             result = Utils.HtmlEncode(ForumUtils.BanWordFilter(postmessage));
         }
         else
         {
             result = (ishtmlon ? ForumUtils.BanWordFilter(postmessage) : Utils.HtmlEncode(ForumUtils.BanWordFilter(postmessage)));
         }
     }
     return result;
 }
Пример #8
0
 public static bool IsAD(string regular, string title, string message)
 {
     return !(String.IsNullOrEmpty(regular.Trim())) && (Regex.IsMatch(title, regular) || Regex.IsMatch(ForumUtils.RemoveSpecialChars(message, GeneralConfigInfo.Current.Antispamreplacement), regular));
 }
Пример #9
0
        private static void LoadPostMessage(PostpramsInfo postpramsInfo, List<Attachment> attachList, bool isModer, int allowGetAttach, int originalHideStatus, Post pi)
        {
            bool flag = !Utils.InArray(pi.PostUser.GroupID + "", "4,5,6") && pi.Invisible == 0;
            var msg = pi.Message;
            if (pi.Invisible == 1)
            {
                msg = "<div class='hintinfo'>该帖子尚未通过审核, 您是发帖者, 以下是帖子内容</div>" + msg;
            }
            else if (!flag)
            {
                if (isModer)
                {
                    msg = "<div class='hintinfo'>该用户帖子内容已被屏蔽, 您拥有管理权限, 以下是帖子内容</div>" + msg;
                }
                else
                {
                    msg = "<div class='hintinfo'>该用户帖子内容已被屏蔽</div>";
                    var list = new List<Attachment>();
                    foreach (var att in attachList)
                    {
                        if (att.Pid == pi.ID)
                        {
                            list.Add(att);
                        }
                    }
                    foreach (var current2 in list)
                    {
                        attachList.Remove(current2);
                    }
                }
            }
            if (flag || isModer)
            {
                postpramsInfo.Smileyoff = pi.SmileyOff;
                postpramsInfo.BBCode = pi.BBCodeOff == 0;
                postpramsInfo.Parseurloff = pi.ParseUrlOff;
                postpramsInfo.Allowhtml = pi.HtmlOn;
                postpramsInfo.Sdetail = msg;
                postpramsInfo.Pid = pi.ID;
                var user = pi.PostUser;
                if (user != null && user.Group != null && !user.Group.AllowHideCode)
                    postpramsInfo.Hide = 0;

                if (!postpramsInfo.Ubbmode)
                    msg = UBB.UBBToHTML(postpramsInfo);
                else
                    msg = Utils.HtmlEncode(msg);

                if (postpramsInfo.Jammer == 1) msg = ForumUtils.AddJammer(msg);

                string text = msg;
                if (pi.Attachment > 0 || Posts.regexAttach.IsMatch(text) || Posts.regexAttachImg.IsMatch(text))
                {
                    string[] hiddenAttachIdList = Posts.GetHiddenAttachIdList(postpramsInfo.Sdetail, postpramsInfo.Hide);
                    var list2 = new List<Attachment>();
                    foreach (var item in attachList)
                    {
                        text = Attachments.GetMessageWithAttachInfo(postpramsInfo, allowGetAttach, hiddenAttachIdList, pi.ID, pi.PosterID, item, text);
                        if (item.Inserted || Utils.InArray(item.ID.ToString(), hiddenAttachIdList))
                        {
                            list2.Add(item);
                        }
                    }
                    foreach (var item in list2)
                    {
                        attachList.Remove(item);
                    }
                }
                msg = text;
                postpramsInfo.Hide = originalHideStatus;
            }
            pi.Html = msg;
        }
Пример #10
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);
        }