Beispiel #1
0
        public override void Layout()
        {
            BlogApp blog = ctx.app.obj as BlogApp;

            blogService.AddHits(blog);

            set("adminUrl", to(new Admin.MyListController().Index));


            bindAppInfo(blog);

            load("blog.UserMenu", new Users.ProfileController().UserMenu);

            BlogSetting s = blog.GetSettingsObj();

            List <BlogCategory> categories = categoryService.GetByApp(ctx.app.Id);
            List <BlogPost>     newBlogs   = postService.GetNewBlog(ctx.app.Id, s.NewBlogCount);

            //List<BlogPostComment> newComments = commentService.GetNew( ctx.owner.Id, ctx.app.Id, s.NewCommentCount );
            List <BlogPostComment> newComments = BlogPostComment.find("AppId=" + ctx.app.Id).list(s.NewCommentCount);

            List <Blogroll> blogrolls = rollService.GetByApp(ctx.app.Id, ctx.owner.obj.Id);

            bindBlogroll(blogrolls);
            bindCategories(categories);
            bindPostList(newBlogs);
            bindComments(newComments);
        }
Beispiel #2
0
        public virtual void UpdateCommentCount(IApp blogApp)
        {
            BlogApp blog  = blogApp as BlogApp;
            int     count = BlogPostComment.find("AppId=" + blog.Id).count();

            blog.CommentCount = count;
            blog.update("CommentCount");
        }