protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            BSSetting bsSettingWidgetPositions = BSSetting.GetSetting("widgetpositions");

            if (bsSettingWidgetPositions != null)
            {
                string[] strPositions = bsSettingWidgetPositions.Value.Split('|');
                if (strPositions.Length > 1)
                {
                    string[] strLeft  = strPositions[0].Split(',');
                    string[] strRight = strPositions[1].Split(',');
                    for (int i = 0; i < strLeft.Length; i++)
                    {
                        try
                        {
                            if (strLeft[i].Trim() != "")
                            {
                                phLeftPanel.Controls.Add(Page.LoadControl("Widgets/" + strLeft[i] + ".ascx"));
                            }
                        }
                        catch { }
                    }
                    for (int i = 0; i < strRight.Length; i++)
                    {
                        try
                        {
                            if (strRight[i].Trim() != "")
                            {
                                phRightPanel.Controls.Add(Page.LoadControl("Widgets/" + strRight[i] + ".ascx"));
                            }
                        }
                        catch { }
                    }
                }
            }
            else
            {
                try
                {
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/Now.ascx"));
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/RecentComments.ascx"));
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/HitPosts.ascx"));
                    phRightPanel.Controls.Add(Page.LoadControl("Widgets/QuickPost.ascx"));
                    phRightPanel.Controls.Add(Page.LoadControl("Widgets/BlogsaNews.ascx"));
                }
                catch { }

                BSSetting bsSetting = new BSSetting();
                bsSetting.Name  = "widgetpositions";
                bsSetting.Value = "Now,RecentComments,HitPosts|QuickPost,BlogsaNews";
                bsSetting.Save();
            }
        }
        catch (System.Exception ex)
        {
            ltError.Text = ex.Message;
        }
    }
Exemple #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        foreach (Control control in phThemeSettings.Controls)
        {
            Admin_Content_EditControl ec = (Admin_Content_EditControl)control;

            string settingName = String.Format("{0}_{1}", BSTheme.Current.Name, ec.Key);

            BSSetting s = BSSetting.GetSetting(settingName) ?? new BSSetting();

            s.Main    = false;
            s.Title   = ec.Title;
            s.Name    = settingName;
            s.Value   = ec.Value;
            s.Visible = false;

            if (s.Save())
            {
                if (Blogsa.Settings[settingName] != null)
                {
                    Blogsa.Settings[settingName] = s;
                }
                else
                {
                    Blogsa.Settings.Add(s);
                }

                BSTheme.Current.Settings[ec.Key].Value = s.Value;
            }
        }

        MessageBox1.Message = Language.Admin["SettingSaved"];
        MessageBox1.Type    = MessageBox.ShowType.Information;
    }
    private void SaveValue(string name, string value)
    {
        BSSetting setting = BSSetting.GetSetting(name);

        if (setting != null)
        {
            setting.Value = value;
            if (setting.Save())
            {
                Blogsa.Settings[setting.Name].Value = value;
            }
        }
    }
Exemple #4
0
    protected void rpAllThemes_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "UseTheme")
        {
            BSSetting bsSetting = BSSetting.GetSetting("theme");
            bsSetting.Value = e.CommandArgument.ToString();

            if (bsSetting.Save())
            {
                Blogsa.ActiveTheme  = bsSetting.Value;
                BSTheme.Current     = null;
                MessageBox1.Message = Language.Admin["ThemeUpgraded"];
                Response.Redirect("Design.aspx");
            }
        }
    }