public string GetBlogHeadingFromURL(SiteData currentSite, string sFilterPath)
{
Guid siteID = currentSite.SiteID;
string sTitle = String.Empty;
if (currentSite.CheckIsBlogCategoryPath(sFilterPath))
{
vw_carrot_CategoryURL query = CompiledQueries.cqGetCategoryByURL(db, siteID, sFilterPath);
sTitle = query.CategoryText;
}
if (currentSite.CheckIsBlogTagPath(sFilterPath))
{
vw_carrot_TagURL query = CompiledQueries.cqGetTagByURL(db, siteID, sFilterPath);
sTitle = query.TagText;
}
if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath))
{
vw_carrot_EditorURL query = CompiledQueries.cqGetEditorByURL(db, siteID, sFilterPath);
ExtendedUserData usr = new ExtendedUserData(query.UserId);
sTitle = usr.ToString();
}
if (currentSite.CheckIsBlogDateFolderPath(sFilterPath))
{
BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
TimeSpan ts = p.DateEndUTC - p.DateBeginUTC;
int daysDelta = ts.Days;
if (daysDelta > 90)
{
sTitle = "Year " + p.DateBegin.ToString("yyyy");
}
if (daysDelta < 36)
{
sTitle = p.DateBegin.ToString("MMMM yyyy");
}
if (daysDelta < 5)
{
sTitle = p.DateBegin.ToString("MMMM d, yyyy");
}
}
if (currentSite.CheckIsSiteSearchPath(sFilterPath))
{
sTitle = "Search Results";
}
return(sTitle);
}