void ga_AfterInsert(DataBuddyBase dataObject, EventArgs e) { Post post = dataObject as Post; if (post != null) { // Check that post // 1. Is Published // 2. The current verison is set to be published // 3. Is not a future dated post if (post.IsPublished && post.PostStatus == PostStatus.Publish && post.Published.CompareTo(DateTime.UtcNow.AddMinutes(1.0)) <= 0) { // Blog Pings if (EnablePings) { XmlRpcPings.SendPings(post, PingUrls); } // Check for links to send Trackbacks & Pingbacks if (EnableTrackbacks) { LinkParser.CheckPost(post); } } } }
void ga_AfterUpdate(DataBuddyBase dataObject, EventArgs e) { Post post = dataObject as Post; if (post != null) { // Check that post // 1. Is Published // 2. The current verison is set to be published // 3. Was not published within the last 10 seconds (some plugins update the post immediately after it is created, // which can cause double trackbacks/pings) if (post.IsPublished && post.PostStatus == PostStatus.Publish && post.Published.CompareTo(DateTime.UtcNow.AddSeconds(-10.0)) <= 0) { // Blog Pings if (EnablePings) { XmlRpcPings.SendPings(post, PingUrls); } // Check for links to send Trackbacks & Pingbacks if (EnableTrackbacks) { LinkParser.CheckPost(post); } } } }