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

1/2 a recycling bin


Well-known member
I saw this mod for a trash forum which got me thinking about how to handle deleted threads on XF. His solution moves soft deleted threads to a trash forum. though this works, it sorta defeats the whole soft delete tool. staff will no long see those threads in their forum & if you want to restore it you'd now have make it visible again & then move it to the forum. (if you know what forum it came from)

i took a different route. instead of moving the soft deleted threads I just list the soft deleted threads regardless of what forum they are in. it turns out, it only required a small code edit.

I made my recycling bin forum, made it only viewable to staff, & turned off posting in that forum. then I made small edit to \library\XenForo\Model\Thread.php telling it that if the node ID = my recycling forum then instead of getting threads of that node ID, it should get threads from all forums where the discussion_state = "deleted". that was enough. If you enter that forum, it correctly lists all the soft deleted threads even though they are are still in their original forums. all of the mod tools still work & you can still handle the deleted threads in their respective forums.

so here's why I'm here. I'd like some suggestions on what else to do. before posting it, I'll make a admin field where you set the recycling bin (right now it's hard coded) but how much more should I edit? here are some things I've noticed.

when you are on the main forum page, the "Discussions" & "Message" counts will always both be zero. they won't ever show how many deleted threads are in the recycling bin because technically they aren't really in there. the latest thread field will always be blank too. it just looks weird. i considered generating that info but decided it would be best to hide that forum from the list all together & put a simple text link to the recycling bin up in the top of page Admin bar by the Reported items link. anyway have a better idea? is there a builtin way to hide the node listing? (figured i'd ask encase I missed it)

when you are in the recycling bin & try to use "search this forum", it won't work. should I rig up the search to ignore the node id & instead look for deleted threads too? or should I just hide the link?

I assume I'll just hide the "mark forum read" link.

is there anything else you can think of that a recycling bin would need? is there a XF tool that's i've totally missed & a recycling bin isn't necessary?

thanks in advance. I'm trying to learn this new code while giving myself a refresher in coding in general so this is my little training project for now.