void TopicService_Updated(object sender, uForum.TopicEventArgs e) { var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"]; var dataSet = ((ForumDataService)indexer.DataService).CreateNewDocument(e.Topic.Id); var xml = dataSet.RowData.ToExamineXml(dataSet.NodeDefinition.NodeId, dataSet.NodeDefinition.Type); indexer.ReIndexNode(xml, "forum"); }
void ForumService_Created(object sender, uForum.ForumEventArgs e) { var content = Umbraco.Web.UmbracoContext.Current.Application.Services.ContentService.GetById(e.Forum.ParentId); if (content.ContentType.Alias == "Project") { var owner = content.GetValue<int>("owner"); //NotificationsWeb.BusinessLogic.Forum.Subscribe(e.Forum.Id, owner); var ns = new NotificationService(ApplicationContext.Current.DatabaseContext); ns.SubscribeToForum(e.Forum.Id, owner); } }
void TopicService_Created(object sender, uForum.TopicEventArgs e) { if (e.Topic != null && e.Topic.MemberId > 0) { var ms = UmbracoContext.Current.Application.Services.MemberService; var member = ms.GetById(e.Topic.MemberId); member.IncreaseForumPostCount(); ms.Save(member); uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewTopic"); a.Perform(member.Id, e.Topic.Id, "New topic created"); } }
void Topic_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) { uForum.Businesslogic.Topic t = (uForum.Businesslogic.Topic)sender; Member mem = new Member(t.MemberId); int posts = 0; int.TryParse(mem.getProperty("forumPosts").Value.ToString(), out posts); mem.getProperty("forumPosts").Value = posts++; mem.Save(); mem.XmlGenerate(new System.Xml.XmlDocument()); Member.RemoveMemberFromCache(mem.Id); Member.AddMemberToCache(mem); }
void TopicService_Created(object sender, uForum.TopicEventArgs e) { var ns = new NotificationService(ApplicationContext.Current.DatabaseContext); ns.SubscribeToForumTopic(e.Topic.Id, e.Topic.MemberId); //send notification InstantNotification not = new InstantNotification(); //data for notification: var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current); var member = membershipHelper.GetById(e.Topic.MemberId); var memberName = string.Empty; if (member != null) memberName = member.Name; not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, e.Topic.GetUrl(), memberName); }
void Comment_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) { Comment c = (Comment)sender; //WB added to show these events are firing... umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, c.Id, "Comment_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is starting"); NotificationsWeb.BusinessLogic.ForumTopic.Subscribe (c.TopicId, c.MemberId); //send notifications InstantNotification not = new InstantNotification(); Member m = new Member(c.MemberId); not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", c, NiceCommentUrl(c.TopicId,c,10),m); //WB added to show these events are firing... umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, c.Id, "Comment_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is finishing"); }
void Topic_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) { uForum.Businesslogic.Topic t = (uForum.Businesslogic.Topic)sender; //WB added to show these events are firing... umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in ForumPostsCounter() class is starting"); Member mem = new Member(t.MemberId); int posts = 0; int.TryParse(mem.getProperty("forumPosts").Value.ToString(), out posts); mem.getProperty("forumPosts").Value = (posts + 1); mem.Save(); mem.XmlGenerate(new System.Xml.XmlDocument()); //Performs the action NewTopic in case we want to reward people for creating new posts. uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewTopic"); a.Perform(mem.Id, t.Id, "New topic created"); //WB added to show these events are firing... umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in ForumPostsCounter() class is finishing"); }
void Comment_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) { Comment c = (Comment)sender; //InstantNotification.Execute("NewComment", c.Id); }
void Topic_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) { Topic t = (Topic)sender; Hashtable fields = new Hashtable(); fields.Add("id", t.Id.ToString()); fields.Add("name", t.Title); fields.Add("author", t.MemberId.ToString()); fields.Add("content", umbraco.library.StripHtml(t.Body)); Businesslogic.Indexer i = new uSearch.Businesslogic.Indexer(); i.AddToIndex("topic_" + t.Id.ToString(), "forumTopics", fields); umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "topic " + t.Id.ToString() + " added"); }
void Topic_BeforeUpdate(object sender, uForum.Businesslogic.UpdateEventArgs e) { SanitizeTopic((uForum.Businesslogic.Topic)sender); }
private void SanitizeTopic(uForum.Businesslogic.Topic t) { //t.Body = our.Utills.Sanitize(t.Body); t.Title = our.Utills.Sanitize(t.Title); }
private void SanitizeComment(uForum.Businesslogic.Comment c) { c.Body = our.Utills.Sanitize(c.Body); }
void Comment_BeforeUpdate(object sender, uForum.Businesslogic.UpdateEventArgs e) { SanitizeComment((uForum.Businesslogic.Comment)sender); }
void ForumService_Deleted(object sender, uForum.ForumEventArgs e) { var ns = new NotificationService(ApplicationContext.Current.DatabaseContext); ns.RemoveAllForumSubscriptions(e.Forum.Id); }
void TopicService_Deleted(object sender, uForum.TopicEventArgs e) { var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"]; indexer.DeleteFromIndex(e.Topic.Id.ToString()); }