"; } else { $MessageTyp = "\"""; } $MessageHeadline = "

" . $MessageHeadline . "

"; // Format $MessageHeadline $MessageText = "

" . $MessageText . "

"; // Format $MessageText $format = "
\n\n\n\n\n\n
" . $MessageTyp . "" . $MessageHeadline . $MessageText . "
\n
\n"; if (is_array($MessageVariables)) { array_unshift($MessageVariables, $format); call_user_func_array('printf',$MessageVariables); } else { printf($format, $MessageVariables); } } /** * Use the three replace functions on the submitted Text. * * @access private * * @param string The text that is used to search for replaceable strings. * * @return string The processed text. */ function parseMessageString($MessageString) { return linkText(colorText(boldText($MessageString))); } /** * Replace {bold} and {endbold} with and HTML-Tags. * * @access private * * @param string The text that is used to search for {bold} and {endbold} tags. * * @return string The submitted text with {bold} and {endbold} replaced with * the appropriate HTML tages and */ function boldText($text) { $pattern = "/\{bold\}([^{]*)\{endbold\}/"; // Regular expression matching {bold}[Text]{endbold} $replace = "\\1"; // Replace pattern return preg_replace($pattern,$replace,$text); } /** * Replace {color=#[HEX-Value]} or {color=[HEX-Value]} and {endcolor} with and HTML-Tags. * * @access private * * @param string * * @return string */ function colorText($text) { $pattern = "/\{color=#?([0-9,a-f,A-F]{6})\}([^{]*)\{endcolor\}/"; // Regular expression matching {color=#[HEX-Value]}[Text]{endcolor} or {color=[HEX-Value]}[Text]{endcolor} $replace = "\\2"; // Replace pattern return preg_replace($pattern,$replace,$text); } /** * Replace {link=[Link-Target]} and {endlink} with and HTML-Tags. * * @access private * * @param string * * @return string */ function linkText($text) { $pattern = "/\{link=([^}]*)\}([^{]*)\{endlink\}/"; // Regular expression matching {link=[Link-Target]}[Text]{endlink} $replace = "\\2"; //Replace pattern return preg_replace($pattern,$replace,$text); } ?>