-function show_user_error(&$errmsg)\r
-{\r
- global $captcha_enable, $email, $name, $subject, $text, $tpl_user_error;\r
+function show_user_error($errmsg) {\r
+ global $captcha_enable, $email, $name, $subject, $text, $user_fields, $tpl_user_error;\r
+\r
+ $tpl = new Template;\r
+ $tpl->read_file($tpl_user_error);\r
+\r
+ $tpl->parse_if_block('CAPTCHA',$captcha_enable);\r
+\r
+ $tpl->set_var('EMAIL', htmlspecialchars($email));\r
+ $tpl->set_var('ERROR', $errmsg);\r
+ $tpl->set_var('NAME', htmlspecialchars($name));\r
+ $tpl->set_var('SUBJECT',htmlspecialchars($subject));\r
+ $tpl->set_var('TEXT', htmlspecialchars($text));\r
+\r
+ if(isset($user_fields)) {\r
+ reset($user_fields);\r