using System; using CMS.CMSHelper; using CMS.ExtendedControls; using CMS.Forums; using CMS.GlobalHelper; using CMS.SiteProvider; using CMS.UIControls; public partial class CMSModules_Forums_Controls_Layouts_Flat_ThreadEdit : ForumViewer { protected void Page_Load(object sender, EventArgs e) { if (IsAdHocForum) { plcHeader.Visible = false; } forumEdit.OnPreview += new EventHandler(forumEdit_OnPreview); forumEdit.OnModerationRequired += new EventHandler(forumEdit_OnModerationRequired); // Check whether subscription is for forum or post if (ForumContext.CurrentReplyThread == null) { ltrTitle.Text = GetString("Forums_ForumNewPost_Header.NewThread"); if (ForumContext.CurrentPost != null && ForumContext.CurrentMode == ForumMode.Edit) { ltrTitle.Text = GetString("Forums_ForumNewPost_Header.EditPost"); } } else { plcPreview.Visible = true; ltrTitle.Text = GetString("Forums_ForumNewPost_Header.Reply"); ltrAvatar.Text = AvatarImage(ForumContext.CurrentReplyThread); ltrSubject.Text = HTMLHelper.HTMLEncode(ForumContext.CurrentReplyThread.PostSubject); if (ForumContext.CurrentForum != null) { if (ForumContext.CurrentForum.ForumEnableAdvancedImage) { ltrText.AllowedControls = ControlsHelper.ALLOWED_FORUM_CONTROLS; } else { ltrText.AllowedControls = "none"; } ltrText.Text = ResolvePostText(ForumContext.CurrentReplyThread.PostText); } ltrUserName.Text = HTMLHelper.HTMLEncode(ForumContext.CurrentReplyThread.PostUserName); ltrTime.Text = CMSContext.ConvertDateTime(ForumContext.CurrentReplyThread.PostTime, this).ToString(); UserSettingsInfo usi = UserSettingsInfoProvider.GetUserSettingsInfoByUser(ForumContext.CurrentReplyThread.PostUserID); BadgeInfo bi = null; string badgeName = null; string badgeImageUrl = null; if (usi != null) { bi = BadgeInfoProvider.GetBadgeInfo(usi.UserBadgeID); if (bi != null) { badgeName = HTMLHelper.HTMLEncode(ResHelper.LocalizeString(bi.BadgeDisplayName)); badgeImageUrl = HTMLHelper.HTMLEncode(bi.BadgeImageURL); } } ltrBadge.Text = GetNotEmpty(badgeName, "