forumrsswriter.cs

来自「community server 源码」· CS 代码 · 共 59 行

CS
59
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using CommunityServer.Components;
using CommunityServer.Configuration;

namespace CommunityServer.Discussions.Components
{
	/// <summary>
	/// Summary description for ForumRssWriter.
	/// </summary>
    public class ForumRssWriter : BaseForumsRssWriter
    {
        protected int ForumID;
		

        public ForumRssWriter(ArrayList posts, Section s, string baseUrl):base(posts,s,baseUrl)
        {
		        ForumID = s.SectionID;
        }

        /// <summary>
        /// Output the header contents of the channel element.
        /// </summary>
        protected override void WriteChannel()
        {
            BuildChannel(ForumUrls.Instance().Forum(ForumID),CurrentSection.Description, CurrentSection.DefaultLanguage );
        }

        protected override bool AllowComments
        {
            get
            {
                return false;
            }
        }

		protected override void PostComments(Post p)
		{
			base.PostComments (p);
			this.WriteElementString("comments", FormatUrl(SiteUrls.Instance().Post(p.PostID)));

			string url = FormatUrl(ForumUrls.Instance().CommentRss(p.SectionID, p.PostID));
			CSContext cntx = CSContext.Current;
			if (!cntx.IsUserTokenRequest)
				this.WriteElementString("wfw:commentRss", url);
			else
				this.WriteElementString("wfw:commentRss", SiteUrls.FormatUrlWithUserNameToken(url, cntx.User, true));
		}


    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?