コード例 #1
0
ファイル: ForumIndexer.cs プロジェクト: Aaen/OurUmbraco
 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");
 }
コード例 #2
0
ファイル: Forum.cs プロジェクト: KerwinMa/OurUmbraco
 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);
     }
 }
コード例 #3
0
        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");
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: Forum.cs プロジェクト: KerwinMa/OurUmbraco
        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);
        }
コード例 #6
0
ファイル: Forum.cs プロジェクト: nul800sebastiaan/OurUmbraco
        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");
        }
コード例 #7
0
        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");
        }
コード例 #8
0
ファイル: Forum.cs プロジェクト: larrynPL/OurUmbraco
        void Comment_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e)
        {
            Comment c = (Comment)sender;

            //InstantNotification.Execute("NewComment", c.Id);
        }
コード例 #9
0
ファイル: Forum.cs プロジェクト: nul800sebastiaan/OurUmbraco
        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");
        }
コード例 #10
0
ファイル: Sanitizer.cs プロジェクト: AndyButland/OurUmbraco
 void Topic_BeforeUpdate(object sender, uForum.Businesslogic.UpdateEventArgs e)
 {
     SanitizeTopic((uForum.Businesslogic.Topic)sender);
 }
コード例 #11
0
ファイル: Sanitizer.cs プロジェクト: AndyButland/OurUmbraco
 private void SanitizeTopic(uForum.Businesslogic.Topic t)
 {
     //t.Body = our.Utills.Sanitize(t.Body);
     t.Title = our.Utills.Sanitize(t.Title);
 }
コード例 #12
0
ファイル: Sanitizer.cs プロジェクト: AndyButland/OurUmbraco
 private void SanitizeComment(uForum.Businesslogic.Comment c)
 {
     c.Body = our.Utills.Sanitize(c.Body);
 }
コード例 #13
0
ファイル: Sanitizer.cs プロジェクト: AndyButland/OurUmbraco
 void Comment_BeforeUpdate(object sender, uForum.Businesslogic.UpdateEventArgs e)
 {
     SanitizeComment((uForum.Businesslogic.Comment)sender);
 }
コード例 #14
0
ファイル: Forum.cs プロジェクト: KerwinMa/OurUmbraco
 void ForumService_Deleted(object sender, uForum.ForumEventArgs e)
 {
     var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
     ns.RemoveAllForumSubscriptions(e.Forum.Id);
 }
コード例 #15
0
ファイル: ForumIndexer.cs プロジェクト: Aaen/OurUmbraco
 void TopicService_Deleted(object sender, uForum.TopicEventArgs e)
 {
     var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"];
     indexer.DeleteFromIndex(e.Topic.Id.ToString());
 }