/**
  * Save the forum rules
  *
  * @access	public
  * @return	void		Outputs to screen
  **/
 public function doRules()
 {
     /* INI */
     $this->request['f'] = intval($this->request['f']);
     if ($this->request['f'] == "") {
         $this->registry->output->showError($this->lang->words['for_noid'], 1136);
     }
     //-----------------------------------------
     // Load editor/bbcode
     //-----------------------------------------
     $_POST['body'] = IPSText::getTextClass('editor')->processRawPost('body');
     IPSText::getTextClass('bbcode')->bypass_badwords = 1;
     IPSText::getTextClass('bbcode')->parse_smilies = 0;
     IPSText::getTextClass('bbcode')->parse_html = 1;
     IPSText::getTextClass('bbcode')->parse_bbcode = 1;
     IPSText::getTextClass('bbcode')->parsing_section = 'rules';
     $_POST['body'] = IPSText::getTextClass('bbcode')->preDbParse($_POST['body']);
     $rules = array('rules_title' => IPSText::makeSlashesSafe(IPSText::stripslashes($_POST['title'])), 'rules_text' => IPSText::makeSlashesSafe($_POST['body']), 'show_rules' => $this->request['show_rules']);
     $this->DB->update('forums', $rules, 'id=' . $this->request['f']);
     $this->recacheForums();
     $this->registry->output->global_message = $this->lang->words['for_rulesup'];
     //-----------------------------------------
     // Bounce back to parent...
     //-----------------------------------------
     $this->request['f'] = $this->forum_functions->forum_by_id[$this->request['f']]['parent_id'];
     $this->showForums();
 }
 /**
  * Saves the add/edit multi moderation form
  *
  * @access	public
  * @param	string  $type  Either 'new' or 'edit'	 
  * @return	void
  **/
 public function multiModerationSaveForm($type = 'new')
 {
     /* INI */
     $forums = array();
     /* Make sure we have a title */
     if (!$this->request['mm_title']) {
         $this->registry->output->showError($this->lang->words['mm_valtitle'], 11333);
     }
     /* Check for forums */
     $forums = $this->_getSelectedForums();
     /* Check forums */
     if (!$forums) {
         $this->registry->output->showError($this->lang->words['mm_forums'], 11334);
     }
     /* Check move location */
     if ($this->request['topic_move'] == 'n') {
         $this->registry->output->showError($this->lang->words['mm_wrong'], 11335);
     }
     /* Build the insert array */
     $save = array('mm_title' => $this->request['mm_title'], 'mm_enabled' => 1, 'topic_state' => $this->request['topic_state'], 'topic_pin' => $this->request['topic_pin'], 'topic_move' => intval($this->request['topic_move']), 'topic_move_link' => intval($this->request['topic_move_link']), 'topic_title_st' => IPSText::makeSlashesSafe($_POST['topic_title_st']), 'topic_title_end' => IPSText::makeSlashesSafe($_POST['topic_title_end']), 'topic_reply' => intval($this->request['topic_reply']), 'topic_reply_content' => IPSText::makeSlashesSafe($_POST['topic_reply_content']), 'topic_reply_postcount' => intval($this->request['topic_reply_postcount']), 'mm_forums' => $forums, 'topic_approve' => intval($this->request['topic_approve']));
     /* Edit */
     if ($type == 'edit') {
         /* ID */
         $id = intval($this->request['id']);
         if (!$id) {
             $this->registry->output->showError($this->lang->words['mm_valid']);
         }
         /* Update the multi mod */
         $this->DB->update('topic_mmod', $save, 'mm_id=' . $id);
     } else {
         /* Insert the new multi mod */
         $this->DB->insert('topic_mmod', $save);
     }
     /* Log, Cache, and Bounce */
     $this->registry->adminFunctions->saveAdminLog(sprintf($this->lang->words['mm_update'], $type));
     $this->multiModerationRebuildCache();
     $this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code);
 }