Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            string sFileRequested = context.Request.Path;

            if (sFileRequested.ToLower().EndsWith("/rss.ashx")) {
                SiteData.CurrentSite.RenderRSSFeed(context);
            }

            if (sFileRequested.ToLower().EndsWith("/sitemap.ashx")) {
                SiteMapHelper smh = new SiteMapHelper();
                smh.RenderSiteMap(context);
            }

            if (sFileRequested.ToLower().EndsWith("/trackback.ashx")) {
                TrackbackHelper tbh = new TrackbackHelper();
                if (SiteData.CurretSiteExists) {
                    if (SiteData.CurrentSite.AcceptTrackbacks) {
                        tbh.ProcessTrackback(context, true);
                    } else {
                        tbh.GenerateTrackBackDisabled(context);
                    }
                }
            }

            context.Response.End();
        }
Ejemplo n.º 2
0
		protected override void RenderContents(HtmlTextWriter output) {
			string sTrackback = ControlUtilities.GetManifestResourceStream("Carrotware.CMS.UI.Controls.Trackback.txt");

			ContentPage cp = cu.GetContainerContentPage(this);

			if (cp != null) {
				sTrackback = sTrackback.Replace("{URL}", SiteData.CurrentSite.ConstructedCanonicalURL(cp));
				sTrackback = sTrackback.Replace("{TB_TITLE}", cp.NavMenuText);
				sTrackback = sTrackback.Replace("{TB_URL_ID}", SiteData.CurrentSite.ConstructedCanonicalURL(TrackBackURI) + "?id=" + HttpUtility.UrlEncode(cp.FileName));
				output.Write(sTrackback);
			}

			if (IsPostBack && EnableDirectTrackback) {
				TrackbackHelper tbh = new TrackbackHelper();
				tbh.ProcessTrackback(HttpContext.Current, false);
			}
		}
Ejemplo n.º 3
0
        public string SendTrackback()
        {
            if (this.BlogSite.SendTrackbacks) {
                string sCanonicalURL = this.BlogSite.ConstructedCanonicalURL(this.SourcePage);

                StringBuilder formParams = new StringBuilder();
                formParams.AppendFormat("blog_name={0}", HttpUtility.UrlEncode(this.BlogSite.SiteName));
                formParams.AppendFormat("&url={0}", HttpUtility.UrlEncode(sCanonicalURL));
                formParams.AppendFormat("&title={0}", HttpUtility.UrlEncode(this.SourcePage.NavMenuText));
                formParams.AppendFormat("&excerpt={0}", HttpUtility.UrlEncode(this.SourcePage.PageTextPlainSummary.ToString()));

                TrackbackHelper client = new TrackbackHelper();

                return client.PostRequest(this.DestinationUrl, formParams.ToString());
            } else {
                return "site not currently configured to allow sending trackbacks";
            }
        }