1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Handle 'movePosts' operation

Discussion in 'XenForo Development Discussions' started by Stepel, Dec 1, 2014.

  1. Stepel

    Stepel Member

    I have to count posts in "specific forum".
    It should count when posts are moved from any forum to this specific forum(+) and vice versa(-).
    Which is the best moment to do that and how to handle "moving" ?

    I extened DataWritter/DiscussionMessage/Post and DataWritter/Discussion/Thread and counting works OK :
    - add new post/thread in specific forum
    - accept/reject posts/threads,
    - delete post/threads,
    - move THREADS

    the last one thing is moving Post..
    Last edited: Dec 2, 2014
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    I'm fairly sure it already updates counts (I would have to verify), but the code to actually move posts is in XenForo_Model_Post::_moveOrCopyPosts(). Extending that method should help you out if necessary. Or extend the DataWriter directly to perform your manipulations.
  3. Stepel

    Stepel Member

    Hmm I am afraid that I can't handle "moving" Post in DataWritter/DiscussionMessage/Post..
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

  5. Stepel

    Stepel Member

    Yes I know that, but I didn't want to modify this methed :)

    Last edited: Dec 3, 2014
  6. tyteen4a03

    tyteen4a03 Well-Known Member

    You extend it, not directly modify it.
  7. Stepel

    Stepel Member

    Of course extend , I know how it works :)

Share This Page