Inheritance: IDisposable
		public static TrackBackEntry Get(Guid TrackbackQueueID) {
			TrackBackEntry _item = null;
			using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
				vw_carrot_TrackbackQueue query = CompiledQueries.cqGetTrackbackByID(_db, TrackbackQueueID);
				_item = new TrackBackEntry(query);
			}

			return _item;
		}
Example #2
0
        public static TrackBackEntry Get(Guid TrackbackQueueID)
        {
            TrackBackEntry _item = null;

            using (CarrotCMSDataContext _db = CarrotCMSDataContext.GetDataContext()) {
                vw_carrot_TrackbackQueue query = CompiledQueries.cqGetTrackbackByID(_db, TrackbackQueueID);
                _item = new TrackBackEntry(query);
            }

            return(_item);
        }
Example #3
0
        public void SaveTrackbackTop()
        {
            SiteData site = SiteData.GetSiteFromCache(this.SiteID);

            if (this.IsLatestVersion && site.SendTrackbacks)
            {
                TrackBackEntry t = TrackBackEntry.GetTrackBackQueue(this.Root_ContentID).FirstOrDefault();
                if (t != null && t.CreateDate > site.Now.AddMinutes(-10))
                {
                    try {
                        TrackBacker tb = new TrackBacker();
                        t.TrackBackResponse = tb.SendTrackback(t.Root_ContentID, site.SiteID, t.TrackBackURL);
                        t.TrackedBack       = true;
                        t.Save();
                    } catch (Exception ex) { }
                }
            }
        }
Example #4
0
 public override bool Equals(Object obj)
 {
     //Check for null and compare run-time types.
     if (obj == null || GetType() != obj.GetType())
     {
         return(false);
     }
     if (obj is TrackBackEntry)
     {
         TrackBackEntry p = (TrackBackEntry)obj;
         return(this.TrackbackQueueID == p.TrackbackQueueID &&
                this.Root_ContentID == p.Root_ContentID &&
                this.TrackBackURL.ToLowerInvariant() == p.TrackBackURL.ToLowerInvariant());
     }
     else
     {
         return(false);
     }
 }
Example #5
0
        public void SendTrackbackQueue()
        {
            if (this.SendTrackbacks)
            {
                List <TrackBackEntry> lstTBQ = TrackBackEntry.GetTrackBackSiteQueue(this.SiteID);

                foreach (TrackBackEntry t in lstTBQ)
                {
                    if (t.CreateDate > this.Now.AddMinutes(-30))
                    {
                        try {
                            TrackBacker tb = new TrackBacker();
                            t.TrackBackResponse = tb.SendTrackback(t.Root_ContentID, this.SiteID, t.TrackBackURL);
                            t.TrackedBack       = true;
                            t.Save();
                        } catch (Exception ex) { }
                    }
                }
            }
        }
Example #6
0
        public void SaveTrackbacks()
        {
            SiteData site = SiteData.GetSiteFromCache(this.SiteID);

            if (!String.IsNullOrEmpty(this.NewTrackBackURLs))
            {
                this.NewTrackBackURLs = this.NewTrackBackURLs.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n\n", "\n");
                string[] TBURLs = this.NewTrackBackURLs.Split('\n');
                foreach (string sURL in TBURLs)
                {
                    List <TrackBackEntry> lstTB = TrackBackEntry.FindTrackbackByURL(this.Root_ContentID, sURL);
                    if (lstTB.Count < 1)
                    {
                        TrackBackEntry tbe = new TrackBackEntry {
                            Root_ContentID = this.Root_ContentID,
                            TrackBackURL   = sURL,
                            TrackedBack    = false
                        };

                        tbe.Save();
                    }
                }
            }

            if (this.IsLatestVersion && site.SendTrackbacks)
            {
                List <TrackBackEntry> lstTBQ = TrackBackEntry.GetTrackBackQueue(this.Root_ContentID);
                foreach (TrackBackEntry t in lstTBQ)
                {
                    if (t.CreateDate > site.Now.AddMinutes(-10))
                    {
                        try {
                            TrackBacker tb = new TrackBacker();
                            t.TrackBackResponse = tb.SendTrackback(t.Root_ContentID, site.SiteID, t.TrackBackURL);
                            t.TrackedBack       = true;
                            t.Save();
                        } catch (Exception ex) { }
                    }
                }
            }
        }
Example #7
0
        public void SaveTrackbacks()
        {
            SiteData site = SiteData.GetSiteFromCache(this.SiteID);

            if (!string.IsNullOrEmpty(this.NewTrackBackURLs)) {
                this.NewTrackBackURLs = this.NewTrackBackURLs.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n\n", "\n");
                string[] TBURLs = this.NewTrackBackURLs.Split('\n');
                foreach (string sURL in TBURLs) {
                    List<TrackBackEntry> lstTB = TrackBackEntry.FindTrackbackByURL(this.Root_ContentID, sURL);
                    if (lstTB.Count < 1) {
                        TrackBackEntry tbe = new TrackBackEntry {
                            Root_ContentID = this.Root_ContentID,
                            TrackBackURL = sURL,
                            TrackedBack = false
                        };

                        tbe.Save();
                    }
                }
            }

            if (this.IsLatestVersion && site.SendTrackbacks) {
                List<TrackBackEntry> lstTBQ = TrackBackEntry.GetTrackBackQueue(this.Root_ContentID);
                foreach (TrackBackEntry t in lstTBQ) {
                    if (t.CreateDate > site.Now.AddMinutes(-10)) {
                        try {
                            TrackBacker tb = new TrackBacker();
                            t.TrackBackResponse = tb.SendTrackback(t.Root_ContentID, site.SiteID, t.TrackBackURL);
                            t.TrackedBack = true;
                            t.Save();
                        } catch (Exception ex) { }
                    }
                }
            }
        }
Example #8
0
 public List <TrackBackEntry> GetTrackbacks()
 {
     return(TrackBackEntry.GetPageTrackBackList(this.Root_ContentID));
 }