Lack of interest Auto Thread Delete every X Days

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.
This suggestion has been closed. Votes are no longer accepted.
Perhaps. But is there need for such a feature? I probably wouldnt ever use this because I value my topics (except perhaps spam). It'd be more useful to just do a tutorial on how to set this up as a cron job
 
Code:
public function deleteThreads()
{
	$deleteDate = strtotime('-365 days');

	$threads = $this->_getDb()->fetchAll("
		SELECT * FROM xf_thread
		WHERE last_post_date < ?
	", $deleteDate);

	foreach ($threads AS $thread)
	{
		$this->getModelFromCache('XenForo_Model_Thread')->deleteThread($thread['thread_id'], 'hard');
		XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
	}
}

This function will HARD delete all threads that haven't had a new post in over 365 days. Just add it to a cron.
 
PHP:
XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
C&P?:D
 
Perhaps. But is there need for such a feature? I probably wouldnt ever use this because I value my topics (except perhaps spam). It'd be more useful to just do a tutorial on how to set this up as a cron job

Topics that have become obsolete on my forum get pruned after x-amount of days from the last posting (well it did while were on vB :p). If this was section specific, it would be really nice as not all sections get an "obsolete" time frame.
 
I think it is a bad idea, cause all that old good threads with lots of good info and search engine friendly would also get deleted. I think a simple addon should do it for you or a cron job.
 
Code:
public function deleteThreads()
{
$deleteDate = strtotime('-365 days');

$threads = $this->_getDb()->fetchAll("
SELECT * FROM xf_thread
WHERE last_post_date < ?
", $deleteDate);

foreach ($threads AS $thread)
{
$this->getModelFromCache('XenForo_Model_Thread')->deleteThread($thread['thread_id'], 'hard');
XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
}
}

This function will HARD delete all threads that haven't had a new post in over 365 days. Just add it to a cron.

any clue how to make it forum specific?
Lets say for classified forums (and childs) so posts would be auto-deleted after 30 days ?
 
Top Bottom