Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!AppSettings.SplashPage.SplashPageEnabled)
        {
            Response.Redirect("~/default.aspx");
        }

        if (Request.QueryString["id"] == null)
        {
            Response.Redirect("~/default.aspx");
        }

        int pageId = Convert.ToInt32(Request.QueryString["id"]);

        try
        {
            CustomSplashPage page = new CustomSplashPage(pageId);

            PageLiteral.Text = Server.HtmlDecode(page.Text);

            if (ReferrerUtils.GetReferrerName() == null)
            {
                ReferrerUtils.SetReferrer(page.UserId);
            }
        }
        catch (Exception ex)
        { }
    }
Beispiel #2
0
    protected void customSplash_Activate(object sender, EventArgs e)
    {
        var UserSplashPage = CustomSplashPage.Get(Member.CurrentId);

        CustomSplashPageLink.Text = String.Format("<i>{0}</i>", U5007.NEEDCREATE);

        if (UserSplashPage != null)
        {
            SplashPageCKEditor.Text = UserSplashPage.Text;
            string CustomSplashPageText = AppSettings.Site.Url + "splash/custom.aspx?id=" + UserSplashPage.Id;
            CustomSplashPageLink.Text = String.Format("<a href='{0}'>{0}</a>", CustomSplashPageText);
        }
        else
        {
            string defaultSplashPageText = @"

            <div style=""width:100%;height:100%;background-image: url(" + AppSettings.Site.Url +
                                           @"splash/SplashPageBackground.jpg);position: absolute;"">

            <div style=""margin:0 auto; width:500px; border:1px solid grey; padding:10px; background:white; margin-top:100px"">
            <h2>This is a sample Splash page.</h2>

            <p><span style=""font-size:10px""><em>Feel free to edit it. You can basically add anything there.</em></span></p>
            </div>
            </div>


            ";
            SplashPageCKEditor.Text = defaultSplashPageText;
        }
    }
Beispiel #3
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        var content = Request.Form[SplashPageCKEditor.UniqueID];

        var UserSplashPage = CustomSplashPage.Get(Member.CurrentId);

        if (UserSplashPage != null)
        {
            UserSplashPage.Text = content;
            UserSplashPage.Save();
        }
        else
        {
            CustomSplashPage page = new CustomSplashPage();
            page.UserId = Member.CurrentId;
            page.Text   = content;
            page.Save();
        }


        //At the end
        customSplash_Activate(this, null);
    }