From dacd29c7ca7bebf206e3603df3a5e35b8b32f80d Mon Sep 17 00:00:00 2001
From: pewgeuges <73141620+pewgeuges@users.noreply.github.com>
Date: Wed, 25 Nov 2020 23:40:45 +0000
Subject: [PATCH] development 2.1.4d1 bugfix, for sharing on Forum
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2426102 b8457f37-d9ea-0310-8a92-e5e31aec5664
---
class/dashboard/layout.php | 2 +-
class/init.php | 2 +-
class/task.php | 94 ++++++++++++++-----
css/public.css | 8 +-
css/settings.css | 4 +-
footnotes.php | 2 +-
readme.txt | 2 +-
templates/public/footnote-alternative.html | 6 +-
templates/public/footnote.html | 6 +-
.../reference-container-body-3column.html | 8 +-
.../reference-container-body-switch.html | 4 +-
.../public/reference-container-body.html | 4 +-
12 files changed, 95 insertions(+), 47 deletions(-)
diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php
index 3737952..b01be16 100644
--- a/class/dashboard/layout.php
+++ b/class/dashboard/layout.php
@@ -207,7 +207,7 @@ abstract class MCI_Footnotes_LayoutEngine {
'mci-footnotes-admin-styles',
plugins_url('../../css/settings.css', __FILE__),
'',
- '2.1.4d0'
+ '2.1.4d1'
);
// UPDATE version # when making changes to settings.css, FOR CACHE BUSTING
diff --git a/class/init.php b/class/init.php
index 6d3489d..0a2c67e 100644
--- a/class/init.php
+++ b/class/init.php
@@ -160,7 +160,7 @@ class MCI_Footnotes {
'mci-footnotes-css-public',
plugins_url('../css/public.css', __FILE__),
'',
- '2.1.4d0'
+ '2.1.4d1'
);
}
diff --git a/class/task.php b/class/task.php
index 5b900d0..405310e 100644
--- a/class/task.php
+++ b/class/task.php
@@ -19,7 +19,7 @@
* 2.1.2: options for the other hooks 2020-11-19T1849+0100
* 2.1.4: fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100
*
- * Last modified: 2020-11-25T0837+0100
+ * Last modified: 2020-11-26T0036+0100
*/
// If called directly, abort:
@@ -448,7 +448,7 @@ class MCI_Footnotes_Task {
// to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents
// spare however values of the href argument!
// see public.css
- $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText );
+ $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText );
// Text to be displayed instead of the footnote
$l_str_FootnoteReplaceText = "";
@@ -479,21 +479,26 @@ class MCI_Footnotes_Task {
// define the HTML element to use for the referrers:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS))) {
- $l_str_Element = 'sup';
+ $l_str_SupSpan = 'sup';
} else {
- $l_str_Element = 'span';
+ $l_str_SupSpan = 'span';
}
+ // determine whether the link element is used, see below
+
+
// fill in 'templates/public/footnote.html':
$l_obj_Template->replace(
array(
- "post_id" => $l_int_PostId,
- "id" => $l_int_Index,
- "element" => $l_str_Element,
- "before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
- "index" => $l_int_Index,
- "after" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER),
- "text" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)) ? $l_str_ExcerptText : "",
+ "post_id" => $l_int_PostId,
+ "id" => $l_int_Index,
+ "link-start" => '',
+ "link-end" => '',
+ "sup-span" => $l_str_SupSpan,
+ "before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
+ "index" => $l_int_Index,
+ "after" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER),
+ "text" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)) ? $l_str_ExcerptText : "",
)
);
$l_str_FootnoteReplaceText = $l_obj_Template->getContent();
@@ -551,16 +556,52 @@ class MCI_Footnotes_Task {
*/
public function ReferenceContainer() {
- // post ID to make everything unique wrt infinite scroll and archive view:
- global $l_int_PostId;
- $l_int_PostId = get_the_id();
-
- // no footnotes has been replaced on this page
+ // no footnotes have been replaced on this page:
if (empty(self::$a_arr_Footnotes)) {
return "";
}
+ /**
+ * INFINITE SCROLL / AUTOLOAD, ARCHIVE VIEW
+ *
+ * Multiple posts are appended to each other, functions and IDs must be disambiguated.
+ * Contributed by @docteurfitness