Esempio n. 1
0
        protected virtual void GetThread()
        {
            ThreadType realThreadType = ThreadType.Normal;

            if (IsOnlyLookOneUser)
            {
                int totalCount;
                PostBOV5.Instance.GetUserPosts(ThreadID, LookUserID, ThreadType.Normal, PageNumber, PageSize, true, false, out m_Thread, out m_PostList, out realThreadType, out totalCount);

                m_TotalPosts = totalCount;
            }
            else
            {
                if (string.IsNullOrEmpty(Type))
                {
                    PostBOV5.Instance.GetThreadWithReplies(ThreadID, PageNumber, PageSize, true, UpdateView, true, out m_Thread, out m_PostList, out realThreadType);
                }
                else if (GetPosts(ThreadType.Normal, out m_TotalPosts, out m_Thread, out m_PostList))
                {
                }
                else if (IsUnapprovePosts || IsMyUnapprovePosts)
                {
                    m_MustRemovePostListFirstOne = false;
                    int total;
                    PostBOV5.Instance.GetUnapprovedPostThread(ThreadID, null, PageNumber, PageSize, out m_Thread, out m_PostList, out total);
                    m_TotalPosts = total;
                }
                else
                {
                    ShowError(new InvalidParamError("type"));
                }
            }
            //如果不是 投票 问题  辩论  则跳到相应的页面
            if (realThreadType != ThreadType.Normal)
            {
                Response.Redirect(BbsUrlHelper.GetThreadUrl(CodeName, ThreadID, PostBOV5.Instance.GetThreadTypeString(realThreadType)));
            }

            PostBOV5.Instance.ProcessKeyword(m_PostList, ProcessKeywordMode.TryUpdateKeyword);

            //if (_Request.IsSpider == false)
            //{
            //List<int> userIDs = new List<int>();
            //foreach(PostV5 post in m_PostList)
            //{
            //    userIDs.Add(post.UserID);
            //}
            //UserBO.Instance.GetUsers(userIDs, GetUserOption.WithAll);
            UserBO.Instance.GetUsers(m_PostList.GetUserIds(), GetUserOption.WithAll);
            //}
        }
Esempio n. 2
0
        private void GetThread()
        {
            //if (Forum == null)
            //return;

            int threadID = _Request.Get <int>("threadid", Method.Get, 0);
            int pageSize = AllSettings.Current.BbsSettings.PostsPageSize;

            try
            {
                using (new ErrorScope())
                {
                    ThreadType tempType;
                    PostBOV5.Instance.GetThreadWithReplies(threadID, ThreadType.Normal, PageNumber, pageSize, false, true, true, false, out m_Thread, out m_ReplyList, out tempType);
                    if (m_Thread == null)
                    {
                        ErrorMessage = "主题不存在";
                    }
                    else
                    {
                        if (m_Thread != null)
                        {
                            //List<int> userIDs = new List<int>();
                            //foreach (PostV5 post in m_ReplyList)
                            //{
                            //    userIDs.Add(post.UserID);
                            //}
                            //UserBO.Instance.GetUsers(userIDs, GetUserOption.WithAll);
                            UserBO.Instance.GetUsers(m_ReplyList.GetUserIds(), GetUserOption.WithAll);

                            SetPager("PostListPager", BbsUrlHelper.GetArchiverThreadUrlForPager(Thread.Forum.CodeName, threadID), PageNumber, pageSize, m_Thread.TotalReplies + 1);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogManager.LogException(ex);
                ErrorMessage = ex.Message;
            }
        }