1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Setting up a Trash Forum

Discussion in 'Code Modifications [Archive]' started by Vincent, Jun 2, 2011.

  1. Vincent

    Vincent Well-Known Member

    I like to have a trash forum at my forums so here is how to do it:

    1. Set up a Trash Forum, don't forget to untick "Allow new messages to be posted in this forum".

    2. In library\XenForo\Model\Thread.php and In library\XenForo\Model\InlineMod\Thread.php change:
    $dw->set('discussion_state', 'deleted');

    $dw->set('node_id', 'xxx');
    3. Change xxx with the ID of your trash forum.

    Now, every time you soft-delete a thread it will appear as a visible thread in the trash forum you created.
    Permanently deleted threads are still permanently deleted :)
  2. James

    James Well-Known Member

    Never mind, silly me ;) I'd recommend commenting the code out instead of actually replacing it.
  3. Vincent

    Vincent Well-Known Member

    I think you're smart enough and skilled enough to do that :D
  4. Forsaken

    Forsaken Well-Known Member

  5. James

    James Well-Known Member

    $dw->setExtraData(XenForo_DataWriter_Discussion::DATA_DELETE_REASON, $options['reason']); $dw->set('discussion_state', 'deleted'); $dw->set('node_id', '9999'); $dw->save();
    Except this version sets the discussion state to deleted and changes the forum it's in (which seems pointless ;)). There's also an add-on for this somewhere.
  6. Vincent

    Vincent Well-Known Member

    Rob Fritz likes this.
  7. Robert F Schmitz

    Robert F Schmitz Well-Known Member

    We will Grave Yard posts when dead. Thanks for this tip.
  8. RobParker

    RobParker Well-Known Member

    This only works for threads and not posts?
  9. Vincent

    Vincent Well-Known Member

    I can also create it for posts, but that will be trouble-ish no?
  10. Floris

    Floris Guest

    Very interesting, thanks for sharing Vincent.

    On http://xenfans.com we have a private archive that only the admins have access to. It's


    Archive is where the current content goes, the staff sub forum is where all private team discussions go, and and the 2010 is just older archive content from previous year(s), so we have a current + history (makes it easier to search through).

    Your approach to a trash bin, interesting.
  11. RobParker

    RobParker Well-Known Member

    I assume you'd have to create a new thread in the trash forum for the post that's deleted so yeah, maybe it would be.
  12. Vincent

    Vincent Well-Known Member

    That was the plan indeed :)
    I really think it would be weird mate :s

Share This Page