Beispiel #1
0
 protected override void ShowPage()
 {
     this.pagetitle = "用户控制面板";
     if (!base.IsLogin())
     {
         return;
     }
     this.score1 = ((decimal)this.user.ExtCredits1).ToString();
     this.score2 = ((decimal)this.user.ExtCredits2).ToString();
     this.score3 = ((decimal)this.user.ExtCredits3).ToString();
     this.score4 = ((decimal)this.user.ExtCredits4).ToString();
     this.score5 = ((decimal)this.user.ExtCredits5).ToString();
     this.score6 = ((decimal)this.user.ExtCredits6).ToString();
     this.score7 = ((decimal)this.user.ExtCredits7).ToString();
     this.score8 = ((decimal)this.user.ExtCredits8).ToString();
     if (!base.IsErr() && this.useradminid > 0)
     {
         this.admingroupinfo = AdminGroup.FindByID(this.usergroupid);
     }
     //var stringBuilder = new StringBuilder();
     //if (!this.usergroupinfo.AttachExtensions.IsNullOrEmpty())
     //{
     //	stringBuilder.AppendFormat("[id] in ({0})", this.usergroupinfo.AttachExtensions);
     //}
     //this.usergroupattachtype = Attachments.GetAttachmentTypeString(stringBuilder.ToString());
     this.usergroupattachtype = AttachType.GetAttachmentTypeString(usergroupinfo, null);
     this.newnoticecount      = Notice.GetNewNoticeCountByUid(this.userid);
 }
