Ejemplo n.º 1
0
 protected virtual void FireAfterMarkAsSpam(MarkAsSpamEventArgs e)
 {
     if (AfterMarkAsSpam != null)
     {
         AfterMarkAsSpam(this, e);
     }
 }
Ejemplo n.º 2
0
        public void MarkAsSpam()
        {
            var markAsSpamEventArgs = new MarkAsSpamEventArgs();

            FireBeforeMarkAsSpam(markAsSpamEventArgs);

            if (markAsSpamEventArgs.Cancel)
            {
                return;
            }

            var forum = new Forum(ParentId);

            var topic          = GetTopic(Id);
            var member         = new Member(topic.MemberId);
            var akismetApi     = Forum.GetAkismetApi();
            var akismetComment = Forum.ConstructAkismetComment(member, "topic", string.Format("{0} - {1}", Title, Body));

            akismetApi.SubmitSpam(akismetComment);

            Data.SqlHelper.ExecuteNonQuery("UPDATE forumTopics SET isSpam = 1 WHERE id = @id", Data.SqlHelper.CreateParameter("@id", Id.ToString(CultureInfo.InvariantCulture)));

            Id = 0;

            forum.Save();

            FireAfterMarkAsSpam(markAsSpamEventArgs);
        }
Ejemplo n.º 3
0
        public void MarkAsSpam()
        {
            var e = new MarkAsSpamEventArgs();

            FireBeforeMarkAsSpam(e);

            if (e.Cancel)
            {
                return;
            }

            var topic = Topic.GetTopic(TopicId);
            var forum = new Forum(topic.ParentId);

            var member         = new Member(MemberId);
            var akismetApi     = Forum.GetAkismetApi();
            var akismetComment = Forum.ConstructAkismetComment(member, "comment", Body);

            akismetApi.SubmitSpam(akismetComment);

            Data.SqlHelper.ExecuteNonQuery("UPDATE forumComments SET isSpam = 1 WHERE id = " + Id);
            Id = 0;

            topic.Save(true);
            forum.Save();

            FireAfterMarkAsSpam(e);
        }
Ejemplo n.º 4
0
 protected virtual void FireBeforeMarkAsSpam(MarkAsSpamEventArgs e)
 {
     _e.FireCancelableEvent(BeforeMarkAsSpam, this, e);
 }
Ejemplo n.º 5
0
 protected virtual void FireAfterMarkAsSpam(MarkAsSpamEventArgs e)
 {
     if (AfterMarkAsSpam != null)
         AfterMarkAsSpam(this, e);
 }
Ejemplo n.º 6
0
        public void MarkAsSpam()
        {
            var e = new MarkAsSpamEventArgs();

            FireBeforeMarkAsSpam(e);

            if (e.Cancel)
                return;

            var topic = Topic.GetTopic(TopicId);
            var forum = new Forum(topic.ParentId);

            var member = new Member(MemberId);
            var akismetApi = Forum.GetAkismetApi();
            var akismetComment = Forum.ConstructAkismetComment(member, "comment", Body);
            akismetApi.SubmitSpam(akismetComment);

            Data.SqlHelper.ExecuteNonQuery("UPDATE forumComments SET isSpam = 1 WHERE id = " + Id);
            Id = 0;

            topic.Save(true);
            forum.Save();

            FireAfterMarkAsSpam(e);
        }
Ejemplo n.º 7
0
        public void MarkAsSpam()
        {
            var markAsSpamEventArgs = new MarkAsSpamEventArgs();
            FireBeforeMarkAsSpam(markAsSpamEventArgs);

            if (markAsSpamEventArgs.Cancel)
                return;

            var forum = new Forum(ParentId);

            var topic = GetTopic(Id);
            var member = new Member(topic.MemberId);
            var akismetApi = Forum.GetAkismetApi();
            var akismetComment = Forum.ConstructAkismetComment(member, "topic", string.Format("{0} - {1}", Title, Body));
            akismetApi.SubmitSpam(akismetComment);

            Data.SqlHelper.ExecuteNonQuery("UPDATE forumTopics SET isSpam = 1 WHERE id = @id", Data.SqlHelper.CreateParameter("@id", Id.ToString(CultureInfo.InvariantCulture)));

            Id = 0;

            forum.Save();

            FireAfterMarkAsSpam(markAsSpamEventArgs);
        }
Ejemplo n.º 8
0
 protected virtual void FireBeforeMarkAsSpam(MarkAsSpamEventArgs e)
 {
     _events.FireCancelableEvent(BeforeMarkAsSpam, this, e);
 }
Ejemplo n.º 9
0
        public void MarkAsSpam()
        {
            var e = new MarkAsSpamEventArgs();

            FireBeforeMarkAsSpam(e);

            if (e.Cancel)
                return;

            var topic = Topic.GetTopic(TopicId);
            var forum = new Forum(topic.ParentId);

            Member member = null;
            try { member = new Member(topic.MemberId); }
            catch (Exception) { }

            if (member != null)
            {
                member.getProperty("blocked").Value = true;
                member.Save();
            }

            Data.SqlHelper.ExecuteNonQuery("UPDATE forumComments SET isSpam = 1 WHERE id = " + Id);
            Id = 0;

            topic.Save(true, true);
            forum.Save();

            member.getProperty("blocked").Value = true;
            member.Save();

            Forum.SendSpamMail(Body, TopicId, "comment", member == null ? 0 : member.Id, true);

            FireAfterMarkAsSpam(e);
        }
Ejemplo n.º 10
0
        public void MarkAsSpam()
        {
            var markAsSpamEventArgs = new MarkAsSpamEventArgs();
            FireBeforeMarkAsSpam(markAsSpamEventArgs);

            if (markAsSpamEventArgs.Cancel)
                return;

            var forum = new Forum(ParentId);

            var topic = GetTopic(Id);
            var member = new Member(topic.MemberId);
            member.getProperty("blocked").Value = true;
            member.Save();

            Data.SqlHelper.ExecuteNonQuery("UPDATE forumTopics SET isSpam = 1 WHERE id = @id", Data.SqlHelper.CreateParameter("@id", Id.ToString(CultureInfo.InvariantCulture)));

            Id = 0;

            forum.Save();

            Forum.SendSpamMail(Body, Id, "topic", member.Id, true);

            FireAfterMarkAsSpam(markAsSpamEventArgs);
        }