From f089e0a110b85f2e832aceb5538f5e044d30ee1d Mon Sep 17 00:00:00 2001 From: owen Date: Sat, 26 Jun 2021 14:15:53 -0400 Subject: [PATCH] include footnote2 modified to work well with skin --- footnote2.php | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 footnote2.php diff --git a/footnote2.php b/footnote2.php new file mode 100644 index 0000000..980b097 --- /dev/null +++ b/footnote2.php @@ -0,0 +1,95 @@ + 0) { + ksort($fntext); + $out = ($fn_str == "#") ? + "<:block>
 
\n" . implode('',$fntext) : + implode('',$fntext); + } + + $fntext = array(); + $fncount = 0; + $fngroup++; + } else { + $fncount++; + if (preg_match("/#([0-9]+)(?>\\s+(.+))?/s", $fn_str, $fn_str_parts)) { + $fncount = $fn_str_parts[1]; + $fn_str = $fn_str_parts[2]; + } + $fnid = $fngroup . '_' . $fncount; + + $out = ($fn_str_parts[2] != '' && $fntext[$fncount] == '#') ? '' : "[$fncount]"; + global $FootnoteBacklinkCharacter; + if ($fn_str != '') { + $fntext[$fncount] = "
\n" . + "$fncount {$fn_str} $FootnoteBacklinkCharacter\n" . + "
"; + } else if ($fntext[$fncount] == '') { + $fntext[$fncount] = '#'; + } + } + return $out; +}