protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.forum)); PageLinks.AddLink("Administration", YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.admin_admin)); PageLinks.AddLink("Board Settings", ""); // create list boxes by populating datasources from Data class Theme.DataSource = YafStaticData.Themes(); Theme.DataTextField = "Theme"; Theme.DataValueField = "FileName"; Language.DataSource = YafStaticData.Languages(); Language.DataTextField = "Language"; Language.DataValueField = "FileName"; ShowTopic.DataSource = YafStaticData.TopicTimes(); ShowTopic.DataTextField = "TopicText"; ShowTopic.DataValueField = "TopicValue"; FileExtensionAllow.DataSource = YafStaticData.AllowDisallow(); FileExtensionAllow.DataTextField = "Text"; FileExtensionAllow.DataValueField = "Value"; BindData(); SetSelectedOnList(ref Theme, PageContext.BoardSettings.Theme); SetSelectedOnList(ref Language, PageContext.BoardSettings.Language); SetSelectedOnList(ref ShowTopic, PageContext.BoardSettings.ShowTopicsDefault.ToString()); SetSelectedOnList(ref FileExtensionAllow, PageContext.BoardSettings.FileExtensionAreAllowed ? "0" : "1"); AllowThemedLogo.Checked = PageContext.BoardSettings.AllowThemedLogo; } }
protected void Page_Load(object sender, System.EventArgs e) { Mession.UnreadTopics = 0; RssFeed.NavigateUrl = YAF.Classes.Utils.YafBuildLink.GetLinkNotEscaped(YAF.Classes.Utils.ForumPages.rsstopic, "pg=topics&f={0}", Request.QueryString["f"]); RssFeed.Text = GetText("RSSFEED"); RssFeed.Visible = PageContext.BoardSettings.ShowRSSLink; MarkRead.Text = GetText("MARKREAD"); RSSLinkSpacer.Visible = PageContext.BoardSettings.ShowRSSLink; ForumJumpHolder.Visible = PageContext.BoardSettings.ShowForumJump && PageContext.Settings.LockedForum == 0; if (!IsPostBack) { //PageLinks.Clear(); if (PageContext.Settings.LockedForum == 0) { PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.forum)); PageLinks.AddLink(PageContext.PageCategoryName, YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.forum, "c={0}", PageContext.PageCategoryID)); } PageLinks.AddForumLinks(PageContext.PageForumID, true); ShowList.DataSource = YafStaticData.TopicTimes( ); ShowList.DataTextField = "TopicText"; ShowList.DataValueField = "TopicValue"; _showTopicListSelected = (Mession.ShowList == -1) ? PageContext.BoardSettings.ShowTopicsDefault : Mession.ShowList; HandleWatchForum(); } if (Request.QueryString ["f"] == null) { YafBuildLink.AccessDenied(); } if (!PageContext.ForumReadAccess) { YafBuildLink.AccessDenied(); } using (DataTable dt = YAF.Classes.Data.DB.forum_list(PageContext.PageBoardID, PageContext.PageForumID)) _forum = dt.Rows [0]; if (_forum ["RemoteURL"] != DBNull.Value) { Response.Clear(); Response.Redirect(( string )_forum ["RemoteURL"]); } _forumFlags = new ForumFlags(_forum["Flags"]); PageTitle.Text = ( string )_forum ["Name"]; BindData(); // Always because of yaf:TopicLine if (!PageContext.ForumPostAccess || (_forumFlags.IsLocked && !PageContext.ForumModeratorAccess)) { NewTopic1.Visible = false; NewTopic2.Visible = false; } if (!PageContext.ForumModeratorAccess) { moderate1.Visible = false; moderate2.Visible = false; } }