should fix contact form
This commit is contained in:
parent
0d6ef5c515
commit
931bf69c0a
17
contact.php
17
contact.php
@ -28,11 +28,14 @@
|
|||||||
|
|
||||||
function contact_form() {
|
function contact_form() {
|
||||||
|
|
||||||
global $smarty, $lang;
|
global $smarty, $lang, $fp_config;
|
||||||
|
|
||||||
$smarty->assign('notifications',system_geterr('contact'));
|
|
||||||
|
|
||||||
if(empty($_POST)) {
|
if(empty($_POST)) {
|
||||||
|
|
||||||
|
$smarty->assign('success', system_geterr('contact'));
|
||||||
|
$smarty->assign_by_ref('panelstrings', $lang['contact']);
|
||||||
|
|
||||||
|
|
||||||
// new form, we (re)set the session data
|
// new form, we (re)set the session data
|
||||||
SmartyValidate::connect($smarty, true);
|
SmartyValidate::connect($smarty, true);
|
||||||
// register our validators
|
// register our validators
|
||||||
@ -60,17 +63,17 @@
|
|||||||
$msg .= "WWW: {$arr['url']}\n\n";
|
$msg .= "WWW: {$arr['url']}\n\n";
|
||||||
$msg .= "Content:\n{$arr['content']}\n";
|
$msg .= "Content:\n{$arr['content']}\n";
|
||||||
|
|
||||||
@utils_mail(
|
$success = @utils_mail(
|
||||||
(
|
(
|
||||||
isset($arr['email'])?
|
isset($arr['email'])?
|
||||||
$arr['email']
|
$arr['email']
|
||||||
:
|
:
|
||||||
$this->config['EMAIL']
|
$fp_config['general']['email']
|
||||||
),
|
),
|
||||||
"Contact sent through {$fp_config['general']['title']} ", $msg );
|
"Contact sent through {$fp_config['general']['title']} ", $msg );
|
||||||
|
|
||||||
system_seterr('contact', 1);
|
system_seterr('contact', $success? 1 : -1);
|
||||||
utils_redirect();
|
utils_redirect(basename(__FILE__));
|
||||||
} else {
|
} else {
|
||||||
$smarty->assign('values', $_POST);
|
$smarty->assign('values', $_POST);
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
'fieldset3' => 'Send',
|
'fieldset3' => 'Send',
|
||||||
'submit' => 'Send',
|
'submit' => 'Send',
|
||||||
'reset' => 'Reset',
|
'reset' => 'Reset',
|
||||||
'success' => 'Message was sent successfully',
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -24,4 +23,9 @@
|
|||||||
'content' => 'You must enter a message',
|
'content' => 'You must enter a message',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$lang['contact']['msgs'] = array(
|
||||||
|
1 => 'Message was sent successfully',
|
||||||
|
-1 => 'Message could not be sent',
|
||||||
|
);
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user