Exemple #1
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        if (Session["CurrentProfile"] != null)
        {
            Session.Remove("CurrentProfile");
        }
        Session.Timeout = 20;

        ActiveTable.PageSize = Config.TopicPageSize;
        if (!Page.IsPostBack)
        {
            var TopicSinceIndex = SnitzCookie.GetTopicSince();
            var refreshIndex    = SnitzCookie.GetActiveRefresh();

            if (TopicSinceIndex != null)
            {
                ddlTopicsSince.SelectedIndex = Int32.Parse(TopicSinceIndex);
            }
            if (refreshIndex != null)
            {
                ddlPageRefresh.SelectedIndex = Int32.Parse(refreshIndex);
                if (ddlPageRefresh.SelectedValue != "")
                {
                    int reloadTime = 60000 * Convert.ToInt32(ddlPageRefresh.SelectedValue);
                    ScriptManager.RegisterClientScriptBlock(this, GetType(), "refresh", "setRefresh('" + reloadTime + "');", true);
                }
            }
        }
        string pagedescription = String.Format("{0}:{1}", Config.ForumTitle, webResources.ttlActivePage);

        metadescription.Text = String.Format("<meta name=\"description\" content=\"{0}\">", pagedescription.Substring(0, Math.Min(160, pagedescription.Length)));

        TopicUpdatePanel.Triggers.Add(new AsyncPostBackTrigger {
            ControlID = ddlPageRefresh.UniqueID
        });
        TopicUpdatePanel.Triggers.Add(new AsyncPostBackTrigger {
            ControlID = ddlTopicsSince.UniqueID
        });
        if (Config.TopicAvatar)
        {
            FolderImg.Visible = false;
        }
    }