Ejemplo n.º 1
0
        /// <summary>
        ///     Writes empty pages to disk.
        /// </summary>
        public void WritePages()
        {
            PageTemplateToolboxContext templateContext = new PageTemplateToolboxContext();

            templateContext.Put("CategoryId", Id);
            templateContext.Put("CategoryName", LinkName);
            templateContext.Put("MetaDescription",
                                !string.IsNullOrEmpty(MetaDescription)
                                                                        ? MetaDescription
                                                                        : HttpUtility.HtmlEncode(Util.RemoveHtml(Body, 255) ?? string.Empty));

            templateContext.Put("MetaKeywords",
                                !string.IsNullOrEmpty(MetaKeywords)
                                                                        ? MetaKeywords
                                                                        : Name);


            if (!IsUncategorized)
            {
                PageWriter.Write("category.view", "~/" + LinkName + "/" + Util.DEFAULT_PAGE, templateContext);
                PageWriter.Write("categoryrss.view", "~/" + LinkName + "/feed/" + Util.DEFAULT_PAGE, templateContext);
            }

            if (__initialCategoryName != null && __initialCategoryName != LinkName)
            {
                PostCollection pc        = new PostCollection();
                Query          postQuery = Post.CreateQuery();
                postQuery.AndWhere(Post.Columns.CategoryId, Id);
                pc.LoadAndCloseReader(postQuery.ExecuteReader());
                foreach (Post p in pc)
                {
                    p.Save();
                }
            }
        }
Ejemplo n.º 2
0
        public static void WritePage(string name)
        {
            PageTemplateToolboxContext templateContext = new PageTemplateToolboxContext();
            templateContext.Put("tag", name);
            templateContext.Put("MetaDescription", "Posts and articles tagged as " + name);
            templateContext.Put("MetaKeywords", name);

            PageWriter.Write("tag.view", "~/tags/" + name + "/" + Util.DEFAULT_PAGE, templateContext);
            PageWriter.Write("tagrss.view", "~/tags/" + name + "/feed/" + Util.DEFAULT_PAGE, templateContext);
        }
Ejemplo n.º 3
0
        public static void WritePage(string name)
        {
            PageTemplateToolboxContext templateContext = new PageTemplateToolboxContext();

            templateContext.Put("tag", name);
            templateContext.Put("MetaDescription", "Posts and articles tagged as " + name);
            templateContext.Put("MetaKeywords", name);


            PageWriter.Write("tag.view", "~/tags/" + name + "/" + Util.DEFAULT_PAGE, templateContext);
            PageWriter.Write("tagrss.view", "~/tags/" + name + "/feed/" + Util.DEFAULT_PAGE, templateContext);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Writes out the empty pages for the post. Also handles the redirect pages
        /// </summary>
        public void WritePages()
        {
            PageTemplateToolboxContext templateContext = new PageTemplateToolboxContext();

            templateContext.Put("PostId", Id);
            templateContext.Put("CategoryId", CategoryId);
            templateContext.Put("PostName", Name);
            templateContext.Put("Name", Name);
            templateContext.Put("CategoryName", Category.LinkName);
            templateContext.Put("MetaDescription",
                                !string.IsNullOrEmpty(MetaDescription)
                                    ? MetaDescription
                                    : HttpUtility.HtmlEncode(Util.RemoveHtml(PostBody, 255) ?? string.Empty));

            templateContext.Put("MetaKeywords",
                                !string.IsNullOrEmpty(MetaKeywords)
                                    ? MetaKeywords
                                    : TagList);


            string pageName = null;

            if (CategoryController.UnCategorizedId != CategoryId)
            {
                pageName = categories.GetCachedCategory(CategoryId, false).LinkName + "/";
            }

            pageName = "~/" + pageName + Name + "/" + Util.DEFAULT_PAGE;

            PageWriter.Write("post.view", pageName, templateContext);
        }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LiHyperLink.SetNameToCompare(Context,"settings");

        ClientScript.RegisterStartupScript(this.GetType(), "set-fields", "toggleServerAuthFields()", true);
        if (!IsPostBack)
        {
            SiteSettings settings = SiteSettings.Get();
            txtServerName.Text = settings.EmailServer;
            txtFrom.Text = settings.EmailFrom;
            RequiresAuthentication.Checked = settings.EmailServerRequiresAuthentication;
            UseSSL.Checked = settings.EmailRequiresSSL;
            txtPort.Text = settings.EmailPort.ToString();

            if (RequiresAuthentication.Checked)
            {
                txtUser.Text = settings.EmailUser;
                txtPassword.Text = settings.EmailPassword;
            }

            PageTemplateToolboxContext ptc = new PageTemplateToolboxContext();
            ptc.Put("comment", this);
        }
    }
Ejemplo n.º 6
0
        /// <summary>
        /// Writes out the empty pages for the post. Also handles the redirect pages
        /// </summary>
        public void WritePages()
        {
            PageTemplateToolboxContext templateContext = new PageTemplateToolboxContext();
            templateContext.Put("PostId", Id);
            templateContext.Put("CategoryId", CategoryId);
            templateContext.Put("PostName", Name);
            templateContext.Put("Name", Name);
            templateContext.Put("CategoryName", Category.LinkName);
            templateContext.Put("MetaDescription",
                                !string.IsNullOrEmpty(MetaDescription)
                                    ? MetaDescription
                                    : HttpUtility.HtmlEncode(Util.RemoveHtml(PostBody,255) ?? string.Empty));

            templateContext.Put("MetaKeywords",
                                !string.IsNullOrEmpty(MetaKeywords)
                                    ? MetaKeywords
                                    : TagList);

            string pageName = null;

            if(CategoryController.UnCategorizedId != CategoryId)
                     pageName =  categories.GetCachedCategory(CategoryId, false).LinkName + "/";

            pageName = "~/" + pageName + Name + "/" + Util.DEFAULT_PAGE;

            PageWriter.Write("post.view", pageName, templateContext);
        }