Example #1
0
        public int GetThreadPage(long tenantId, long elementId, long threadId, long postId, IUnitOfWork unitOfWork = null)
        {
            ForumPost post = _forumRepository.GetPost(tenantId, elementId, threadId, postId, unitOfWork);

            return(post.SortOrder / _forumConfigurationService.PostsPerPage);
        }
Example #2
0
        private string GetPostUrl(Page page, bool authenticated, ForumAction action, ForumThread thread, ForumPost post)
        {
            string     url       = null;
            IUrlHelper urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);

            switch (action)
            {
            case ForumAction.ReplyPost:
                url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "replypost", threadid = thread.ThreadId, postid = post.PostId });
                break;

            case ForumAction.QuotePost:
                url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "quotepost", threadid = thread.ThreadId, postid = post.PostId });
                break;

            case ForumAction.UpdatePost:
                url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "updatepost", threadid = thread.ThreadId, postid = post.PostId });
                break;
            }
            return(GetAuthenticatedUrl(urlHelper, url, authenticated));
        }