Exemple #1
0
        public static ContentTag GetByURL(Guid SiteID, string requestedURL)
        {
            ContentTag _item = null;

            using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
                vw_carrot_TagURL query = CompiledQueries.cqGetContentTagByURL(_db, SiteID, requestedURL);
                if (query != null)
                {
                    _item = new ContentTag(query);
                }
            }

            return(_item);
        }
Exemple #2
0
        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);
        }
		internal ContentTag(vw_carrot_TagURL c) {
			if (c != null) {
				SiteData site = SiteData.GetSiteFromCache(c.SiteID);

				this.ContentTagID = c.ContentTagID;
				this.SiteID = c.SiteID;
				this.TagURL = c.TagUrl;
				this.TagText = c.TagText;
				this.UseCount = c.UseCount;
				this.PublicUseCount = c.PublicUseCount;
				this.IsPublic = c.IsPublic;

				if (c.EditDate.HasValue) {
					this.EditDate = site.ConvertUTCToSiteTime(c.EditDate.Value);
				}
			}
		}
Exemple #4
0
        internal ContentTag(vw_carrot_TagURL c)
        {
            if (c != null)
            {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.ContentTagID   = c.ContentTagID;
                this.SiteID         = c.SiteID;
                this.TagURL         = ContentPageHelper.ScrubFilename(c.ContentTagID, c.TagUrl);
                this.TagText        = c.TagText;
                this.UseCount       = c.UseCount;
                this.PublicUseCount = c.PublicUseCount;
                this.IsPublic       = c.IsPublic;

                if (c.EditDate.HasValue)
                {
                    this.EditDate = site.ConvertUTCToSiteTime(c.EditDate.Value);
                }
            }
        }