(2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Functions * */ /** * Prints one ore more errormessages on screen * * @param array Errormessages * @param string A %s in the errormessage will be replaced by this string. * @author Florian Lippert * @author Ron Brand */ function standard_error($errors = '', $replacer = '') { global $db, $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $replacer = htmlentities($replacer); if(!is_array($errors)) { $errors = array( $errors ); } if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) { $link = ''.$lng['panel']['back'].''; } $error = ''; foreach($errors as $single_error) { if(isset($lng['error'][$single_error])) { $single_error = $lng['error'][$single_error]; $single_error = strtr($single_error, array('%s' => $replacer)); } else { $error = 'Unknown Error (' . $single_error . '): ' . $replacer; break; } if(empty($error)) { $error = $single_error; } else { $error.= ' ' . $single_error; } } eval("echo \"" . getTemplate('misc/error', '1') . "\";"); exit; }