protected SiteNav GetCurrentPage() { SiteNav pageNav = null; ControlUtilities cu = new ControlUtilities(this); ContentPage cp = cu.GetContainerContentPage(this); if (cp != null) { pageNav = new SiteNav(); pageNav.Root_ContentID = cp.Root_ContentID; pageNav.NavMenuText = cp.NavMenuText; pageNav.FileName = cp.FileName; pageNav.TemplateFile = cp.TemplateFile; pageNav.ContentType = cp.ContentType; pageNav = cp.GetSiteNav(); } else { pageNav = navHelper.FindByFilename(SiteData.CurrentSiteID, SiteData.AlternateCurrentScriptName); //assign bogus page name for comp purposes if (pageNav == null) { pageNav = new SiteNav(); pageNav.Root_ContentID = Guid.Empty; pageNav.FileName = "/##/##/"; pageNav.TemplateFile = "/##/##/"; } } pageNav.SiteID = SiteData.CurrentSiteID; return(pageNav); }
public void FetchData() { base.ReadPageNbr(); List <PostComment> lstContents = new List <PostComment>(); using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) { if (SiteData.IsWebView) { SiteNav sn = navHelper.FindByFilename(SiteData.CurrentSiteID, SiteData.CurrentScriptName); if (sn != null) { TotalRecords = PostComment.GetCommentCountByContent(sn.Root_ContentID, !SecurityData.IsAuthEditor); lstContents = PostComment.GetCommentsByContentPageNumber(sn.Root_ContentID, this.PageNumberZeroIndex, this.PageSize, this.OrderBy, !SecurityData.IsAuthEditor); } } else { TotalRecords = 0; lstContents = new List <PostComment>(); } } lstContents.ToList().ForEach(q => CMSConfigHelper.IdentifyLinkAsInactive(q)); this.DataSource = lstContents; }
public void GenerateSuccessResponse(HttpRequest request, XmlWriter writer, TrackBackInfo tb) { SiteNav navData = null; using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) { navData = navHelper.FindByFilename(SiteData.CurrentSiteID, tb.BlogPostID); } string sReferer = null; string sIP = request.ServerVariables["REMOTE_ADDR"].ToString(); try { sReferer = request.ServerVariables["HTTP_REFERER"].ToString(); } catch { } PostComment pc = new PostComment(); pc.ContentCommentID = Guid.NewGuid(); pc.Root_ContentID = navData.Root_ContentID; pc.CreateDate = SiteData.CurrentSite.Now; pc.IsApproved = false; pc.IsSpam = false; pc.CommenterIP = sIP; pc.CommenterEmail = "trackback"; pc.CommenterName = tb.BlogName; pc.PostCommentText = tb.BlogExcerpt; #if DEBUG pc.PostCommentText = request.UserAgent + "\r\n" + tb.RequestSourceURL + "\r\n" + tb.BlogExcerpt; #endif pc.CommenterURL = tb.RequestSourceURL; if (!string.IsNullOrEmpty(sReferer)) { pc.CommenterURL = sReferer; } pc.Save(); writer.WriteStartElement("response"); writer.WriteElementString("error", "0"); writer.WriteStartElement("rss"); writer.WriteAttributeString("version", "0.91"); writer.WriteStartElement("channel"); if (navData != null) { writer.WriteElementString("title", navData.NavMenuText); writer.WriteElementString("link", SiteData.CurrentSite.ConstructedCanonicalURL(navData)); writer.WriteElementString("description", navData.PageTextPlainSummary); } writer.WriteElementString("language", ""); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndElement(); writer.Flush(); writer.Close(); }
public string SendTrackback(string sourceURL, Guid siteID, string sTgtURL) { this.DestinationUrl = new Uri(sTgtURL); this.BlogSite = SiteData.GetSiteFromCache(siteID); using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) { this.SourcePage = navHelper.FindByFilename(siteID, sourceURL); } return(SendTrackback()); }
public static SiteNav GetCurrentPage() { using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) { SiteNav pageNav = navHelper.FindByFilename(SiteData.CurrentSiteID, SiteData.AlternateCurrentScriptName); //assign bogus page name for comp purposes if (pageNav == null) { pageNav = new SiteNav(); pageNav.Root_ContentID = Guid.Empty; pageNav.FileName = "/##/##/"; pageNav.TemplateFile = "/##/##/"; } pageNav.SiteID = SiteData.CurrentSiteID; return(pageNav); } }