Exemple #1
0
        public bool DeletePost(int postId)
        {
            bool deleted = DBForums.ForumPostDelete(postId);

            if (deleted)
            {
                Forum.DecrementPostCount(this.forumID);
                if (this.totalReplies > 0)
                {
                    DBForums.ForumThreadDecrementReplyStats(this.threadID);
                }
                Forum forum = new Forum(this.forumID);

                this.moduleID = forum.ModuleId;
                this.postID   = postId;

                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);

                int threadPostCount = ForumThread.GetPostCount(this.threadID);
                if (threadPostCount == 0)
                {
                    ForumThread.Delete(this.threadID);
                    Forum.DecrementThreadCount(this.forumID);
                }

                ResetThreadSequences();
            }


            return(deleted);
        }
Exemple #2
0
        public bool UpdateThread()
        {
            bool result = false;

            result = DBForums.ForumThreadUpdate(
                this.threadID,
                this.forumID,
                this.subject,
                this.sortOrder,
                this.isLocked,
                this.isQuestion,
                this.includeInSiteMap,
                this.setNoIndexMeta,
                this.pageTitleOverride,
                this.modStatus,
                this.threadType,
                this.assignedTo,
                this.lockedBy,
                this.lockedReason,
                this.lockedUtc);

            if (this.forumID != this.origForumID)
            {
                Forum.DecrementThreadCount(this.origForumID);
                Forum.IncrementThreadCount(this.forumID);

                ForumThreadMovedArgs e = new ForumThreadMovedArgs();
                e.ForumId         = forumID;
                e.OriginalForumId = origForumID;
                OnThreadMoved(e);


                Forum.RecalculatePostStats(this.origForumID);
                Forum.RecalculatePostStats(this.forumID);
            }

            return(result);
        }