should fix contact form

This commit is contained in:
real_nowhereman 2008-03-18 21:03:07 +00:00
parent 0d6ef5c515
commit 931bf69c0a
2 changed files with 15 additions and 8 deletions

View File

@ -28,11 +28,14 @@
function contact_form() {
global $smarty, $lang;
global $smarty, $lang, $fp_config;
$smarty->assign('notifications',system_geterr('contact'));
if(empty($_POST)) {
$smarty->assign('success', system_geterr('contact'));
$smarty->assign_by_ref('panelstrings', $lang['contact']);
// new form, we (re)set the session data
SmartyValidate::connect($smarty, true);
// register our validators
@ -60,17 +63,17 @@
$msg .= "WWW: {$arr['url']}\n\n";
$msg .= "Content:\n{$arr['content']}\n";
@utils_mail(
$success = @utils_mail(
(
isset($arr['email'])?
$arr['email']
:
$this->config['EMAIL']
$fp_config['general']['email']
),
"Contact sent through {$fp_config['general']['title']} ", $msg );
system_seterr('contact', 1);
utils_redirect();
system_seterr('contact', $success? 1 : -1);
utils_redirect(basename(__FILE__));
} else {
$smarty->assign('values', $_POST);
}

View File

@ -13,7 +13,6 @@
'fieldset3' => 'Send',
'submit' => 'Send',
'reset' => 'Reset',
'success' => 'Message was sent successfully',
);
@ -24,4 +23,9 @@
'content' => 'You must enter a message',
);
$lang['contact']['msgs'] = array(
1 => 'Message was sent successfully',
-1 => 'Message could not be sent',
);
?>