/** * Sendet das Formular zum Eintragen der Nachricht. Je nach Parameter werden Standartwerte oder POST-Daten an * das Formular weitergegeben. * * @param boolean $first_form * @param string $error */ private function _send_entryform($first_form = true, $error = null) { $this->_tpl_file = "mailform.tpl"; /* Daten ermitteln */ if ($first_form == false) { /* Daten aus Post-Array */ $data = array('entry_id' => $this->_gpc['POST']['entry_id'], 'entry_title' => $this->_gpc['POST']['title'], 'entry_content' => $this->_gpc['POST']['content'], 'entry_name' => $this->_gpc['POST']['name'], 'entry_email' => $this->_gpc['POST']['email'], 'sessioncode' => $this->_sessioncode); } else { /* Standard-Einträge */ $mail_vars = $this->_configvars['Mail']; $data = array('entry_id' => $this->_gpc['GET']['entry_id'], 'entry_title' => $mail_vars['entry_title'], 'entry_content' => $mail_vars['entry_content'], 'entry_name' => $mail_vars['entry_name'], 'entry_email' => $mail_vars['entry_email'], 'sessioncode' => $this->_sessioncode); } /* Error-Einträge */ if (isset($error)) { $data['dump_errors'] = true; $data['error_title'] = $this->_configvars['Form_Error']['error_in_form']; $data['error_contents'] = $error; } $hash = $this->_captcha->get_pic(4); $data['captcha_img'] = $hash; $this->_mysql->query("SELECT `{$this->mail_tbl['column_name']}` FROM `{$this->mail_tbl['table']}` WHERE `{$this->mail_tbl['column_ID']}` = '{$data['entry_id']}' LIMIT 1"); $member_array = $this->_mysql->fetcharray(); $data['reciver_name'] = $member_array[$this->mail_tbl['column_name']]; $this->_smarty->assign($data); }
/** * Erstellt das Eintragsformular für Beiträge im Gästebuch. Wenn nötig werden der vorhergehende * Einträg (und die Kommentare dazu) ermittelt. * * @param boolean $first_form 1. Aufruf des Formulars? * @param string|null $error Errortexte * @param boolean $comment Ist der Beitrag ein Kommentar? * @param boolean $mysql_data Werden die Daten vom Mysql geholt. */ private function _send_entryform($first_form = true, $error = null, $comment = false) { $data = array(); /* Daten ermitteln */ if ($first_form == false) { /* Daten aus Post-Array */ if ($comment == false) { $data['entry_title'] = stripslashes($this->_gpc['POST']['title']); } $data += array('entry_content' => stripslashes($this->_gpc['POST']['content']), 'entry_name' => stripslashes($this->_gpc['POST']['name']), 'entry_email' => stripslashes($this->_gpc['POST']['email']), 'entry_hp' => stripslashes($this->_gpc['POST']['hp']), 'sessioncode' => $this->_sessioncode); } else { /* Standard-Einträge */ $gbook_vars = $this->_configvars['Gbook']; $data += array('entry_title' => $gbook_vars['entry_title'], 'entry_content' => $gbook_vars['entry_content'], 'entry_name' => $gbook_vars['entry_name'], 'entry_email' => $gbook_vars['entry_email'], 'entry_hp' => $gbook_vars['entry_hp'], 'sessioncode' => $this->_sessioncode); } /* Bei Kommentaren ist der vorhergehende Eintrag zu ermitteln */ if ($comment == true) { $this->_tplfile = "gbook_comment.tpl"; $data['gbook'] = $this->_msbox->getEntry($this->_gpc['GET']['ref_ID'], $this->_timeformat, true); $data['gbook']['gbook_title'] = htmlentities($data['gbook']['gbook_title']); $data['gbook']['gbook_content'] = htmlentities($data['gbook']['gbook_content']); $data['gbook']['gbook_email'] = htmlentities($data['gbook']['gbook_email']); $data['gbook']['gbook_hp'] = htmlentities($data['gbook']['gbook_hp']); $data['gbook']['gbook_name'] = htmlentities($data['gbook']['gbook_name']); $data['gbook']['gbook_content'] = $this->_smilie->show_smilie($data['gbook']['gbook_content'], $this->_mysql); /* HTML-Zeichen umwandeln */ foreach ($data['gbook']['comments'] as $key => $value) { $data['gbook']['comments'][$key]['gbook_content'] = htmlentities($value['gbook_content']); $data['gbook']['comments'][$key]['gbook_email'] = htmlentities($value['gbook_email']); $data['gbook']['comments'][$key]['gbook_hp'] = htmlentities($value['gbook_hp']); $data['gbook']['comments'][$key]['gbook_name'] = htmlentities($value['gbook_name']); $data['gbook']['comments'][$key]['gbook_content'] = $this->_smilie->show_smilie($data['gbook']['comments'][$key]['gbook_content'], $this->_mysql); } /*Anzeigetitle des Editors festlegen */ $data['entry_title'] = 'RE: ' . $data['gbook']['gbook_title']; } else { /* Keine Kommentareintrag -> Normaler Editor */ $this->_tplfile = "gbook_entry.tpl"; } /* Error-Einträge */ if (isset($error)) { $data['dump_errors'] = true; $data['error_title'] = 'Fehler im Formular'; $data['error_content'] = $error; } $hash = $this->_captcha->get_pic(4); $data['captcha_img'] = $hash; $data['smilies_list'] = $this->_smilie->create_smiliesarray($this->_mysql); $this->_smarty->assign($data); }