private void LoadSettings()
        {
            config = new RecentContentConfiguration(Settings);

            if (displaySettings.ShowCreatedDate || displaySettings.ShowLastModDate)
            {
                timeZone = SiteUtils.GetUserTimeZone();
            }

            lnkFeedTop.NavigateUrl = SiteRoot + "/Services/RecentContentRss.aspx?pageid="
                                     + PageId.ToInvariantString() + "&mid=" + ModuleId.ToInvariantString();
            if (config.FeedburnerFeedUrl.Length > 0)
            {
                lnkFeedTop.NavigateUrl += "&r=" + Global.FeedRedirectBypassToken.ToString();
            }

            lnkFeedTop.ToolTip  = Resource.RssFeed;
            lnkFeedTop.ImageUrl = Page.ResolveUrl(displaySettings.FeedIconPath);
            lnkFeedTop.Visible  = config.EnableFeed && config.ShowFeedLink && displaySettings.ShowFeedLinkTop;

            lnkFeedBottom.NavigateUrl = lnkFeedTop.NavigateUrl;
            lnkFeedBottom.ToolTip     = Resource.RssFeed;
            lnkFeedBottom.ImageUrl    = Page.ResolveUrl(displaySettings.FeedIconPath);
            lnkFeedBottom.Visible     = config.EnableFeed && config.ShowFeedLink && displaySettings.ShowFeedLinkBottom;
        }
        private List<IndexItem> GetRecentContent()
        {
            List<IndexItem> recentContent = null;

            if (pageId == -1) { return recentContent; }
            if (moduleId == -1) { return recentContent; }

            pageSettings = CacheHelper.GetCurrentPage();
            module = GetModule();

            if (module != null)
            {
                moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
                config = new RecentContentConfiguration(moduleSettings);
                shouldRender = config.EnableFeed;
                if (!shouldRender) { return null; }

                bool shouldRedirectToFeedburner = false;
                if (config.FeedburnerFeedUrl.Length > 0)
                {
                    shouldRedirectToFeedburner = true;
                    if ((Request.UserAgent != null) && (Request.UserAgent.Contains("FeedBurner")))
                    {
                        shouldRedirectToFeedburner = false; // don't redirect if the feedburner bot is reading the feed
                    }

                    Guid redirectBypassToken = WebUtils.ParseGuidFromQueryString("r", Guid.Empty);
                    if (redirectBypassToken == Global.FeedRedirectBypassToken)
                    {
                        shouldRedirectToFeedburner = false; // allows time for user to subscribe to autodiscovery links without redirecting
                    }

                }

                if (shouldRedirectToFeedburner)
                {
                    redirectUrl = config.FeedburnerFeedUrl;
                    shouldRender = false;
                    return null;

                }

                feedCacheTimeInMinutes = config.FeedCacheTimeInMinutes;
                channelTitle = config.FeedChannelTitle;
                channelLink = WebUtils.ResolveServerUrl(SiteUtils.GetCurrentPageUrl());
                channelDescription = config.FeedChannelDescription;
                channelCopyright = config.FeedChannelCopyright;
                channelManagingEditor = config.FeedChannelManagingEditor;
                channelTimeToLive = config.FeedTimeToLiveInMinutes;

                if (config.GetCreated)
                {
                    recentContent = IndexHelper.GetRecentCreatedContent(
                        siteSettings.SiteId,
                        config.GetFeatureGuids(),
                        DateTime.UtcNow.AddDays(-config.MaxDaysOldRecentItemsToGet),
                        config.MaxRecentItemsToGet);
                }
                else
                {
                    recentContent = IndexHelper.GetRecentModifiedContent(
                        siteSettings.SiteId,
                        config.GetFeatureGuids(),
                        DateTime.UtcNow.AddDays(-config.MaxDaysOldRecentItemsToGet),
                        config.MaxRecentItemsToGet);
                }
            }

            return recentContent;
        }
        private void LoadSettings()
        {
            config = new RecentContentConfiguration(Settings);

            if (displaySettings.ShowCreatedDate || displaySettings.ShowLastModDate) { timeZone = SiteUtils.GetUserTimeZone(); }

            lnkFeedTop.NavigateUrl = SiteRoot + "/Services/RecentContentRss.aspx?pageid="
                + PageId.ToInvariantString() + "&mid=" + ModuleId.ToInvariantString();
            if (config.FeedburnerFeedUrl.Length > 0)
            {
                lnkFeedTop.NavigateUrl += "&r=" + Global.FeedRedirectBypassToken.ToString();
            }

            lnkFeedTop.ToolTip = Resource.RssFeed;
            lnkFeedTop.ImageUrl = Page.ResolveUrl(displaySettings.FeedIconPath);
            lnkFeedTop.Visible = config.EnableFeed && config.ShowFeedLink && displaySettings.ShowFeedLinkTop;

            lnkFeedBottom.NavigateUrl = lnkFeedTop.NavigateUrl;
            lnkFeedBottom.ToolTip = Resource.RssFeed;
            lnkFeedBottom.ImageUrl = Page.ResolveUrl(displaySettings.FeedIconPath);
            lnkFeedBottom.Visible = config.EnableFeed && config.ShowFeedLink && displaySettings.ShowFeedLinkBottom;
        }