/// <summary> /// 个人首页 /// </summary> /// <returns></returns> public ActionResult PersonIndex(int PageNo = 1) { if (Session[ConstHelper.Session_USERID] == null) { return(Redirect("/Home/Index")); } var u = UserInfo.GetUserInfoBySn(Session[ConstHelper.Session_USERID].ToString()); ArticleListManager.ArticleQueryFilter filter = ArticleListManager.FirstPageArticleQueryFileter; //难度和分类 filter.Levelist = u.Level.Count == 0 ? null : u.Level.ToArray(); filter.Cataloglist = u.Catalog.Count == 0 ? null : u.Catalog.ToArray(); filter.ContainTag = string.IsNullOrEmpty(u.ContainTag) ? null : u.ContainTag.Split(";".ToArray()); filter.AntiTag = string.IsNullOrEmpty(u.AntiTag) ? null : u.AntiTag.Split(";".ToArray()); //TODO:标签 Pages p = new Pages(ArticleListManager.GetArticleCnt(filter), 20) { CurrentPageNo = PageNo }; var currentpageList = ArticleListManager.GetPublicListForArticleByPage(p, filter); ViewData.Model = currentpageList; ViewBag.TopArticle = ArticleListManager.GetTopArticle(); ViewBag.Pages = p; ViewBag.TopArticle = ArticleListManager.GetTopArticle(); ViewBag.AsideFirst = ASideColumnManager.MostArticleAuthor(10); ViewBag.AsideSecond = ASideColumnManager.MostHotTag(10); ViewBag.AsideThird = ASideColumnManager.HotArticle(10, 72); return(View()); }
/// <summary> /// 首页文章加载 /// </summary> /// <param name="PageNo"></param> /// <returns></returns> public ActionResult Index(int PageNo = 1) { Pages p = new Pages(ArticleListManager.GetArticleCnt(ArticleListManager.FirstPageArticleQueryFileter), 20) { CurrentPageNo = PageNo }; var currentpageList = ArticleListManager.GetPublicListForArticleByPage(p, ArticleListManager.FirstPageArticleQueryFileter); ViewData.Model = currentpageList; ViewBag.TopArticle = ArticleListManager.GetTopArticle(); ViewBag.Pages = p; ViewBag.AsideFirst = ASideColumnManager.MostArticleAuthor(10); ViewBag.AsideSecond = ASideColumnManager.MostHotTag(10); ViewBag.AsideThird = ASideColumnManager.HotArticle(10, 72); return(View()); }
/// <summary> /// 所有文章一览(公开的) /// </summary> /// <param name="PageNo"></param> /// <returns></returns> public ActionResult ArticleList(int PageNo = 1) { if (Session[ConstHelper.Session_USERID] == null || (UserType)Session[ConstHelper.Session_PRIVILEGE] != UserType.Admin) { return(Redirect("/")); } ViewBag.Title = "文章管理"; //公开的审核通过的所有文章 Pages p = new Pages(ArticleListManager.GetArticleCnt(ArticleListManager.PublicArticleQueryFilter), 50); p.CurrentPageNo = PageNo; var currentpageList = ArticleListManager.GetPublicListForArticleByPage(p, ArticleListManager.PublicArticleQueryFilter); ViewData.Model = currentpageList; ViewBag.Pages = p; return(View()); }