// Copyright: Copyright (C) 2006-2007 Pristine Communications // Set the include path if (!defined("INCPATH_SET")) { require_once dirname(__FILE__) . "/incpath.inc.php"; } // Referenced subroutines require_once "monica/echoform.inc.php"; require_once "monica/htmlchar.inc.php"; // h_abbr: Shortcut to markabbr(h()) function h_abbr($text) { return markabbr(h($text)); } // markabbr: Mark the abbreviation function markabbr($text) { // FAQ $text = preg_replace("/\b(FAQ)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); $text = preg_replace("/\b(FAQ)s\b(?!<\/abbr>|<\/acronym>)/", "$1s", $text); // HTTP $text = preg_replace("/\b(HTTP)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // HTML $text = preg_replace("/\b(HTML)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // CGI $text = preg_replace("/\b(CGI)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // SSL $text = preg_replace("/\b(SSL)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // PDF $text = preg_replace("/\b(PDF\b\.?)(?!<\/abbr>|<\/acronym>)/", "$1", $text); // IP $text = preg_replace("/\b(IP)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // S/N $text = preg_replace("/\b(S\/N)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // No. $text = preg_replace("/\b(No\.|Num\.)(?!<\/abbr>|<\/acronym>)/", "$1", $text); // ID. $text = preg_replace("/\b(ID\.)(?!<\/abbr>|<\/acronym>)/", "$1", $text); // Pic. $text = preg_replace("/\b(Pic\.)(?!<\/abbr>|<\/acronym>)/", "$1", $text); // URL. $text = preg_replace("/\b(URL\b\.?)(?!<\/abbr>|<\/acronym>)/", "$1", $text); // E-mail. $text = preg_replace("/\b(E-?mail)\b(?!<\/abbr>|<\/acronym>)/i", "$1", $text); // MIME $text = preg_replace("/\b(MIME\b\.?)(?!<\/abbr>|<\/acronym>)/", "$1", $text); // KB/MB/GB/TB from report_size() $text = preg_replace("/(\d+) KB\)/", "$1 KB)", $text); $text = preg_replace("/(\d+) MB\)/", "$1 MB)", $text); $text = preg_replace("/(\d+) GB\)/", "$1 GB)", $text); $text = preg_replace("/(\d+) TB\)/", "$1 TB)", $text); // MRTG $text = preg_replace("/\b(MRTG)\b(?!<\/abbr>|<\/acronym>)/", "$1", $text); // Load the local extension // Load it at last to prevent mark-up recursion if (function_exists("markabbr_site")) { $text = markabbr_site($text); } return $text; } ?>