View Single Post
  #2 (permalink)  
Old August 14th, 2006, 12:49 AM
drohm drohm is offline
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: , , USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also just verified the GetArticleCount(bool publishedOnly, int categoryID) method. Its using the logic I assumed in my previous post, confirming the error.

Code:
      /// <summary>
      /// Returns the number of total published articles for the specified category
      /// </summary>
      public static int GetArticleCount(bool publishedOnly, int categoryID)
      {
         if (!publishedOnly)
            return GetArticleCount(categoryID);

         if (categoryID <= 0)
            return GetArticleCount(publishedOnly);

         int articleCount = 0;
         string key = "Articles_ArticleCount_" + publishedOnly.ToString() + "_" + categoryID.ToString();

         if (BaseArticle.Settings.EnableCaching && BizObject.Cache[key] != null)
         {
            articleCount = (int)BizObject.Cache[key];
         }
         else
         {
            articleCount = SiteProvider.Articles.GetPublishedArticleCount(categoryID, DateTime.Now);
            BaseArticle.CacheData(key, articleCount);
         }
         return articleCount; 
      }
Hope this helps.

Doug

Reply With Quote