示例#1
0
 private function onMove(GWF_ForumThread $t, GWF_ForumBoard $b)
 {
     //		if (false === ($b->isThreadAllowed())) {
     //			$_POST['move'] = $t->getBoardID();
     //			return $this->module->error('err_no_thread_allowed');
     //		}
     $pc = $t->getPostCount();
     if (false === $t->getBoard()->adjustCounters(-1, -$pc)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === $b->adjustCounters(1, $pc)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === $t->saveVars(array('thread_bid' => $b->getID(), 'thread_gid' => $b->getGroupID()))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === $t->saveVar('thread_bid', $b->getID())) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_thread_moved', array($t->display('thread_title'), $b->display('board_title')));
 }