4 The pages "Acronyms" and "Abbreviations" are read in by this plugin,
5 and its contents (a table or definition list) are used to replace
6 all occourences of the noticed words with <abbr> and <acronym> tags
7 on other pages (case-sensitive).
10 $ewiki_config["acronym"][] = "Acronyms";
11 $ewiki_config["abbr"][] = "Abbreviations";
14 $ewiki_plugins["format_final"][] = "ewiki_acronyms";
15 //(or even) $ewiki_plugins["page_final"][] = "ewiki_acronyms";
18 function ewiki_acronyms(&$html) {
22 foreach (array("acronym", "abbr") as $tag) {
24 #-- read in data pages
26 foreach ($ewiki_config[$tag] as $id) {
27 $data = ewiki_db::GET($id);
28 preg_match_all('/^[|:]\s*(\w+)\s*[|:]\s*(.+?)[|:\s]*$/m', $data["content"], $uu);
29 foreach ($uu[1] as $i=>$str) {
30 $list[$str] = htmlentities($uu[2][$i]);
34 #-- add html tags to current page
35 if ($list && ($search = implode("|", array_keys($list)))) {
38 "/($search)([^>]*<)/mse",
39 "'<$tag title=\"'.\$list['$1'].'\">$1</$tag>' . stripslashes('$2')",
42 $html = rtrim($html, "<");