|
@@ -522,82 +522,4 @@
|
|
|
$read = $entity;
|
|
|
}
|
|
|
|
|
|
- function parseHTMLMessage($line) {
|
|
|
- /** Add any parsing you want to in here **/
|
|
|
- return $line;
|
|
|
- }
|
|
|
-
|
|
|
- function parsePlainTextMessage($line) {
|
|
|
- /** Add any parsing you want to in here */
|
|
|
-
|
|
|
- $line = "^^$line";
|
|
|
-
|
|
|
- if ((strpos(strtolower($line), "<!") == false) &&
|
|
|
- (strpos(strtolower($line), "<html>") == false) &&
|
|
|
- (strpos(strtolower($line), "</html>") == false)) {
|
|
|
- $line = str_replace("<", "<", $line);
|
|
|
- $line = str_replace(">", ">", $line);
|
|
|
- }
|
|
|
-
|
|
|
- $wrap_at = 86; // Make this configurable int the config file some time
|
|
|
- if (strlen($line) - 2 >= $wrap_at) // -2 because of the ^^ at the beginning
|
|
|
- $line = wordWrap($line, $wrap_at);
|
|
|
-
|
|
|
- $line = str_replace(" ", " ", $line);
|
|
|
- $line = str_replace("\t", " ", $line);
|
|
|
- $line = str_replace("\n", "", $line);
|
|
|
-
|
|
|
- if (strpos(trim(str_replace(" ", "", $line)), ">>") == 2) {
|
|
|
- $line = substr($line, 2, strlen($line));
|
|
|
- $line = "<TT><FONT COLOR=FF0000>$line</FONT></TT><BR>\n";
|
|
|
- } else if (strpos(trim(str_replace(" ", "", $line)), ">") == 2) {
|
|
|
- $line = substr($line, 2, strlen($line));
|
|
|
- $line = "<TT><FONT COLOR=800000>$line</FONT></TT><BR>\n";
|
|
|
- } else {
|
|
|
- $line = substr($line, 2, strlen($line));
|
|
|
- $line = "<TT><FONT COLOR=000000>$line</FONT></TT><BR>\n";
|
|
|
- }
|
|
|
-
|
|
|
- if (strpos(strtolower($line), "http://") != false) {
|
|
|
- $line = ereg_replace("<BR>", "", $line);
|
|
|
- $start = strpos(strtolower($line), "http://");
|
|
|
- $link = substr($line, $start, strlen($line));
|
|
|
-
|
|
|
- if (strpos($link, " ")) {
|
|
|
- $end = strpos($link, " ")-1;
|
|
|
- }
|
|
|
- else if (strpos($link, " ")) {
|
|
|
- $end = strpos($link, " ")-1;
|
|
|
- }
|
|
|
- else if (strpos($link, "<")) {
|
|
|
- $end = strpos($link, "<");
|
|
|
- }
|
|
|
- else if (strpos($link, ">")) {
|
|
|
- $end = strpos($link, ">");
|
|
|
- }
|
|
|
- else if (strpos($link, "(")) {
|
|
|
- $end = strpos($link, "(")-1;
|
|
|
- }
|
|
|
- else if (strpos($link, ")")) {
|
|
|
- $end = strpos($link, ")")-1;
|
|
|
- }
|
|
|
- else if (strpos($link, "{")) {
|
|
|
- $end = strpos($link, "{")-1;
|
|
|
- }
|
|
|
- else if (strpos($link, "}")) {
|
|
|
- $end = strpos($link, "}")-1;
|
|
|
- }
|
|
|
- else
|
|
|
- $end = strlen($link);
|
|
|
-
|
|
|
- $link = substr($line, $start, $end);
|
|
|
- $end = $end + $start;
|
|
|
- $before = substr($line, 0, $start);
|
|
|
- $after = substr($line, $end, strlen($line));
|
|
|
-
|
|
|
- $line = "$before<A HREF=\"$link\" TARGET=_top>$link</A>$after<BR>";
|
|
|
- }
|
|
|
-
|
|
|
- return $line;
|
|
|
- }
|
|
|
?>
|