Beispiel #2
0
        protected override void ShowPage()
        {
            if (userid > 0)
            {
                userinfo = BBX.Entity.User.FindByID(this.userid);
            }

            var adminGroupInfo = AdminGroup.FindByID(this.usergroupid);

            if (adminGroupInfo != null)
            {
                disablepost = adminGroupInfo.DisablePostctrl;
            }

            if (!UserAuthority.CheckPostTimeSpan(this.usergroupinfo, adminGroupInfo, this.oluserinfo, this.userinfo, ref this.msg))
            {
                if (this.continuereply != "")
                {
                    base.AddErrLine("<b>回帖成功</b><br />由于" + this.msg + "后刷新继续");
                    return;
                }
                base.AddErrLine(this.msg);
                return;
            }
            else
            {
                var postInfo = this.GetPostAndTopic(adminGroupInfo);
                if (base.IsErr())
                {
                    return;
                }

                this.forum     = Forums.GetForumInfo(this.forumid);
                this.smileyoff = this.forum.AllowSmilies ? 0 : 1;
                this.bbcodeoff = ((this.forum.AllowBbCode && this.usergroupinfo.AllowCusbbCode) ? 0 : 1);
                //this.allowimg = this.forum.AllowImgCode ? 1 : 0;
                this.needaudit = UserAuthority.NeedAudit(forum.Fid, forum.Modnewposts, this.useradminid, this.userid, this.usergroupinfo, this.topic);
                if (this.needaudit && this.topic.DisplayOrder == -2)
                {
                    base.AddErrLine("主题尚未通过审核, 不能执行回复操作");
                    return;
                }
                //string allowAttachmentType = Attachments.GetAllowAttachmentType(this.usergroupinfo, this.forum);
                this.attachextensions       = AttachType.GetAttachmentTypeArray(usergroupinfo, this.forum);
                this.attachextensionsnosize = AttachType.GetAttachmentTypeString(usergroupinfo, this.forum);
                int num = (this.userid > 0) ? Attachment.GetUploadFileSizeByuserid(this.userid) : 0;
                this.attachsize    = this.usergroupinfo.MaxSizeperday - num;
                this.canpostattach = UserAuthority.PostAttachAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg);
                if (!this.forum.Password.IsNullOrEmpty() && Utils.MD5(this.forum.Password) != ForumUtils.GetCookie("forum" + this.forumid + "password"))
                {
                    base.AddErrLine("本版块被管理员设置了密码");
                    base.SetBackLink(base.ShowForumAspxRewrite(this.forumid, 0));
                    return;
                }
                if (!UserAuthority.VisitAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg))
                {
                    base.AddErrLine(this.msg);
                    this.needlogin = true;
                    return;
                }
                if (!UserAuthority.PostReply(forum, this.userid, this.usergroupinfo, this.topic))
                {
                    base.AddErrLine((this.topic.Closed == 1) ? "主题已关闭无法回复" : "您没有发表回复的权限");
                    this.needlogin = (this.topic.Closed != 1);
                    return;
                }
                if (!UserAuthority.CheckPostTimeSpan(this.usergroupinfo, adminGroupInfo, this.oluserinfo, this.userinfo, ref this.msg))
                {
                    base.AddErrLine(this.msg);
                    return;
                }
                if (adminGroupInfo != null)
                {
                    this.disablepost = adminGroupInfo.DisablePostctrl;
                }
                if (this.forum.TemplateID > 0)
                {
                    this.templatepath = Template.FindByID(this.forum.TemplateID).Directory;
                }

                base.AddLinkCss(BaseConfigs.GetForumPath + "templates/" + this.templatepath + "/editor.css", "css");
                this.customeditbuttons = Caches.GetCustomEditButtonList();
                if (this.ispost)
                {
                    string text = (DNTRequest.GetInt("topicid", -1) > 0) ? string.Format("postreply.aspx?topicid={0}&restore=1&forumpage=" + this.forumpageid, this.topicid) : string.Format("postreply.aspx?postid={0}&restore=1&forumpage=" + this.forumpageid, this.postid);
                    if (!String.IsNullOrEmpty(DNTRequest.GetString("quote")))
                    {
                        text = string.Format("{0}&quote={1}", text, DNTRequest.GetString("quote"));
                    }
                    base.SetBackLink(text);
                    this.NormalValidate(adminGroupInfo, this.postmessage, this.userinfo);
                    if (base.IsErr())
                    {
                        return;
                    }

                    this.canpostattach = UserAuthority.PostAttachAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg);
                    if (!string.IsNullOrEmpty(DNTRequest.GetFormString("toreplay_user").Trim()))
                    {
                        this.postmessage = DNTRequest.GetFormString("toreplay_user").Trim() + "\n\n" + this.postmessage;
                    }
                    postInfo = this.CreatePostInfo(this.postmessage);
                    int replyuserid = (this.postid > 0) ? Post.FindByID(this.postid).PosterID : postInfo.PosterID;
                    this.postid = postInfo.ID;
                    if (base.IsErr())
                    {
                        return;
                    }

                    if (postInfo.ID > 0 && DNTRequest.GetString("postreplynotice") == "on")
                    {
                        Notice.SendPostReplyNotice(postInfo, this.topic, replyuserid);
                    }
                    Sync.Reply(this.postid.ToString(), this.topic.ID.ToString(), this.topic.Title, postInfo.Poster, postInfo.PosterID.ToString(), this.topic.Fid.ToString(), "");
                    StringBuilder stringBuilder = new StringBuilder();
                    //AttachmentInfo[] array = null;
                    string formString = DNTRequest.GetFormString("attachid");
                    if (!string.IsNullOrEmpty(formString))
                    {
                        var array = Attachments.GetNoUsedAttachmentArray(this.userid, formString);
                        Attachments.UpdateAttachment(array, this.topic.ID, postInfo.ID, postInfo, ref stringBuilder, this.userid, this.config, this.usergroupinfo);
                    }
                    Online.UpdateAction(this.olid, UserAction.PostReply, this.forumid, this.forum.Name, this.topicid, this.topictitle);
                    if (this.topic.Special == 4)
                    {
                        base.SetUrl(Urls.ShowDebateAspxRewrite(this.topicid));
                    }
                    else
                    {
                        if (this.infloat == 0)
                        {
                            base.SetUrl(string.Format("showtopic.aspx?forumpage={0}&topicid={1}&page=end&jump=pid#{2}", this.forumpageid, this.topicid, this.postid));
                        }
                    }
                    if (DNTRequest.GetFormString("continuereply") == "on")
                    {
                        base.SetUrl("postreply.aspx?topicid=" + this.topicid + "&forumpage=" + this.forumpageid + "&continuereply=yes");
                    }
                    if (stringBuilder.Length > 0)
                    {
                        this.UpdateUserCredits();
                        base.SetMetaRefresh(5);
                        base.SetShowBackLink(true);
                        if (this.infloat == 1)
                        {
                            base.AddErrLine(stringBuilder.ToString());
                            return;
                        }
                        base.AddMsgLine("<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td colspan=2 align=\"left\"><span class=\"bold\"><nobr>发表回复成功,但图片/附件上传出现问题:</nobr></span><br /></td></tr></table>");
                    }
                    else
                    {
                        base.SetMetaRefresh();
                        base.SetShowBackLink(false);
                        if (postInfo.Invisible == 1)
                        {
                            base.AddMsgLine(string.Format("发表回复成功, 但需要经过审核才可以显示. {0}<br /><br />(<a href=\"" + base.ShowForumAspxRewrite(this.forumid, 0) + "\">点击这里返回 {1}</a>)", (DNTRequest.GetFormString("continuereply") == "on") ? "继续回复" : "返回该主题", this.forum.Name));
                        }
                        else
                        {
                            this.UpdateUserCredits();
                            base.MsgForward("postreply_succeed");
                            base.AddMsgLine(string.Format("发表回复成功, {0}<br />(<a href=\"" + base.ShowForumAspxRewrite(this.forumid, 0) + "\">点击这里返回 {1}</a>)<br />", (DNTRequest.GetFormString("continuereply") == "on") ? "继续回复" : "返回该主题", this.forum.Name));
                        }
                    }
                    if (this.topic.Replies < this.config.Ppp + 10)
                    {
                        ForumUtils.DeleteTopicCacheFile(this.topicid);
                    }
                    if (DNTRequest.GetString("emailnotify") == "on" && this.topic.PosterID != -1 && this.topic.PosterID != this.userid)
                    {
                        this.SendNotifyEmail(BBX.Entity.User.FindByID(this.topic.PosterID).Email.Trim(), postInfo, Utils.GetRootUrl(BaseConfigs.GetForumPath) + string.Format("showtopic.aspx?topicid={0}&page=end&jump=pid#{1}", this.topicid, this.postid));
                    }
                }
                return;
            }
        }
