Hi guys!
I'm using:
if ( $this->topic['topic_move_time'] <= time() )
{
$this->DB->update( 'topics', array( 'forum_id' => $this->topic['topic_move_forum'] ), 'tid = '.$this->topic['tid'], true );
require_once( IPSLib::getAppDir('forums') . '/sources/classes/moderate.php' );
$moderatorLibrary = new moderatorLibrary( $this->registry );
$moderatorLibrary->rebuildTopic( $this->topic['tid'], false );
$moderatorLibrary->forumRecount( $this->topic['forum_id'] );
$moderatorLibrary->forumRecount( $this->topic['topic_move_forum'] );
$moderatorLibrary->statsRecount();
$this->DB->update( 'topics ', array( 'topic_move_time' => 0 ), 'tid = '.$this->topic['tid'], true );
}
It's working. A topic is 'moved' to another forum in specif time.
The only problem is that the source forum keeps showing last post info of that topic, which is in other forum now.
The topic now is inside 'New Forum'. But it shows on last info of 'A Test Forum'. When I go to 'A Test Forum', the topic it's not there:
StatsRecount:
/**
* Recount total topics and replies for site statistics
*
* @access public
* @return boolean
*/
public function statsRecount()
{
$this->cache->rebuildCache( 'stats', 'global' );
return true;
}
For its definition, it won't update forum cache.
When you empty a forum on Admin CP, it updates the cache. They use:
//-----------------------------------------
// Rebuild forum cache
//-----------------------------------------
$this->recacheForums();
But this function is uselless:
/**
* Recache the forums
*
* @access public
* @return void
* @deprecated We're moving away from forum cache
**/
public function recacheForums()
{
//$this->registry->class_forums->updateForumCache();
}
:huh:
How to update that cache/last post info properly, since what I'm doing seems not to work ?
:huh: