예제 #1
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;
            }
        }