Beispiel #3
0
        protected override void ShowPage()
        {
            if (this.oluserinfo.GroupID == 4)
            {
                base.AddErrLine("你所在的用户组,为禁止发言");
                return;
            }
            if (this.userid > 0)
            {
                this.userinfo = BBX.Entity.User.FindByID(this.userid);
            }
            if (HttpContext.Current.Request.RawUrl.Contains("javascript:"))
            {
                base.AddErrLine("非法的链接");
                return;
            }
            this.forum = XForum.FindByID(forumid);
            if (this.forum == null || this.forum.Layer == 0)
            {
                this.forum          = new XForum();
                this.allowposttopic = false;
                base.AddErrLine("错误的论坛ID");
                return;
            }
            this.pagetitle = Utils.RemoveHtml(this.forum.Name);
            this.enabletag = config.Enabletag && this.forum.AllowTag;
            if (this.forum.ApplytopicType == 1)
            {
                this.topictypeselectoptions = Forums.GetCurrentTopicTypesOption(this.forum.Fid, this.forum.TopicTypes);
            }
            if (!String.IsNullOrEmpty(this.forum.Password) && Utils.MD5(this.forum.Password) != ForumUtils.GetCookie("forum" + this.forumid + "password"))
            {
                base.AddErrLine("本版块被管理员设置了密码");
                base.SetBackLink(base.ShowForumAspxRewrite(this.forumid, 0));
                return;
            }
            this.needaudit = UserAuthority.NeedAudit(forum.Fid, forum.Modnewposts, this.useradminid, this.userid, this.usergroupinfo);
            this.smileyoff = forum.AllowSmilies ? 0 : 1;
            this.bbcodeoff = ((this.forum.Allowbbcode == 1 && this.usergroupinfo.AllowCusbbCode) ? 0 : 1);
            //this.allowimg = this.forum.Allowimgcode;
            this.customeditbuttons = Caches.GetCustomEditButtonList();
            if (!UserAuthority.VisitAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg))
            {
                base.AddErrLine(this.msg);
                this.needlogin = true;
                return;
            }
            if (!UserAuthority.PostAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg))
            {
                base.AddErrLine(this.msg);
                this.needlogin = true;
                return;
            }
            //string allowAttachmentType = Attachments.GetAllowAttachmentType(this.usergroupinfo, this.forum);
            this.attachextensions       = AttachType.GetAttachmentTypeArray(usergroupinfo, this.forum);
            this.attachextensionsnosize = AttachType.GetAttachmentTypeString(usergroupinfo, this.forum);
            int num = (this.userid > 0) ? Attachment.GetUploadFileSizeByuserid(this.userid) : 0;

            this.attachsize          = this.usergroupinfo.MaxSizeperday - num;
            this.canpostattach       = UserAuthority.PostAttachAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg);
            this.canhtmltitle        = this.usergroupinfo.AllowHtmlTitle;
            this.creditstrans        = Scoresets.GetTopicAttachCreditsTrans();
            this.userextcreditsinfo  = Scoresets.GetScoreSet(this.creditstrans);
            this.bonusextcreditsinfo = Scoresets.GetScoreSet(Scoresets.GetBonusCreditsTrans());
            if (this.forum.AllowSpecialOnly && !Utils.InArray(this.type, "poll,bonus,debate"))
            {
                base.AddErrLine(string.Format("当前版块 \"{0}\" 不允许发表普通主题", this.forum.Name));
                return;
            }
            if (!UserAuthority.PostSpecialAuthority(this.forum, this.type, ref this.msg))
            {
                base.AddErrLine(this.msg);
                return;
            }
            if (!UserAuthority.PostSpecialAuthority(this.usergroupinfo, this.type, ref this.msg))
            {
                base.AddErrLine(this.msg);
                this.needlogin = true;
                return;
            }
            if (this.type == "bonus")
            {
                int bonusCreditsTrans = Scoresets.GetBonusCreditsTrans();
                if (bonusCreditsTrans <= 0)
                {
                    base.AddErrLine("系统未设置\"交易积分设置\", 无法判断当前要使用的(扩展)积分字段, 暂时无法发布悬赏");
                    return;
                }
                this.mybonustranscredits = Users.GetUserExtCredits(this.userid, bonusCreditsTrans);
            }
            this.userGroupInfoList.Sort((x, y) => x.Readaccess - y.Readaccess + (y.ID - x.ID));
            var adminGroupInfo = AdminGroup.FindByID(this.usergroupid);

            this.disablepost = adminGroupInfo != null ? adminGroupInfo.DisablePostctrl : this.usergroupinfo.DisablePeriodctrl;
            if (this.ispost)
            {
                if (!UserAuthority.CheckPostTimeSpan(this.usergroupinfo, adminGroupInfo, this.oluserinfo, this.userinfo, ref this.msg))
                {
                    base.AddErrLine(this.msg);
                    return;
                }
                base.SetBackLink(string.Format("posttopic.aspx?forumid={0}&restore=1&type={1}", this.forumid, this.type));
                ForumUtils.WriteCookie("postmessage", this.postmessage);
                this.NormalValidate(adminGroupInfo, this.postmessage, this.userinfo);
                if (base.IsErr())
                {
                    return;
                }
                if (ForumUtils.IsPostFile())
                {
                    if (Utils.StrIsNullOrEmpty(AttachType.GetAttachmentTypeArray(usergroupinfo, forum)))
                    {
                        base.AddErrLine("系统不允许上传附件");
                    }
                    if (!UserAuthority.PostAttachAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg))
                    {
                        base.AddErrLine(this.msg);
                    }
                }
                int  topicprice = 0;
                bool isbonus    = this.type == "bonus";
                this.ValidateBonus(ref topicprice, ref isbonus);
                this.ValidatePollAndDebate();
                if (base.IsErr())
                {
                    return;
                }
                if (ForumUtils.IsHidePost(this.postmessage))
                {
                    int arg_5B2_0 = this.usergroupinfo.AllowHideCode ? 1 : 0;
                }
                var topicInfo = this.CreateTopic(adminGroupInfo, this.postmessage, isbonus, topicprice);
                if (base.IsErr())
                {
                    return;
                }
                //var postInfo = this.CreatePost(topicInfo);
                var postInfo = Post.FindByID(topicInfo.LastPostID);
                //if (base.IsErr())
                //{
                //	return;
                //}
                var stringBuilder = new StringBuilder();
                //AttachmentInfo[] array = null;
                string formString = DNTRequest.GetFormString("attachid");
                if (!string.IsNullOrEmpty(formString))
                {
                    var array = Attachments.GetNoUsedAttachmentArray(this.userid, formString);
                    Attachments.UpdateAttachment(array, topicInfo.ID, postInfo.ID, postInfo, ref stringBuilder, this.userid, this.config, this.usergroupinfo);
                }
                Online.UpdateAction(this.olid, UserAction.PostTopic, this.forumid, this.forum.Name, -1, "");
                if (this.isbindconnect && this.feedstatus)
                {
                    // 推送到QQ空间和微博
                    //PushFeed pushFeed = new PushFeed();
                    //pushFeed.TopicPushFeed(topicInfo, postInfo, array, this.feedstatus);
                }
                if (stringBuilder.Length > 0)
                {
                    base.SetUrl(base.ShowTopicAspxRewrite(topicInfo.ID, 0));
                    base.SetMetaRefresh(5);
                    base.SetShowBackLink(true);
                    if (this.infloat == 1)
                    {
                        base.AddErrLine(stringBuilder.ToString());
                        return;
                    }
                    stringBuilder.Insert(0, "<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td colspan=2 align=\"left\"><span class=\"bold\"><nobr>发表主题成功,但图片/附件上传出现问题:</nobr></span><br /></td></tr>");
                    base.AddMsgLine(stringBuilder.Append("</table>").ToString());
                }
                else
                {
                    base.SetShowBackLink(false);
                    if (this.useradminid != 1 && (UserAuthority.NeedAudit(forum.Fid, forum.Modnewposts, this.useradminid, this.userid, this.usergroupinfo) || topicInfo.DisplayOrder == -2))
                    {
                        ForumUtils.WriteCookie("postmessage", "");
                        this.SetLastPostedForumCookie();
                        base.SetUrl(base.ShowForumAspxRewrite(this.forumid, this.forumpageid));
                        base.SetMetaRefresh();
                        base.AddMsgLine("发表主题成功, 但需要经过审核才可以显示. 返回该版块");
                    }
                    else
                    {
                        this.PostTopicSucceed(this.forum, topicInfo);
                    }
                }
                if (this.needlogin && this.userid > 0)
                {
                    this.needlogin = false;
                    return;
                }
            }
            else
            {
                base.AddLinkCss(BaseConfigs.GetForumPath + "templates/" + this.templatepath + "/editor.css", "css");
            }
        }
