/**
  * Show the form to empty a forum
  *
  * @access	public
  * @return	void		Outputs to screen
  **/
 public function emptyForum()
 {
     /* INI */
     $this->request['f'] = intval($this->request['f']);
     $form_array = array();
     if ($this->request['f'] == "") {
         $this->registry->output->showError($this->lang->words['for_noid'], 1137);
     }
     $this->DB->build(array('select' => 'id, name', 'from' => 'forums', 'where' => "id=" . $this->request['f']));
     $this->DB->execute();
     //-----------------------------------------
     // Make sure we have a legal forum
     //-----------------------------------------
     if (!$this->DB->getTotalRows()) {
         $this->registry->output->showError($this->lang->words['for_noid'], 1138);
     }
     $forum = $this->DB->fetch();
     //-----------------------------------------
     $this->registry->output->html .= $this->html->forumEmptyForum($this->request['f'], $forum);
 }
Example #2
0
 /**
  * Show the form to empty a forum
  *
  * @return	@e void		Outputs to screen
  */
 public function emptyForum()
 {
     /* INI */
     $this->request['f'] = intval($this->request['f']);
     $form_array = array();
     if (!$this->request['f']) {
         $this->registry->output->showError($this->lang->words['for_noid'], 1137);
     }
     $forum = $this->DB->buildAndFetch(array('select' => 'id, name', 'from' => 'forums', 'where' => "id=" . $this->request['f']));
     //-----------------------------------------
     // Make sure we have a legal forum
     //-----------------------------------------
     if (!$forum['id']) {
         $this->registry->output->showError($this->lang->words['for_noid'], 1138);
     }
     /* Now lets check and see if we've any archived topics and that */
     $count = $this->registry->topics->getTopics(array('forumId' => array($forum['id']), 'archiveState' => array('archived', 'working', 'restore'), 'getCountOnly' => true));
     if ($count) {
         $this->registry->output->showError($this->lang->words['contains_archived_topics_so_there_haha'], '1138.1');
     }
     //-----------------------------------------
     $this->registry->output->extra_nav[] = array('', $this->lang->words['frm_emptytitle']);
     $this->registry->output->html .= $this->html->forumEmptyForum($forum);
 }