protected override void ShowPage() { //获取主题信息 topic = GetTopicInfo(); if (topic == null || IsErr()) { return; } topicid = topic.Tid; forumid = topic.Fid; forum = Forums.GetForumInfo(forumid); if (forum == null) { AddErrLine("不存在的版块ID"); return; } pagetitle = string.Format("{0} - {1}", topic.Title, Utils.RemoveHtml(forum.Name)); ///得到广告列表 GetForumAds(forum.Fid); // 检查是否具有版主的身份 if (useradminid != 0) { ismoder = Moderators.IsModer(useradminid, userid, forum.Fid) ? 1 : 0; admininfo = AdminGroups.GetAdminGroupInfo(usergroupid); //得到管理组信息 if (admininfo != null) { disablepostctrl = admininfo.Disablepostctrl; } } //验证不通过则返回 if (!ValidateInfo()) { return; } Caches.GetTopicTypeArray().TryGetValue(topic.Typeid, out topictypes); topictypes = topictypes != "" ? "[" + topictypes + "]" : ""; showratelog = GeneralConfigs.GetConfig().DisplayRateCount > 0 ? 1 : 0; score = Scoresets.GetValidScoreName(); scoreunit = Scoresets.GetValidScoreUnit(); //编辑器状态 EditorState(); navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname); usesig = ForumUtils.GetCookie("sigstatus") == "0" ? 0 : 1; int price = 0; if (topic.Special != 4)//不是辩论帖,就跳转到showtopic页面显示 { HttpContext.Current.Response.Redirect(forumpath + this.ShowTopicAspxRewrite(topic.Tid, 1)); return; } if (topic.Moderated > 0) { moderactions = TopicAdmins.GetTopicListModeratorLog(topicid); } // 获取帖子总数 onlyauthor = Utils.StrIsNullOrEmpty(onlyauthor) ? "0" : onlyauthor; // 获取分页相关信息 BindPageCountAndId(); PostpramsInfo postpramsInfo = GetPostPramsInfo(price); //获取当前正反方列表 positivepostlist = Debates.GetPositivePostList(postpramsInfo, out attachmentlist, ismoder == 1); negativepostlist = Debates.GetNegativePostList(postpramsInfo, out attachmentlist, ismoder == 1); GetPostAds(postpramsInfo, positivepostlist.Count); //辩论帖 if (topic.Special == 4) { GetDebateInfo(postpramsInfo); } enabletag = (config.Enabletag & forum.Allowtag) == 1; if (enabletag) { relatedtopics = Topics.GetRelatedTopicList(topicid, 5); } //更新页面Meta信息 UpdateMetaInfo(Utils.RemoveHtml(debatepost.Message)); ///更新主题查看次数和在线用户信息 TopicStats.Track(topicid, 1); Topics.MarkOldTopic(topic); topicviews = topic.Views + 1 + (config.TopicQueueStats == 1 ? TopicStats.GetStoredTopicViewCount(topic.Tid) : 0); OnlineUsers.UpdateAction(olid, UserAction.ShowTopic.ActionID, forumid, forum.Name, topicid, topic.Title); BindDownloadAttachmentTip(); }
protected override void ShowPage() { //获取主题信息 topic = GetTopicInfo(); if (topic == null || IsErr()) { return; } //未结束的悬赏 if (topic.Special != 3) { HttpContext.Current.Response.Redirect(BaseConfigs.GetForumPath + ShowTopicAspxRewrite(topic.Tid, 1)); return; } topicid = topic.Tid; forumid = topic.Fid; forum = Forums.GetForumInfo(forumid); if (forum == null) { AddErrLine("不存在的版块ID"); return; } pagetitle = string.Format("{0} - {1}", topic.Title, Utils.RemoveHtml(forum.Name)); //得到广告列表 GetForumAds(forum.Fid); //检查是否具有版主的身份 IsModer(); //验证不通过则返回 if (!ValidateInfo()) { return; } //编辑器状态 EditorState(); navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname); bonuslogs = Bonus.GetLogs(topic); if (topic.Moderated > 0) { moderactions = TopicAdmins.GetTopicListModeratorLog(topicid); } Caches.GetTopicTypeArray().TryGetValue(topic.Typeid, out topictypes); topictypes = topictypes != "" ? "[" + topictypes + "]" : ""; if (newpmcount > 0) { pmlist = PrivateMessages.GetPrivateMessageListForIndex(userid, 5, 1, 1); } score = Scoresets.GetValidScoreName(); scoreunit = Scoresets.GetValidScoreUnit(); GetPostAds(GetPostPramsInfo(), postlist.Count); if (postlist.Count <= 0) { AddErrLine("读取信息失败"); return; } //更新页面Meta信息 UpdateMetaInfo(Utils.RemoveHtml(postlist[0].Message)); //更新主题查看次数和在线用户信息 TopicStats.Track(topicid, 1); Topics.MarkOldTopic(topic); topicviews = topic.Views + 1 + (config.TopicQueueStats == 1 ? TopicStats.GetStoredTopicViewCount(topic.Tid) : 0); OnlineUsers.UpdateAction(olid, UserAction.ShowTopic.ActionID, forumid, forum.Name, topicid, topic.Title); BindDownloadAttachmentTip(); ForumUtils.WriteCookie("referer", string.Format("showbonus.aspx?topicid={0}", topicid.ToString())); }