Beispiel #4
0
        protected override void ShowPage()
        {
            var adminGroupInfo = AdminGroup.FindByID(this.usergroupid);

            this.disablepostctrl = false;
            if (adminGroupInfo != null)
            {
                this.disablepostctrl = adminGroupInfo.DisablePostctrl;
            }
            if (this.userid == -1)
            {
                this.forum    = new XForum();
                this.topic    = new Topic();
                this.postinfo = new Post();
                base.AddErrLine("您尚未登录");
                return;
            }
            if (this.postid == -1)
            {
                base.AddErrLine("无效的帖子ID");
                return;
            }
            //this.postinfo = Posts.GetPostInfo(this.topicid, this.postid);
            postinfo = Post.FindByID(postid);
            if (this.postinfo == null)
            {
                base.AddErrLine("不存在的帖子ID");
                return;
            }
            this.pagetitle   = ((String.IsNullOrEmpty(this.postinfo.Title)) ? "编辑帖子" : this.postinfo.Title);
            this.htmlon      = this.postinfo.HtmlOn;
            this.message     = this.postinfo.Message;
            this.isfirstpost = (this.postinfo.Layer == 0);
            if (this.topicid != this.postinfo.Tid || this.postinfo.Tid == -1)
            {
                base.AddErrLine("无效的主题ID");
                return;
            }
            //this.topic = Topics.GetTopicInfo(this.postinfo.Tid);
            topic = Topic.FindByID(postinfo.Tid);
            if (this.topic == null)
            {
                base.AddErrLine("不存在的主题ID");
                return;
            }
            if (this.topic.Special == 1 && this.postinfo.Layer == 0)
            {
                //修改为Xcode方法
                this.pollinfo       = Poll.FindByTid(topic.ID);
                this.polloptionlist = PollOption.FindAllByTid(topic.ID);
            }
            if (this.topic.Special == 4 && this.postinfo.Layer == 0)
            {
                this.debateinfo = Debate.FindByTid(this.topic.ID);
            }
            this.forumid   = this.topic.Fid;
            this.forum     = Forums.GetForumInfo(this.forumid);
            this.needaudit = UserAuthority.NeedAudit(forum.Fid, forum.Modnewposts, this.useradminid, this.userid, this.usergroupinfo, this.topic);
            if (this.forum == null || this.forum.Layer == 0)
            {
                base.AddErrLine("版块已不存在");
                this.forum = new XForum();
                return;
            }
            if (!this.forum.Password.IsNullOrEmpty() && Utils.MD5(this.forum.Password) != ForumUtils.GetCookie("forum" + this.forumid + "password"))
            {
                base.AddErrLine("本版块被管理员设置了密码");
                base.SetBackLink(base.ShowForumAspxRewrite(this.forumid, 0));
                return;
            }
            if (this.forum.ApplytopicType == 1)
            {
                this.topictypeselectoptions = Forums.GetCurrentTopicTypesOption(this.forum.Fid, this.forum.Topictypes);
            }
            this.customeditbuttons = Caches.GetCustomEditButtonList();
            if (!UserAuthority.CanEditPost(this.postinfo, this.userid, this.useradminid, ref this.msg))
            {
                base.AddErrLine(this.msg);
                return;
            }
            //string allowAttachmentType = Attachments.GetAllowAttachmentType(this.usergroupinfo, this.forum);
            this.attachextensions       = AttachType.GetAttachmentTypeArray(usergroupinfo, forum);
            this.attachextensionsnosize = AttachType.GetAttachmentTypeString(usergroupinfo, forum);
            int num = (this.userid > 0) ? Attachment.GetUploadFileSizeByuserid(this.userid) : 0;

            this.attachsize      = this.usergroupinfo.MaxSizeperday - num;
            this.canpostattach   = UserAuthority.PostAttachAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg);
            this.userinfo        = BBX.Entity.User.FindByID(this.userid);
            this.attachmentlist  = Attachment.FindAllByPid(this.postinfo.ID);
            this.attachmentcount = this.attachmentlist.Count;
            this.allowviewattach = UserAuthority.DownloadAttachment(this.forum, this.userid, this.usergroupinfo);
            this.smileyoff       = ((!DNTRequest.IsPost()) ? this.postinfo.SmileyOff : (forum.AllowSmilies ? 0 : 1));
            //this.allowimg = this.forum.Allowimgcode;
            this.parseurloff        = this.postinfo.ParseUrlOff;
            this.bbcodeoff          = this.usergroupinfo.AllowCusbbCode ? this.postinfo.BBCodeOff : 1;
            this.usesig             = this.postinfo.UseSig;
            this.userextcreditsinfo = Scoresets.GetScoreSet(Scoresets.GetTopicAttachCreditsTrans());
            if (this.bonusCreditsTrans > 0 && this.bonusCreditsTrans < 9)
            {
                this.bonusextcreditsinfo = Scoresets.GetScoreSet(this.bonusCreditsTrans);
                this.mybonustranscredits = Users.GetUserExtCredits(this.userid, this.bonusCreditsTrans);
            }
            if (!UserAuthority.VisitAuthority(this.forum, this.usergroupinfo, this.userid, ref this.msg))
            {
                base.AddErrLine(this.msg);
                return;
            }
            if (!Moderators.IsModer(this.useradminid, this.userid, this.forumid))
            {
                if (this.postinfo.PosterID != this.userid)
                {
                    base.AddErrLine("你并非作者, 且你当前的身份 \"" + this.usergroupinfo.GroupTitle + "\" 没有修改该帖的权限");
                    return;
                }
                if (this.config.Edittimelimit > 0 && this.postinfo.PostDateTime.AddMinutes(this.config.Edittimelimit) < DateTime.Now)
                {
                    base.AddErrLine("抱歉, 系统规定只能在帖子发表" + this.config.Edittimelimit + "分钟内才可以修改");
                    return;
                }
                if (this.config.Edittimelimit == -1)
                {
                    base.AddErrLine("抱歉,系统不允许修改帖子");
                    return;
                }
                this.alloweditpost = true;
            }
            else
            {
                if (adminGroupInfo != null && adminGroupInfo.AllowEditPost && Moderators.IsModer(this.useradminid, this.userid, this.forumid))
                {
                    this.alloweditpost = true;
                }
            }
            if (!this.alloweditpost && this.postinfo.PosterID != this.userid)
            {
                base.AddErrLine("您当前的身份没有编辑帖子的权限");
                return;
            }
            if (this.postinfo.Layer == 0)
            {
                this.canhtmltitle = this.usergroupinfo.AllowHtmlTitle;
            }
            if (Topics.GetMagicValue(this.topic.Magic, MagicType.HtmlTitle) == 1)
            {
                this.htmltitle = Topics.GetHtmlTitle(this.topic.ID).Replace("\"", "\\\"").Replace("'", "\\'");
            }
            this.enabletag = config.Enabletag && forum.AllowTag;
            if (this.enabletag && Topics.GetMagicValue(this.topic.Magic, MagicType.TopicTag) == 1)
            {
                foreach (var item in Tag.GetTagsListByTopic(this.topic.ID))
                {
                    if (item.OrderID > -1)
                    {
                        this.topictags += string.Format(" {0}", item.Name);
                    }
                }
                this.topictags = this.topictags.Trim();
            }
            this.userGroupInfoList.Sort((x, y) => x.Readaccess - y.Readaccess + (y.ID - x.ID));
            if (this.ispost)
            {
                base.SetBackLink("editpost.aspx?topicid=" + this.postinfo.Tid + "&postid=" + this.postinfo.ID);
                if (ForumUtils.IsCrossSitePost())
                {
                    base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }
                this.SetPostInfo(adminGroupInfo, this.userinfo, DNTRequest.GetString("htmlon").ToInt(0) == 1);
                if (base.IsErr())
                {
                    return;
                }
                //Posts.UpdatePost(this.postinfo);
                postinfo.Update();
                var stringBuilder = this.SetAttachmentInfo();
                if (base.IsErr())
                {
                    return;
                }
                CreditsFacade.UpdateUserCredits(this.userid);
                string url;
                if (this.topic.Special == 4)
                {
                    url = Urls.ShowTopicAspxRewrite(this.topic.ID, this.pageid);
                }
                else
                {
                    if (DNTRequest.GetQueryString("referer") != "")
                    {
                        url = string.Format("showtopic.aspx?page=end&forumpage={2}&topicid={0}#{1}", this.topic.ID, this.postinfo.ID, this.forumpageid);
                    }
                    else
                    {
                        if (this.pageid > 1)
                        {
                            if (this.config.Aspxrewrite == 1)
                            {
                                url = string.Format("showtopic-{0}-{2}{1}#{3}", new object[]
                                {
                                    this.topic.ID,
                                    this.config.Extname,
                                    this.pageid,
                                    this.postinfo.ID
                                });
                            }
                            else
                            {
                                url = string.Format("showtopic.aspx?topicid={0}&forumpage={3}&page={2}#{1}", new object[]
                                {
                                    this.topic.ID,
                                    this.postinfo.ID,
                                    this.pageid,
                                    this.forumpageid
                                });
                            }
                        }
                        else
                        {
                            if (this.config.Aspxrewrite == 1)
                            {
                                url = string.Format("showtopic-{0}{1}", this.topic.ID, this.config.Extname);
                            }
                            else
                            {
                                url = string.Format("showtopic.aspx?topicid={0}&forumpage={1}", this.topic.ID, this.forumpageid);
                            }
                        }
                    }
                }
                base.SetUrl(url);
                if (stringBuilder.Length > 0)
                {
                    base.SetMetaRefresh(5);
                    base.SetShowBackLink(true);
                    if (this.infloat == 1)
                    {
                        base.AddErrLine(stringBuilder.ToString());
                        return;
                    }
                    stringBuilder.Insert(0, "<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td colspan=2 align=\"left\"><span class=\"bold\"><nobr>编辑帖子成功,但图片/附件上传出现问题:</nobr></span><br /></td></tr>");
                    stringBuilder.Append("</table>");
                    base.AddMsgLine(stringBuilder.ToString());
                }
                else
                {
                    if (this.postinfo.Layer == 0)
                    {
                        base.SetMetaRefresh(2, url);
                    }
                    else
                    {
                        base.SetMetaRefresh();
                    }
                    base.SetShowBackLink(false);
                    if (this.useradminid != 1 && (this.needaudit || this.topic.DisplayOrder == -2 || this.postinfo.Invisible == 1))
                    {
                        if (this.postinfo.Layer == 0)
                        {
                            base.SetUrl(base.ShowForumAspxRewrite(this.forumid, this.forumpageid));
                        }
                        else
                        {
                            base.SetUrl(base.ShowTopicAspxRewrite(this.topic.ID, this.forumpageid));
                        }
                        base.AddMsgLine("编辑成功, 但需要经过审核才可以显示");
                    }
                    else
                    {
                        base.MsgForward("editpost_succeed");
                        base.AddMsgLine("编辑帖子成功, 返回该主题");
                    }
                }
                if (this.postinfo.Layer == 0)
                {
                    ForumUtils.DeleteTopicCacheFile(this.topic.ID);
                    return;
                }
            }
            else
            {
                base.AddLinkCss(BaseConfigs.GetForumPath + "templates/" + this.templatepath + "/editor.css", "css");
            }
        }