Beispiel #1
0
        public ContentHead GetHotestContent(string[] kinds, string location, ContentRanks rankBy = ContentRanks.PageViews, DateTime?createdFrom = null, DateTime?createdTo = null)
        {
            string order = "PageView DESC";

            switch (rankBy)
            {
            case ContentRanks.Comments:
                order = "Comments DESC";
                break;

            case ContentRanks.Shares:
                order = "Share DESC";
                break;

            case ContentRanks.Date:
                order = "Date";
                break;
            }
            return(GetContents(null, 0, 1, location, kinds, order, createdFrom, createdTo, false, true).FirstOrDefault());
        }
Beispiel #2
0
        public static IHtmlString ContentsRelatedWithHotestThread(Func<ContentHead, HelperResult> itemTemplate = null, string location = null, string[] kinds = null, ContentRanks rankBy = ContentRanks.PageViews, Periods period = Periods.LastDay, int top = 5, string navigationId = null)
        {
            SiteService site = new SiteService();

            DateTime? lastPublished = DateTime.Now;
            if (period != Periods.AnyTime)
                lastPublished = site.GetLastPublishDate(location, kinds);

            ContentHead hotContent = site.GetHotestContent(kinds, location, rankBy, period.StartDate(lastPublished), null);
            if (hotContent == null)
                return new HtmlString("");
            return ContentsRelated(hotContent.TagsToArray(), itemTemplate, null, null, null, false, top, navigationId);
        }
Beispiel #3
0
 public ContentHead GetHotestContent(string[] kinds, string location, ContentRanks rankBy = ContentRanks.PageViews, DateTime?createdFrom = null, DateTime?createdTo = null)
 {
     return(_cmsService.GetHotestContent(kinds, location, rankBy, createdFrom, createdTo));
 }
Beispiel #4
0
        public static IHtmlString ContentsRelatedWithHotestThread(Func <ContentHead, HelperResult> itemTemplate = null, string location = null, string[] kinds = null, ContentRanks rankBy = ContentRanks.PageViews, Periods period = Periods.LastDay, int top = 5, string navigationId = null)
        {
            SiteService site = new SiteService();

            DateTime?lastPublished = DateTime.Now;

            if (period != Periods.AnyTime)
            {
                lastPublished = site.GetLastPublishDate(location, kinds);
            }

            ContentHead hotContent = site.GetHotestContent(kinds, location, rankBy, period.StartDate(lastPublished), null);

            if (hotContent == null)
            {
                return(new HtmlString(""));
            }
            return(ContentsRelated(hotContent.TagsToArray(), itemTemplate, null, null, null, false, top, navigationId));
        }
Beispiel #5
0
 public ContentHead GetHotestContent(string[] kinds, string location, ContentRanks rankBy = ContentRanks.PageViews, DateTime? createdFrom = null, DateTime? createdTo = null)
 {
     return cms.GetHotestContent(kinds, location, rankBy, createdFrom, createdTo);
 }
Beispiel #6
0
 public ContentHead GetHotestContent(string[] kinds, string location, ContentRanks rankBy = ContentRanks.PageViews, DateTime? createdFrom = null, DateTime? createdTo = null)
 {
     string order = "PageView DESC";
     switch (rankBy) {
         case ContentRanks.Comments:
             order = "Comments DESC";
             break;
         case ContentRanks.Shares:
             order = "Share DESC";
             break;
         case ContentRanks.Date:
             order = "Date";
             break;
     }
     return GetContents(null, 0, 1, location, kinds, order, createdFrom, createdTo, false, true).FirstOrDefault();
 }