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

running some code "from an admin controller"

Paul

Well-known member
#1
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???

Cheers
Paul
 

Fuhrmann

Well-known member
#2
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.
 

Paul

Well-known member
#3
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:
PHP:
// 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 :)

Cheers
Paul