using System; using System.Data; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using CMS.Forums; using CMS.GlobalHelper; using CMS.UIControls; using CMS.ExtendedControls; public partial class CMSModules_Forums_Tools_Posts_ForumPost_View : CMSForumsPage { protected void Page_Load(object sender, EventArgs e) { int postID = QueryHelper.GetInteger("postid", 0); int forumID = QueryHelper.GetInteger("forumId", 0); ForumContext.CheckSite(0, forumID, postID); postView.PostID = postID; postView.Reply = QueryHelper.GetInteger("reply", 0); postView.ForumID = forumID; postView.ListingPost = QueryHelper.GetString("listingpost", String.Empty); postView.IsLiveSite = false; // Register back to listing script if (!String.IsNullOrEmpty(postView.ListingPost)) { ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "BackToListing", ScriptHelper.GetScript( "function BackToListing() { location.href = '" + ResolveUrl("~/CMSModules/Forums/Tools/Posts/ForumPost_Listing.aspx?postid=" + ScriptHelper.GetString(postView.ListingPost, false)) + "'; }\n")); } // Initialize master page InitializeMasterPage(); } /// /// Initializes MasterPage. /// protected void InitializeMasterPage() { Title = "Forum Post View"; string listingParam = null; if (!String.IsNullOrEmpty(postView.ListingPost)) { listingParam = "+ '&listingpost=" + HTMLHelper.HTMLEncode(postView.ListingPost) + "'"; } // Register script ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "EditPost", ScriptHelper.GetScript("function EditPost(postId) { " + "if ( postId != 0 ) { parent.frames['posts_edit'].location.href = 'ForumPost_Edit.aspx?postid=' + postId" + listingParam + ";}}")); } }