running some code "from an admin controller"


Well-known member
I have some code that i'm advised that i need to run "from an admin controller".

Any chance someone could spend a minute or two explaining this, and telling me how i could do this please???



Well-known member
What exactly you are trying? A better explanation could help.

But, if do undestand you, i think you could just create your own ControllerAdmin which extends to XenForo_ControllerAdmin_Abstract.


Well-known member
Ok - We know at the moment that xF when deleting threads doesnt remove these from the DB. I believe this is being worked on for a later release, however Kier suggested the following :

Well, you could try this from an admin controller:
// deleted forums:$nodes = array(1, 2, 3);
$threadModel = $this->getModelFromCache('XenForo_Model_Thread');$imodThreadModel = $this->getModelFromCache('XenForo_Model_InlineMod_Thread');
$threads = $threadModel->getThreads(array('node_id' => $nodes));
$threadIds = array_keys($threads);
$imodThreadModel->deleteThreads($threadIds, array('deleteType' => 'hard'));
I think that will do the job...
I have plenty of power on the server ( i believe the issue is down to the amount of resources it takes to delete these on bulk), however i'm at a loss as to where/how i can run it??? Please remember i'm not a developer, so it would have to be easy to follow ;)

I just desperately want to get the old posts removed from the db so i can move hosts :)