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

Setting up a Trash Forum

Vincent

Well-known member
#1
VincentU submitted a new resource:

Setting up a Trash Forum (version 1.0) - Set up a Trash Forum

I like to have a trash forum at my site so here's 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:
Code:
$dw->set('discussion_state', 'deleted');
to

Code:
$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...
Read more about this resource...
 

Moddis

Active member
#7
Just tested and realized that it doesnt actually delete a posts, just moves it to that thread.

Would it be possible to:
  • Delete the thread AND move it to the trash forum?
  • When moving it, to note from what forum it was moved from?
Thanks.
 

Moddis

Active member
#11
You mean a redirect?
Im not sure if a permanent redirect can work in that way but basically, if I delete a thread from forum "General Chat", it will get moved to "Trash" forum. So if I decide to restore/undelete it, the thread would know to restore itself in the "General Chat" forum.
 

tyteen4a03

Well-known member
#12
Im not sure if a permanent redirect can work in that way but basically, if I delete a thread from forum "General Chat", it will get moved to "Trash" forum. So if I decide to restore/undelete it, the thread would know to restore itself in the "General Chat" forum.
I don't think that can happen without a more advanced addon.
 

Moddis

Active member
#15
Cool!

As a suggestion, a separate page or view (without actually moving those threads from their original forum) that would list all deleted threads from all forums would be AWESOME!
 
Last edited:
#16
Getting an error:

#0 /www/library/XenForo/Model/Thread.php(1941): XenForo_Application::handlePhpError(4096, 'Object of class...', '/www/...', 1941, Array)
#1 /www/library/XenForo/ControllerPublic/Thread.php(1261): XenForo_Model_Thread->deleteThread(3, 'soft', Array)
#2 /www/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Thread->actionDelete()
#3 /www/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /www/index.php(13): XenForo_FrontController->run()

ErrorException: Object of class EWRporta_DataWriter_Discussion_Thread could not be converted to string - library/XenForo/Model/Thread.php:1941

I'm think that that line is the dw->set('diss...

Anyone know how to fix
 

tyteen4a03

Well-known member
#17
Getting an error:

#0 /www/library/XenForo/Model/Thread.php(1941): XenForo_Application::handlePhpError(4096, 'Object of class...', '/www/...', 1941, Array)
#1 /www/library/XenForo/ControllerPublic/Thread.php(1261): XenForo_Model_Thread->deleteThread(3, 'soft', Array)
#2 /www/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Thread->actionDelete()
#3 /www/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /www/index.php(13): XenForo_FrontController->run()

ErrorException: Object of class EWRporta_DataWriter_Discussion_Thread could not be converted to string - library/XenForo/Model/Thread.php:1941

I'm think that that line is the dw->set('diss...

Anyone know how to fix
Seems like a clash with XenPorta.
 
#19
Another option is to delete the thread AND move it to the trash forum

Code:
find:
$dw->set('discussion_state', 'deleted');
below add (xxx is the node where to move the thread)
$dw->set('node_id', 'xxx');
Change this in both files
In library\XenForo\Model\Thread.php and In library\XenForo\Model\InlineMod\Thread.php