Esempio n. 1
0
        /// <summary>
        /// Get the Sitemap URLs.
        /// </summary>
        /// <param name="portalId">The portal id.</param>
        /// <param name="portalSettings">The portal settings.</param>
        /// <param name="version">The version.</param>
        /// <returns>
        /// The List with URLs.
        /// </returns>
        public override List <SitemapUrl> GetUrls(int portalId, PortalSettings portalSettings, string version)
        {
            var urls = new List <SitemapUrl>();

            if (YafContext.Current == null)
            {
                return(urls);
            }

            var forumList = LegacyDb.ForumListAll(
                YafContext.Current.BoardSettings.BoardID,
                UserMembershipHelper.GuestUserId);

            urls.AddRange(
                forumList.Select(
                    forum => new SitemapUrl
            {
                Url =
                    YafBuildLink.GetLinkNotEscaped(
                        ForumPages.topics,
                        true,
                        "f={0}",
                        forum.ForumID),
                Priority        = (float)0.8,
                LastModified    = DateTime.Now,
                ChangeFrequency = SitemapChangeFrequency.Always
            }));

            return(urls);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the forum ids starting with.
        /// </summary>
        /// <param name="forumId">The forum identifier.</param>
        /// <param name="boardId">The board identifier.</param>
        /// <param name="userId">The user identifier.</param>
        /// <returns></returns>
        public static int[] GetForumIDsStartingWith(int forumId, int boardId, int userId)
        {
            if (forumId != 0)
            {
                return(LegacyDb.ForumListAll(boardId, userId, forumId)
                       .Select(f => f.ForumID ?? 0)
                       .Distinct()
                       .ToArray());
            }

            return(new int[0]);
        }